protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew) { var id = dic.GetValue("ID"); var startDate = ConferenceFO.JoinDateTime(Convert.ToDateTime(Convert.ToDateTime(dic.GetValue("MeetingStart")).ToShortDateString()), dic.GetValue("MeetingStartHour"), dic.GetValue("MeetingStartMin")); dic.SetValue("MeetingStart", startDate.ToString()); var endDate = ConferenceFO.JoinDateTime(Convert.ToDateTime(Convert.ToDateTime(dic.GetValue("MeetingEnd")).ToShortDateString()), dic.GetValue("MeetingEndHour"), dic.GetValue("MeetingEndMin")); dic.SetValue("MeetingEnd", endDate.ToString()); string sql = "select count(0) from T_M_ConferenceApply where ID!='{0}' and MeetingRoom='{1}' and MeetingEnd>'{2}' and MeetingStart<'{3}'"; var obj = this.ComprehensiveSQLDB.ExecuteScalar(String.Format(sql, dic.GetValue("ID"), dic.GetValue("MeetingRoom"), dic.GetValue("MeetingStart"), dic.GetValue("MeetingEnd"))); if (Convert.ToInt32(obj) > 0) { throw new Formula.Exceptions.BusinessValidationException("会议预定申请的时间与已预定申请的会议时间有冲突,请确认!"); } }
public JsonResult DoDelete(string id) { var mo = this.ComprehensiveDbContext.Set <T_M_ConferenceApply>().FirstOrDefault(p => p.ID == id); string fid = ""; if (mo != null) { ConferenceFO.SendMsgToJoiner(mo, mo, "delete"); //给参与人发送消息 fid = mo.ID; } this.ComprehensiveDbContext.Set <T_M_ConferenceApply>().Remove(mo); this.ComprehensiveDbContext.SaveChanges(); #region 除相应流程记录信息 SQLHelper shWf = SQLHelper.CreateSqlHelper(ConnEnum.WorkFlow); string strSql = string.Format("Delete From S_WF_InsFlow Where FormInstanceID='{0}'", fid); shWf.ExecuteNonQuery(strSql); #endregion return(Json("")); }
public JsonResult Weeks() { DateTime dtMonday; if (string.IsNullOrEmpty(Request["Monday"])) { dtMonday = DateTime.Today.AddDays(Convert.ToDouble((0 - Convert.ToInt16(DateTime.Now.AddDays(-1).DayOfWeek)))); } else { DateTime dTemp = DateTime.Parse(Request["Monday"]); dtMonday = dTemp; } DateTime dtMondayUpStart = dtMonday.AddHours(ConferenceFO.AmStart); DateTime dtMondayUpEnd = dtMonday.AddHours(ConferenceFO.AmEnd); DateTime dtMondayDownStart = dtMonday.AddHours(ConferenceFO.PmStart); DateTime dtMondayDownEnd = dtMonday.AddHours(ConferenceFO.PmEnd); string MeetingTable = ConferenceFO.GetTables(dtMonday, dtMondayUpStart, dtMondayUpEnd, dtMondayDownStart, dtMondayDownEnd, true); ViewBag.MeetingBody = MeetingTable; return(Json(ViewBag)); }