WCF/WPF公司内部订餐程序开发 (服务端篇)

上班的第一天,群里讨论关于订餐的问题,所以想到了要不要自己开发一个公司内部的订餐系统呢?方便公司内部员工的订餐,有了想法就简单的实践了下 。

实现还是很简单的,因为只是自己内部使用,所以没有考虑太多的因素。数据库选用的Ndatabase,之所以用到数据库其实开始的想法是希望添加一个自动推荐食物的功能的.

1. 新建一个类库工程QSnack.Contract(服务契约工程),结构:

我们定义了三个服务接口:

1) IUserService : 用户服务接口,用户的注册/注销/积分/用户信息更新,  基于basicHttp协议.

    [ServiceContract(Namespace="http://www.swzsoft.cn",Name="UserService")]
public interface IUserService {
/// <summary>
/// 用户注册
/// </summary>
/// <param name="username">用户名</param>
/// <param name="password">用户密码</param>
/// <param name="phone">用户联系电话</param>
/// <returns></returns>
[OperationContract]
int Register(string username, string password, string phone);
/// <summary>
/// 用户注销
/// </summary>
/// <param name="username"></param>
[OperationContract]
void Unregister(string username);
/// <summary>
/// 用户信息更新
/// </summary>
/// <param name="username"></param>
/// <param name="phone"></param>
/// <param name="password"></param>
/// <returns></returns>
[OperationContract]
int UpdateUserInformation(string username, string phone, string password);
/// <summary>
/// 更新用户积分
/// </summary>
/// <param name="username"></param>
/// <param name="intergral"></param>
[OperationContract]
void UpdateIntegral(string username, int intergral);
}

2) IShopService: 商家服务接口, 商家注册/注销/食品/,基于basicHttp协议.

    [ServiceContract(Name="ShopService",Namespace="http://www.swzsoft.cn")]
public interface IShopService {
/// <summary>
/// 注册商家
/// </summary>
/// <param name="shopname">商店名称</param>
/// <param name="phone">商店外卖电话</param>
/// <param name="address">商店所在位置</param>
/// <returns>返回商店的guid</returns>
[OperationContract]
string Register(string shopname, string phone, string address);
/// <summary>
/// 注销商家
/// </summary>
/// <param name="guid"></param>
[OperationContract]
void Unregister(string guid);
/// <summary>
/// 获取所有商家信息
/// </summary>
/// <returns></returns>
[OperationContract]
System.Collections.Generic.List<ShopInfoModel> GetShops();
/// <summary>
/// 获取指定商家保护食物的类别
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
[OperationContract]
System.Collections.Generic.List<FoodModel> GetFoodsByShopGUID(string guid);
}

3) IOrderService:订单服务接口,订单预定/状态改变,基于双工协议.

    [ServiceContract(Name="OrderService",Namespace="http://www.swzsoft.cn",CallbackContract=typeof( IOrderServiceCallback))]
public interface IOrderService {
[OperationContract]
void Order(OrderModel orderModel);
[OperationContract] //targetType == 1 商家 , 0 - 用户
int UpdateOrderState(string id, OrderStateEnum state , int targetType );
} public interface IOrderServiceCallback {
void UpdateStateUser(OrderStateEnum state);
void UpdateStateShop(OrderStateEnum state);
}

2. 异常定义

定义一个异常基类

    [DataContract]
[KnownType(typeof( UserException))]
[KnownType(typeof( ShopException))]
[KnownType(typeof( OrderException))]
public class BasicException {
[DataMember]
public string Message { get; set; }
[DataMember]
public System.Reflection.MethodInfo Method { get; set; }
}

分别定义了:用户异常UserException,ShopException商家服务异常,OrderException 订单异常

3. 模型类

用户模型

[DataContract(Namespace="http://www.swzsoft.cn")]
public class UserModel {
[DataMember(IsRequired = true)]
public string Name { get; set; }
[DataMember(IsRequired = true)]
public string Password { get; set; }
[DataMember(IsRequired=true)]
public string Phone { get; set; }
[DataMember]
public int Intergral { get; set; }
}

    [DataContract(Namespace="http://www.swzsoft.cn")]
