public string EditAffirmWageByPerson(HCQ2_Model.WebApiModel.ParamModel.WageRegisterModel model) { if (null == model) { return(null); } //1:更新是否发放,签到时间 bool mark = DBSession.IWGJG02DAL.EditAffirmWageByPerson(model); if (!mark) { return(null); } //2:更新成功 获取修改记录的主键RowID WGJG02 uWage = Select(s => s.PersonID == model.personid && s.PersonSalaryID == model.personsalaryid).FirstOrDefault(); string salarysignid = uWage?.RowID; //3:更新成功 判断是否确认完毕 int markCount = DBSession.IWGJG02DAL.GetWagePersonCount(model); if (markCount > 0) { return(salarysignid);//还有未确认的 } //4:没有未确认的更新 WGJG01,更新之前获取第一个农民工发放时间,作为整个发放时间 WGJG02 firstModel = DBSession.IWGJG02DAL.GetFirstCheckInUser(model); DBSession.IWGJG01DAL.Modify(new WGJG01() { WGJG0101 = "01", WGJG0102 = DateTime.Now }, s => s.RowID == firstModel.WGJG01RowID, "WGJG0101", "WGJG0102"); return(salarysignid); }
public bool EditAffirmWageByPerson(WageRegisterModel model) { DateTime de; if (!DateTime.TryParse(model.signtime, out de)) { return(false); } WGJG02 wg1 = Select(s => s.PersonID == model.personid && s.PersonSalaryID == model.personsalaryid && s.WGJG0211 == "1").FirstOrDefault(); if (null != wg1) { return(true); } //1:更新是否发放,签到时间,发放时间 int mark = Modify(new WGJG02() { WGJG0211 = "1", WGJG0201 = de, WGJG0212 = de }, s => s.PersonID == model.personid && s.PersonSalaryID == model.personsalaryid, "WGJG0211", "WGJG0201", "WGJG0212"); return(mark > 0 ? true : false); }