public void AddHomecomingSurvey(Business_HomecomingSurvey hs) { using (SqlSugarClient _dbMsSql = SugarDao_MsSql.GetInstance()) { _dbMsSql.Insert(hs); } }
public void UpdateHomecomingSurvey(Business_HomecomingSurvey hs) { using (SqlSugarClient _dbMsSql = SugarDao_MsSql.GetInstance()) { _dbMsSql.Update <Business_HomecomingSurvey>( new { LicensePlate = hs.LicensePlate, WhetherReturnHome = hs.WhetherReturnHome, StartDate = hs.StartDate, EndDate = hs.EndDate, ChangeDate = hs.ChangeDate, ChangeUser = hs.CreatedUser, CheckDrivingG = hs.CheckDrivingG, CheckDrivingB = hs.CheckDrivingB, BackCarNo = hs.BackCarNo, BackAdress = hs.BackAdress, GoCarNo = hs.GoCarNo, OrganizationName = hs.OrganizationName, Fleet = hs.Fleet, CheckDrivingGR = hs.CheckDrivingGR, CheckDrivingBR = hs.CheckDrivingBR }, c => c.Vguid == hs.Vguid); } }
public ActionResult Index(string code) { U_WeChatUserID userInfo = new U_WeChatUserID(); string accessToken = Common.WeChatPush.WeChatTools.GetAccessoken(); string userInfoStr = Common.WeChatPush.WeChatTools.GetUserInfoByCode(accessToken, code); userInfo = Common.JsonHelper.JsonToModel <U_WeChatUserID>(userInfoStr);//用户ID //userInfo.UserId = "18936495119"; Business_Personnel_Information personInfoModel = _logic.GetUserInfo(userInfo.UserId); Personnel_Info Personnel = getPersonnelInfo(personInfoModel); Master_Organization organizationDetail = new Master_Organization(); organizationDetail = _ol.GetOrganizationDetail(personInfoModel.OwnedFleet.ToString()); Business_HomecomingSurvey bhs = _hsl.GetHomecomingSurvey(userInfo.UserId, DateTime.Now.Year.ToString()); if (bhs == null) { bhs = new Business_HomecomingSurvey(); bhs.Name = personInfoModel != null ? personInfoModel.Name : ""; bhs.Year = DateTime.Now.Year.ToString(); bhs.CreatedUser = userInfo.UserId; } bhs.OrganizationName = organizationDetail.OrganizationName; if (Personnel != null) { bhs.Fleet = Personnel.MotorcadeName; bhs.LicensePlate = Personnel.CabLicense; } return(View(bhs)); }
public void AddHomecomingSurvey(Business_HomecomingSurvey hs) { hs.Vguid = Guid.NewGuid(); hs.Year = DateTime.Now.Year.ToString(); hs.CreatedDate = hs.CreatedDate = DateTime.Now; _hss.AddHomecomingSurvey(hs); }
public Business_HomecomingSurvey GetHomecomingSurvey(string user, string year) { Business_HomecomingSurvey hs = null; using (SqlSugarClient _dbMsSql = SugarDao_MsSql.GetInstance()) { hs = _dbMsSql.Queryable <Business_HomecomingSurvey>().Where(c => c.CreatedUser == user & c.Year == year).FirstOrDefault(); } return(hs); }
public ActionResult SaveHomecomingSurvey(Business_HomecomingSurvey bhs) { string result = "0"; try { if (bhs.Vguid == Guid.Empty) { _hsl.AddHomecomingSurvey(bhs); } else { _hsl.UpdateHomecomingSurvey(bhs); } } catch (Exception ex) { Common.LogHelper.LogHelper.WriteLog(ex.ToString()); result = "1"; } return(Content(result)); }
public void UpdateHomecomingSurvey(Business_HomecomingSurvey hs) { hs.ChangeUser = hs.CreatedUser; hs.ChangeDate = DateTime.Now; _hss.UpdateHomecomingSurvey(hs); }