public class UserModel {
[DataMember(IsRequired = true)]
public string Name { get; set; }
[DataMember(IsRequired = true)]
public string Password { get; set; }
[DataMember(IsRequired=true)]
public string Phone { get; set; }
[DataMember]
public int Intergral { get; set; }
}

商家模型

[DataContract(Namespace="http://www.swzsoft.cn")]
public class ShopInfoModel {
[DataMember]
public string Name { get; set; }
[DataMember]
public string Address { get; set; }
[DataMember]
public string Phone { get; set; }
[DataMember(IsRequired = true)]
public string ShopGUID { get; set; }
}

    [DataContract(Namespace="http://www.swzsoft.cn")]
public class ShopInfoModel {
[DataMember]
public string Name { get; set; }
[DataMember]
public string Address { get; set; }
[DataMember]
public string Phone { get; set; }
[DataMember(IsRequired = true)]
public string ShopGUID { get; set; }
}

订单模型

[DataContract(Namespace="http://www.swzsoft.cn")]
public class OrderModel {
[DataMember]
public string ID { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public System.Collections.Generic.List<FoodModel> Food { get; set; }
[DataMember] //订餐客户名称
public string ClientName { get; set; }
[DataMember]
public OrderStateEnum OrderState { get; set; }
}

[DataContract]
public enum OrderStateEnum
{
[EnumMember]
Unconfirmed, //未确认
[EnumMember]
Confirmed, //确认
[EnumMember]
Without_Payment, //未付款
[EnumMember]
Payment, //已付款
[EnumMember]
Cancel, //取消
}

    [DataContract(Namespace="http://www.swzsoft.cn")]
public class OrderModel {
[DataMember]
public string ID { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public System.Collections.Generic.List<FoodModel> Food { get; set; }
[DataMember] //订餐客户名称
public string ClientName { get; set; }
[DataMember]
public OrderStateEnum OrderState { get; set; }
} [DataContract]
public enum OrderStateEnum
{
[EnumMember]
Unconfirmed, //未确认
[EnumMember]
Confirmed, //确认
[EnumMember]
Without_Payment, //未付款
[EnumMember]
Payment, //已付款
[EnumMember]
Cancel, //取消
}

食物模型

[DataContract(Namespace="http://www.swzsoft.cn")]
public class FoodModel {
[DataMember(IsRequired = true)]
public string ShopGUID { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public double Price { get; set; }
[DataMember]
public FoodTypeEnum FoodType { get; set; }
}

[DataContract(Namespace="http://www.swzsoft.cn")]
public enum FoodTypeEnum
{
/// <summary>
/// 套餐
/// </summary>
[EnumMember]
FOOD_SETMEAL ,

/// <summary>
/// 汤类
/// </summary>
[EnumMember]
FOOD_SOUP,

/// <summary>
/// 小菜
/// </summary>
[EnumMember]
FOOD_FOOD,
}

    [DataContract(Namespace="http://www.swzsoft.cn")]
public class FoodModel {
[DataMember(IsRequired = true)]
public string ShopGUID { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public double Price { get; set; }
[DataMember]
public FoodTypeEnum FoodType { get; set; }
} [DataContract(Namespace="http://www.swzsoft.cn")]
public enum FoodTypeEnum
{
/// <summary>
/// 套餐
/// </summary>
[EnumMember]
FOOD_SETMEAL , /// <summary>
/// 汤类
/// </summary>
[EnumMember]
FOOD_SOUP, /// <summary>
/// 小菜
/// </summary>
[EnumMember]
FOOD_FOOD,
}

4.数据库,数据库操作分为shopDB,OrderDB,UserDB分别对应不同的服务接口,使用NDatabase数据库

UserDB.cs

public class UserDB {
/// <summary>
/// 插入新的用户
/// </summary>
/// <param name="username"></param>
/// <param name="password"></param>
/// <param name="phone"></param>
/// <returns></returns>
public static int InsertUser(string username, string password, string phone) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj == null) {
UserModel model = new UserModel {
Name = username,
Password = password,
Phone = phone,
Intergral = 0
};
db.Store<UserModel>(model);
return 1;
}

return 0;
}
}

/// <summary>
/// 删除用户
/// </summary>
/// <param name="username"></param>
public static void DeleteUser(string username) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj != null) {
db.Delete<UserModel>(obj);
}
}
}

