本文整理汇总了C#中LoveBank.Core.MSData.LoveBankDBContext.Update方法的典型用法代码示例。如果您正苦于以下问题:C# LoveBankDBContext.Update方法的具体用法?C# LoveBankDBContext.Update怎么用?C# LoveBankDBContext.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoveBank.Core.MSData.LoveBankDBContext
的用法示例。
在下文中一共展示了LoveBankDBContext.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdminApply
public ActionResult AdminApply(int id, int state, string msg)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
Supervise model = db.T_Supervise.Find(id);
var vol = db.T_Vol;
Vol vEntity = vol.Find(model.AddUser);
if (model.State != SuperviseRowState.已回复)
{
vEntity.LoveBankScore = vEntity.LoveBankScore + 5;
db.Update<Vol>(vEntity);
db.SaveChanges();
}
model.Msg = msg.Trim();
model.State = (SuperviseRowState)state;
db.Update<Supervise>(model);
db.SaveChanges();
#region 发送通知信息
//短信通知
//string failMsg = "【社区1+1】您于" + model.AddTime.ToString("yyyy-MM-dd HH:mm") + "投诉的:" + model.Content + ".管理员处理,处理意见是:" + msg;
SMSComm.Send(vEntity.Phone, "【社区1+1】您于" + model.AddTime.ToString("yyyy-MM-dd HH:mm") + "反映的问题我们将尽快核实处理,感谢您的参与.");
//App 推送通知待完善
#endregion
}
return Success("操作成功");
}
示例2: ChangeStateAdImg
public ActionResult ChangeStateAdImg(int id, int state)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
AppVer img = db.T_AppVer.Find(id);
img.State = state;
db.Update<AppVer>(img);
db.SaveChanges();
db.Dispose();
return Success("操作成功");
}
}
示例3: Delete
public ActionResult Delete(int id)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_i = db.T_InfoManage;
InfoManage iEntity = t_i.Find(id);
iEntity.State = RowState.删除;
db.Update(iEntity);
db.SaveChanges();
return Success("删除成功");
}
}
示例4: PostEdit
public ActionResult PostEdit(IncomeAndPayDetail parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_wsn = db.T_IncomeAndPayDetail;
IncomeAndPayDetail model = t_wsn.Find(parm.ID);
model.Sort = parm.Sort;
model.Title = parm.Title;
model.Content = parm.Content;
model.FlowTo = parm.FlowTo;
model.Type = parm.Type;
db.Update(model);
db.SaveChanges();
return Success("修改成功");
}
}
示例5: PostEdit
public ActionResult PostEdit(WebSitNotice parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_wsn = db.T_WebSitNotice;
WebSitNotice model = t_wsn.Find(parm.ID);
model.Sort = parm.Sort;
model.Source = parm.Source;
model.Title = parm.Title;
model.Content = parm.Content;
db.Update(model);
db.SaveChanges();
return Success("修改成功");
}
}
示例6: PostEdit
public ActionResult PostEdit(LBStartOrBottomAdModel parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_m = db.T_Machine;
var t_a = db.T_LBStartOrBottomAd;
var t_s = db.T_SourceFile;
#region 初始化参数
LBStartOrBottomAd model = t_a.Find(parm.ID);
model.Title = parm.Title;
model.Desc = parm.Desc;
model.LinkUrl = parm.LinkUrl;
model.DeptId = parm.DeptId;
model.Postion = parm.Postion;
///删除原来的,彻底以新增方式进行(修改通过删除在新增实现)
var delSourceFile = from s in t_s where s.Guid == model.Guid select s;
db.T_SourceFile.RemoveRange(delSourceFile);
db.SaveChanges();
#endregion
db.Update<LBStartOrBottomAd>(model);
db.SaveChanges();
foreach (var item in parm.SourceFileList)
{
item.Guid = model.Guid;
item.AddTime = DateTime.Now;
}
db.T_SourceFile.AddRange(parm.SourceFileList);//重新绑定
db.SaveChanges();
return Success("修改成功");
}
}
示例7: PostEdit
public ActionResult PostEdit(InfoManageModel parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_m = db.T_Machine;
var t_a = db.T_InfoManage;
var t_s = db.T_SourceFile;
#region 初始化参数
InfoManage model = t_a.Find(parm.ID);
model.Title = parm.Title;
model.Desc = parm.Desc;
model.DeptId = parm.DeptId;
model.LinkUrl = parm.Desc;
model.Phone = parm.Desc;
model.Contact = parm.Desc;
model.Type = parm.Type;
///删除原来的,彻底以新增方式进行(修改通过删除在新增实现)
var delSourceFile = from s in t_s where s.Guid == model.Guid select s;
db.T_SourceFile.RemoveRange(delSourceFile);
#endregion
db.Update<InfoManage>(model);
db.SaveChanges();
db.T_SourceFile.AddRange(parm.SourceFileList);//重新绑定
db.SaveChanges();
return Success("添加成功");
}
}
示例8: PostEdit
public ActionResult PostEdit(CServiceCenterInfo parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_wsn = db.T_CServiceCenterInfo;
CServiceCenterInfo model = t_wsn.Find(parm.ID);
model.Sort = parm.Sort;
model.Type = parm.Type;
model.Title = parm.Title;
model.Content = parm.Content;
db.Update(model);
db.SaveChanges();
return Success("修改成功");
}
}
示例9: PostEdit
public ActionResult PostEdit(TeamProjectModel parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var am = db.T_TeamProject;
var t_s = db.T_SourceFile;
TeamProject model = am.Find(parm.ID);
model.Name = parm.Name;
model.Desc = parm.Desc;
model.Type = parm.Type;
//model.RecruitStartDate = parm.RecruitStartDate;
//model.RecruitEndDate = parm.RecruitEndDate;
model.ProjectStartDate = parm.ProjectStartDate;
model.ProjectEndDate = parm.ProjectEndDate;
model.ServiceDate = parm.ServiceDate;
model.Address = parm.Address;
model.ServiceObject = parm.ServiceObject;
model.HtmlUrl = parm.HtmlUrl;
model.LinkMan = parm.LinkMan;
model.LinkPhone = parm.LinkPhone;
model.Score = parm.Score;
model.CommentSocre = parm.CommentSocre;
model.GoodScore = parm.GoodScore;
model.ShareScore = parm.ShareScore;
db.Update<TeamProject>(model);
db.SaveChanges();
///删除原来的,彻底以新增方式进行(修改通过删除在新增实现)
var delSourceFile = from s in t_s where s.Guid == model.Guid select s;
db.T_SourceFile.RemoveRange(delSourceFile);
db.SaveChanges();
if (parm.SourceFileList!=null)
{
foreach (var item in parm.SourceFileList)
{
item.Guid = model.Guid;
item.AddTime = DateTime.Now;
}
db.T_SourceFile.AddRange(parm.SourceFileList);//重新绑定
db.SaveChanges();
}
return Success("修改成功");
}
}
示例10: PostEdit
public ActionResult PostEdit(UnitInfoAbout parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_wsn = db.T_UnitInfoAbout;
UnitInfoAbout model= (from w in t_wsn where w.DeptId == AdminUser.DeptId select w).FirstOrDefault();
if (model==null)
{
parm.AddUserId = AdminUser.ID;
parm.DeptId = AdminUser.DeptId;
parm.AddTime = DateTime.Now;
parm.State = RowState.有效;
db.Add(parm);
db.SaveChanges();
return Success("保存成功");
}
//UnitInfoAbout model = t_wsn.Find(parm.ID);
model.Sort = parm.Sort;
model.Address = parm.Address;
model.Title = parm.Title;
model.Content = parm.Content;
model.EMail = parm.EMail;
model.Fax = parm.Fax;
model.Type = parm.Type;
model.UnitName = parm.UnitName;
db.Update(model);
db.SaveChanges();
return Success("保存成功");
}
}
示例11: PostVolBindNFC
public ActionResult PostVolBindNFC(Vol model)
{
if (string.IsNullOrEmpty(model.NFC) || model.NFC.Length != 10)
{
return Error("卡号不对,请重新操作");
}
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_v = db.T_Vol;
Vol vol = t_v.FirstOrDefault(x => x.ID == model.ID);
if (vol == null)
{
return Error("用户不存在,请核实后从新操作");
}
if (t_v.Count(x => x.NFC == model.NFC) > 0)
{
return Error("该NFC卡已经被绑定");
}
vol.NFC = model.NFC;
db.Update(vol);
db.SaveChanges();
}
return Success("绑定成功");
}
示例12: PostEdit
public ActionResult PostEdit(AdminUser model)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
AdminUser user = db.T_AdminUser.First(x => x.ID == model.ID);
if (user == null) return Error("用户不存在");
user.DeptId = model.DeptId;
user.RealName = model.RealName;
user.RoleID = model.RoleID;
db.Update<AdminUser>(user);
db.SaveChanges();
return Success("修改成功");
}
}
示例13: PostEdit
public ActionResult PostEdit(WorkGuide entity)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
WorkGuide work = db.T_WorkGuide.Find(entity.Id);
work.AddTime = DateTime.Now;
work.Des = entity.Des;
work.AddUser = entity.AddUser;
work.ImgUrl = entity.ImgUrl;
work.Title = entity.Title;
work.LinkSocSerUrl = entity.LinkSocSerUrl;
work.UploadHtmlFile = entity.UploadHtmlFile;
db.Update(work);
db.SaveChanges();
}
return Success("添加成功");
}
示例14: PostEdit
public ActionResult PostEdit(MachineModuleShowManageModel parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_m = db.T_Machine;
var t_a = db.T_LoveBank_Ad;
var t_s = db.T_SourceFile;
var am = db.T_MachineModuleShowManage;
#region 初始化参数
MachineModuleShowManage model = am.Find(parm.ID);
model.AddTime = DateTime.Now;
model.AddUserId = AdminUser.ID;
model.State = RowState.有效;
//model.Guid = Guid.NewGuid().ToString();
model.DeptId = parm.DeptId;
model.IconUrl = parm.IconUrl;
model.LinkUrl = parm.LinkUrl;
model.ModuleKey = parm.ModuleKey;
model.Name = parm.Name;
model.Sort = parm.Sort;
model.Type = parm.Type;
model.Icon = parm.Icon;
foreach (var item in parm.SourceFileList)
{
item.Guid = model.Guid;
item.AddTime = DateTime.Now;
}
///删除原来的,彻底以新增方式进行(修改通过删除在新增实现)
var delSourceFile = from s in t_s where s.Guid == model.Guid select s;
db.T_SourceFile.RemoveRange(delSourceFile);
db.SaveChanges();
#endregion
db.Update<MachineModuleShowManage>(model);
db.SaveChanges();
foreach (var item in parm.SourceFileList)
{
item.Guid = model.Guid;
item.AddTime = DateTime.Now;
}
db.T_SourceFile.AddRange(parm.SourceFileList);//重新绑定
db.SaveChanges();
return Success("修改成功");
}
}
示例15: PostEdit
public ActionResult PostEdit(TeamModel parm)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
var t_a = db.T_LoveBank_Ad;
var t_s = db.T_SourceFile;
var am = db.T_Team;
#region 初始化参数
Team model = am.Find(parm.Id);
model.DeptId = parm.DeptId;
model.Address = parm.Address;
model.Desc = parm.Desc;
model.EstabDate = parm.EstabDate;
model.Level = parm.Level;
model.LinkMan = parm.LinkMan;
model.LinkPhone = parm.LinkPhone;
model.Name = parm.Name;
model.WebSite = parm.WebSite;
foreach (var item in parm.SourceFileList)
{
item.Guid = model.Guid;
item.AddTime = DateTime.Now;
}
///删除原来的,彻底以新增方式进行(修改通过删除在新增实现)
var delSourceFile = from s in t_s where s.Guid == model.Guid select s;
db.T_SourceFile.RemoveRange(delSourceFile);
db.SaveChanges();
#endregion
db.Update<Team>(model);
db.SaveChanges();
foreach (var item in parm.SourceFileList)
{
item.Guid = model.Guid;
item.AddTime = DateTime.Now;
}
db.T_SourceFile.AddRange(parm.SourceFileList);//重新绑定
db.SaveChanges();
return Success("修改成功");
}
}