public bool Add(OrderModel model) { DB.Order.AddObject(new Order() { Charges = model.Charges, Code = model.Code, Contents = model.Contents, ContentsValue = model.ContentsValue, ContentsWeight = model.ContentsWeight, ID = model.ID, PickupTime = model.PickupTime, SigninTime = model.SigninTime, SrcAddress = model.SrcAddress, SrcUserName = model.SrcUserName, SrcUserPhone = model.SrcUserPhone, ToAddress = model.ToAddress, Status = model.Status, ToUserName = model.ToUserName, ToUserPhone = model.ToUserPhone }); MD_Message message = CreatEmailMessage("新订单", "您有新的订单,请注意查收!"); DB.MD_Message.AddObject(message); DB.SaveChanges(); return(true); }
/// <summary> /// 更新用户消息 /// </summary> /// <param name="msg"></param> /// <returns></returns> public static bool UpdateMessage(MD_Message msg) { string result = OWZX.Data.NewUser.UpdateMessage(msg); if (result.EndsWith("成功")) { return(true); } return(false); }
/// <summary> /// 生成邮件提醒消息 /// </summary> /// <param name="title"></param> /// <param name="content"></param> /// <returns></returns> public MD_Message CreatEmailMessage(string title, string content) { User employe = DB.User.FirstOrDefault(o => o.Role == "Employe" && o.Enable == true && o.IsDeleted == false); MD_Message message = new MD_Message() { ID = Guid.NewGuid(), Mails = employe == null ? "*****@*****.**" : employe.Email, MsgDate = DateTime.Now, IsSended = false, Title = title, Content = content }; return(message); }
public bool AddDelivery(DeliveryInfoModel model) { DB.DeliveryInfo.AddObject(new DeliveryInfo() { OrderCode = model.OrderCode, StorehouseID = model.StorehouseID, VehicleID = model.VehicleID, HandleTime = model.HandleTime, HandleStatus = model.HandleStatus, HandleMessage = model.HandleMessage }); MD_Message message = CreatEmailMessage("物流信息", "物流信息变动,请注意查收!"); DB.MD_Message.AddObject(message); DB.SaveChanges(); return(true); }
/// <summary> /// 添加用户消息记录 /// </summary> /// <param name="msg"></param> /// <returns></returns> public string AddMessage(MD_Message msg) { DbParameter[] parms = { GenerateInParam("@account", SqlDbType.VarChar, 15, msg.Account), GenerateInParam("@title", SqlDbType.VarChar, 20, msg.Title), GenerateInParam("@body", SqlDbType.VarChar, 200, msg.Body) }; string commandText = string.Format(@" begin try INSERT INTO owzx_message([uid],[title],[body]) VALUES ((select uid from owzx_users where rtrim(mobile)=@account),@title,@body) select '添加成功' state end try begin catch select ERROR_MESSAGE() state end catch "); return(RDBSHelper.ExecuteScalar(CommandType.Text, commandText, parms).ToString()); }
/// <summary> /// 更新用户消息 /// </summary> /// <param name="msg"></param> /// <returns></returns> public static string UpdateMessage(MD_Message msg) { return(OWZX.Core.BSPData.RDBS.UpdateMessage(msg)); }
/// <summary> /// 添加用户消息记录 /// </summary> /// <param name="msg"></param> /// <returns></returns> public static string AddMessage(MD_Message msg) { return(OWZX.Core.BSPData.RDBS.AddMessage(msg)); }
/// <summary> /// 更新用户消息 /// </summary> /// <param name="msg"></param> /// <returns></returns> public string UpdateMessage(MD_Message msg) { return(""); }