/// <summary>
/// 更新用户
/// </summary>
/// <param name="username"></param>
/// <param name="password"></param>
/// <param name="phone"></param>
public static void UpdateUser(string username, string password, string phone) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj != null) {
obj.Password = password;
obj.Phone = phone;

db.Store<UserModel>(obj);
}
}
}

/// <summary>
/// 更新用户积分
/// </summary>
/// <param name="integral"></param>
/// <param name="username"></param>
public static void UpdateIntegral(int integral, string username) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj != null) {
obj.Intergral += integral;
db.Store<UserModel>(obj);
}
}
}
}

    public class UserDB {
/// <summary>
/// 插入新的用户
/// </summary>
/// <param name="username"></param>
/// <param name="password"></param>
/// <param name="phone"></param>
/// <returns></returns>
public static int InsertUser(string username, string password, string phone) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj == null) {
UserModel model = new UserModel {
Name = username,
Password = password,
Phone = phone,
Intergral = 0
};
db.Store<UserModel>(model);
return 1;
} return 0;
}
} /// <summary>
/// 删除用户
/// </summary>
/// <param name="username"></param>
public static void DeleteUser(string username) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj != null) {
db.Delete<UserModel>(obj);
}
}
} /// <summary>
/// 更新用户
/// </summary>
/// <param name="username"></param>
/// <param name="password"></param>
/// <param name="phone"></param>
public static void UpdateUser(string username, string password, string phone) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj != null) {
obj.Password = password;
obj.Phone = phone; db.Store<UserModel>(obj);
}
}
} /// <summary>
/// 更新用户积分
/// </summary>
/// <param name="integral"></param>
/// <param name="username"></param>
public static void UpdateIntegral(int integral, string username) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<UserModel>().FirstOrDefault(o => o.Name.Equals(username));
if (obj != null) {
obj.Intergral += integral;
db.Store<UserModel>(obj);
}
}
}
}

OrderDB.cs

public class OrderDB {
public static void InsertOrder(OrderModel model) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<OrderModel>().FirstOrDefault(o => o.ID.Equals(model.ID));
if (obj == null) {
db.Store<OrderModel>(model);
}
}
}

public static int UpdateOrder(string id, OrderStateEnum state) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var objs = (from x in db.AsQueryable<OrderModel>()
where x.ID.Equals(id, StringComparison.CurrentCultureIgnoreCase)
select x).FirstOrDefault();
if (objs == null) {
return 0;
}

if (state == OrderStateEnum.Cancel) {
if (objs.OrderState == OrderStateEnum.Confirmed ||
objs.OrderState == OrderStateEnum.Payment ||
objs.OrderState == OrderStateEnum.Cancel) {
return 0;
}
}
else {
if (state == objs.OrderState) {
return 1;
}
else {
objs.OrderState = state;
}
return 1;
}

return 1;
}
}
}

    public class OrderDB {
public static void InsertOrder(OrderModel model) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<OrderModel>().FirstOrDefault(o => o.ID.Equals(model.ID));
if (obj == null) {
db.Store<OrderModel>(model);
}
}
} public static int UpdateOrder(string id, OrderStateEnum state) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var objs = (from x in db.AsQueryable<OrderModel>()
where x.ID.Equals(id, StringComparison.CurrentCultureIgnoreCase)
select x).FirstOrDefault();
if (objs == null) {
return 0;
} if (state == OrderStateEnum.Cancel) {
if (objs.OrderState == OrderStateEnum.Confirmed ||
objs.OrderState == OrderStateEnum.Payment ||
objs.OrderState == OrderStateEnum.Cancel) {
return 0;
}
}
else {
if (state == objs.OrderState) {
return 1;
}
else {
objs.OrderState = state;
}
return 1;
} return 1;
}
}
}

