public bool UpShigong(ShigongModel model) { Shigong pt = c.Shigong.FirstOrDefault(n => n.Id == model.Id); pt.Money = model.Money; pt.BiaoduanId = model.BiaoduanId; //pt.Code = model.Code; pt.PayDuixiang = model.PayDuixiang; pt.RegisterPeople = model.RegisterPeople; pt.Remarks = model.Remarks; pt.ShiyongTime = model.ShiyongTime; pt.ShiyongTime2 = model.ShiyongTime2; pt.Yongtu = model.Yongtu; pt.ShenhePeople = model.ShenhePeople; c.SaveChanges(); return(true); }
public bool AddShigong(ShigongModel model) { model.Id = Guid.NewGuid(); int code; try { code = c.Shigong.Max(w => w.Code); } catch (Exception) { code = 1; } model.Code = code + 1; Shigong pt = GetMapperDTO.SetModel <Shigong, ShigongModel>(model); c.Shigong.Add(pt); c.SaveChanges(); return(true); }
public ResultEntity <bool> UpShigong([FromQuery] ShigongModel model) { return(new ResultEntityUtil <bool>().Success(dm.UpShigong(model))); }