ShopDB.cs

public class ShopDB {
public static string InsertShop(string name, string address, string phone) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<ShopInfoModel>().FirstOrDefault(o => o.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase));
if (obj == null) {
ShopInfoModel shop = new ShopInfoModel {
Name = name,
Address = address,
Phone = phone,
ShopGUID = new Guid().ToString()
};

db.Store<ShopInfoModel>(shop);
return shop.ShopGUID;
}

return null;
}
}

public static void DeleteShop(string guid){
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<ShopInfoModel>().FirstOrDefault( o=> o.ShopGUID.Equals( guid,StringComparison.CurrentCultureIgnoreCase));
if(obj != null){
db.Delete<ShopInfoModel>(obj);
}
}
}

public static List<ShopInfoModel> QueryShops() {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obs = from o in db.AsQueryable<ShopInfoModel>()
select o;
return obs.ToList();
}
}

public static List<FoodModel> QueryFoods(string guid) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obs = from o in db.AsQueryable<FoodModel>()
where o.ShopGUID.Equals(guid, StringComparison.CurrentCultureIgnoreCase)
select o;
if (obs != null) {
return obs.ToList();
}

return null;
}
}
}

    public class ShopDB {
public static string InsertShop(string name, string address, string phone) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<ShopInfoModel>().FirstOrDefault(o => o.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase));
if (obj == null) {
ShopInfoModel shop = new ShopInfoModel {
Name = name,
Address = address,
Phone = phone,
ShopGUID = new Guid().ToString()
}; db.Store<ShopInfoModel>(shop);
return shop.ShopGUID;
} return null;
}
} public static void DeleteShop(string guid){
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obj = db.AsQueryable<ShopInfoModel>().FirstOrDefault( o=> o.ShopGUID.Equals( guid,StringComparison.CurrentCultureIgnoreCase));
if(obj != null){
db.Delete<ShopInfoModel>(obj);
}
}
} public static List<ShopInfoModel> QueryShops() {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obs = from o in db.AsQueryable<ShopInfoModel>()
select o;
return obs.ToList();
}
} public static List<FoodModel> QueryFoods(string guid) {
using (var db = OdbFactory.Open(GlobeConfig.DATABASE)) {
var obs = from o in db.AsQueryable<FoodModel>()
where o.ShopGUID.Equals(guid, StringComparison.CurrentCultureIgnoreCase)
select o;
if (obs != null) {
return obs.ToList();
} return null;
}
}
}

5. 服务接口实现

UserService 用户服务

public class UserService : IUserService{
public int Register(string username, string password, string phone) {
return UserDB.InsertUser(username, password, phone);
}

public void Unregister(string username) {
UserDB.DeleteUser(username);
}

public int UpdateUserInformation(string username, string phone, string password) {
UserDB.UpdateUser(username, password, phone);
return 1;
}

public void UpdateIntegral(string username, int intergral) {
UserDB.UpdateIntegral(intergral, username);
}
}

    public class UserService : IUserService{
public int Register(string username, string password, string phone) {
return UserDB.InsertUser(username, password, phone);
} public void Unregister(string username) {
UserDB.DeleteUser(username);
} public int UpdateUserInformation(string username, string phone, string password) {
UserDB.UpdateUser(username, password, phone);
return 1;
} public void UpdateIntegral(string username, int intergral) {
UserDB.UpdateIntegral(intergral, username);
}
}

ShopService 商家服务

[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall,ConcurrencyMode=ConcurrencyMode.Multiple,
IgnoreExtensionDataObject = true)]
public class ShopService : IShopService{
public string Register(string shopname, string phone, string address) {
return ShopDB.InsertShop(shopname, address, phone);
}

public void Unregister(string guid) {
ShopDB.DeleteShop(guid);
}

public List<ShopInfoModel> GetShops() {
return ShopDB.QueryShops();
}

public List<FoodModel> GetFoodsByShopGUID(string guid) {
return ShopDB.QueryFoods(guid);
}
}

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall,ConcurrencyMode=ConcurrencyMode.Multiple,
IgnoreExtensionDataObject = true)]
public class ShopService : IShopService{
public string Register(string shopname, string phone, string address) {
return ShopDB.InsertShop(shopname, address, phone);
} public void Unregister(string guid) {
ShopDB.DeleteShop(guid);
} public List<ShopInfoModel> GetShops() {
return ShopDB.QueryShops();
} public List<FoodModel> GetFoodsByShopGUID(string guid) {
return ShopDB.QueryFoods(guid);
}
}

OrderService 订单服务

[ServiceBehavior( ConcurrencyMode=ConcurrencyMode.Multiple,IgnoreExtensionDataObject = true,InstanceContextMode= InstanceContextMode.PerSession)]
public class OrderService :IOrderService{
public static Dictionary<string, IOrderServiceCallback> _callbacks = new Dictionary<string, IOrderServiceCallback>();
public void Order(OrderModel orderModel) {
IOrderServiceCallback callback = OperationContext.Current.GetCallbackChannel<IOrderServiceCallback>();
if (!_callbacks.ContainsKey(orderModel.ID)) {
_callbacks.Add(orderModel.ID, callback);
}

OrderDB.InsertOrder(orderModel);
}

public int UpdateOrderState(string id, OrderStateEnum state,int targetType ) {
int result = OrderDB.UpdateOrder(id, state);
IOrderServiceCallback callback = _callbacks[id];
if (result == 1) {
if (callback != null) {
if (targetType == 1) {//shop
callback.UpdateStateUser(state);
}
else if (targetType == 0) { //user
callback.UpdateStateShop(state);
}
}
}

return result;
}

}

    [ServiceBehavior( ConcurrencyMode=ConcurrencyMode.Multiple,IgnoreExtensionDataObject = true,InstanceContextMode= InstanceContextMode.PerSession)]
public class OrderService :IOrderService{
public static Dictionary<string, IOrderServiceCallback> _callbacks = new Dictionary<string, IOrderServiceCallback>();
public void Order(OrderModel orderModel) {
IOrderServiceCallback callback = OperationContext.Current.GetCallbackChannel<IOrderServiceCallback>();
if (!_callbacks.ContainsKey(orderModel.ID)) {
_callbacks.Add(orderModel.ID, callback);
} OrderDB.InsertOrder(orderModel);
} public int UpdateOrderState(string id, OrderStateEnum state,int targetType ) {
int result = OrderDB.UpdateOrder(id, state);
IOrderServiceCallback callback = _callbacks[id];
if (result == 1) {
if (callback != null) {
if (targetType == 1) {//shop
callback.UpdateStateUser(state);
}
else if (targetType == 0) { //user
callback.UpdateStateShop(state);
}
}
} return result;
} }

 
 
分类: WCF实战项目
标签: wpfWCFC#订餐系统

WCF/WPF公司内部订餐程序开发的更多相关文章

  1. 搭建公司内部的NuGet Server

    随着公司业务慢慢的拓展,项目便会越来越来多,很多项目会依赖其他项目DLL,比如一些底层的技术框架DLL引用,还有各业务系统的也有可能会有引用的可能. 项目多,交叉引用多,如果要是有一个DLL更新,那就 ...

  2. 使用mvvm框架avalon开发公司内部运营管理系统的一些心得

    接触avalon差不多有一年时间了,当时是看前端大牛司徒正美的博客才了解到还有这么一个高大上的玩意,然后就加入了avalon的讨论群.从群里零零散散的了解了avalon的一些特性,感觉很强大,感觉思想 ...

  3. 4: 模块化应用程序开发 Modular Application Development Using Prism Library 5.0 for WPF (英汉对照版)

    A modular application is an application that is divided into a set of loosely coupled functional uni ...

  4. WPF触控程序开发(四)——MultiTouchVista_-_second_release_-_refresh_2的救赎

    起源 Multitouch是一款可用于Win7模拟触摸屏幕的开源软件(关于它的使用介绍),最后一次更新是在11年5月份,我是13年初开始用的,当时开发了一款类似IPhone相册的图片展示触控程序,就是 ...

  5. WPF触控程序开发(二)——整理的一些问题

    上一篇(WPF触控程序开发)介绍了几个比较不错的资源,比较基础.等到自己真正使用它们时,问题就来了,现把我遇到的几个问题罗列下,大家如有遇到其他问题或者有什么好的方法还望赐教. 问题1.如何获取触控点 ...

  6. 【翻译习作】 Windows Workflow Foundation程序开发-第一章03

    1.2.2.Visual Studio 2005扩展包 微软也为Windows Workflow开发者提供了Visual Studio 2005扩展包.扩展包将许多功能集成到Visual Studio ...

  7. iOS开发系列--IOS程序开发概览

    概览 终于到了真正接触IOS应用程序的时刻了,之前我们花了很多时间去讨论C语言.ObjC等知识,对于很多朋友而言开发IOS第一天就想直接看到成果,看到可以运行的IOS程序.但是这里我想强调一下,前面的 ...

  8. ASP.NET4.5Web API及非同步程序开发系列(1)

    认识非同步程序开发设计模型 从VS2012开始引入的新的非同步程序设计的支持-------async/await设计模型 之前的当我们支持非同步作业的时候,往往使用多线程开解决,我们比较熟悉的就是 执 ...

  9. 初识linux端c++程序开发

    关于linux端程序开发,我以前一直不知道是做些什么,只是感觉听高端的.最近接触了一些,有了一些初步的认识. 首先,linux是一个操作系统,跟windows一样:接通电源.按下电脑开机,电脑就会自动 ...

随机推荐

  1. JavaEE Tutorials (1) - 概述

    1.1 Java EE 7平台新增特性3 1.2 Java EE应用模型3 1.3 分布式多层应用4 1.3.1 安全4 1.3.2 Java EE组件5 1.3.3 Java EE客户端6 1.3. ...

  2. Codeforces Round #243 (Div. 1)-A,B,C-D

    此CF真是可笑.. . 由于早晨7初始点,因此,要做好CF时间已经17没有休息一小时,加上中午5小时耐力赛. 心里很清楚.是第一个问题的时候,几乎被解读为寻求最大的领域和.然后找到一个水体,快速A降. ...

  3. 还是畅通project(杭州电1233)

    还是畅通project Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  4. java中IO写文件工具类

    以下是一些依据经常使用java类进行组装的对文件进行操作的类,平时,我更喜欢使用Jodd.io中提供的一些对文件的操作类,里面的方法写的简单易懂. 当中jodd中提供的JavaUtil类中提供的方法足 ...

  5. 安装ruby on rail

    安装: # nvm 安装, 两种方法 $ curl https://raw.githubusercontent.com/creationix/nvm/v0.8.0/install.sh | sh $ ...

  6. MyReport报表引擎2.7.6.7新功能

    新增二维码控件PDF417 设计器新增数据选项卡,可以拖放字段进行绑定   相关链接 MyReport演示.产品站点 相关文章 MyReport专栏

  7. ActivityLifeCycle官方demo分解

    1.左右Activity生命周期的若干条款: p=330">http://1.duoinfo.sinaapp.com/? p=330 http://1.duoinfo.sinaapp. ...

  8. hdu - 3049 - Data Processing(乘法逆元)

    题意:N(N<=40000)个数n1, n2, ..., nN (ni<=N),求(2 ^ n1 + 2 ^ n2 + ... + 2 ^nN) / N % 1000003. 题目链接:h ...

  9. POJ 2724 Purifying Machine(最大独立集)

    POJ 2724 Purifying Machine 题目链接 题意:这题题意有点没看懂.看了别人的题解, 给出m串长度为n的01串. 有些串中可能包括,这种串能够表示两个串,为1 和为0. 反复的算 ...

  10. C#中调用Outlook API 发起会议

    原文:C#中调用Outlook API 发起会议 在我上一篇博文中曾提到了 SharePoint 中调用传出电子邮件中的邮件服务器及地址发送邮件 但是,里面的方法只能用于发送普通电子邮件.如果要发起会 ...