/// <summary> /// 检查会议编号是否重复 /// </summary> protected void CheckNum() { String str = String.Empty; String id = Request.QueryString["id"].Trim(); String num = Request.QueryString["num"].Trim(); if (!String.IsNullOrEmpty(num)) { BMeeting BLL = new BMeeting(); if (String.IsNullOrEmpty(id)) {//新增 if (BLL.ExistsNumber(num, "", this.SiteUserInfo.CompanyId)) { str = "1"; } } else { //编辑 MGovMeeting Model = BLL.GetGovMeetingModel(id); if (null != Model && !String.Equals(num, Model.Number)) { if (BLL.ExistsNumber(num, "", this.SiteUserInfo.CompanyId)) { str = "1"; } } } } Response.Clear(); Response.Write(str); Response.End(); }
/// <summary> /// 保存 /// </summary> protected void PageSave(string doType) { #region 表单取值 //会议编号 string num = Utils.GetFormValue(txtNum.UniqueID); //会议类型 string type = Utils.GetFormValue(selType.UniqueID); //会议主题 string title = Utils.GetFormValue(txtTitle.UniqueID); //参会人员 string people = Utils.GetFormValue(HrSelect1.HrSelectNameClient); //参会人员编号 string peopleid = Utils.GetFormValue(HrSelect1.HrSelectIDClient); //开始时间 string starttime = Utils.GetFormValue(txtStartTime.UniqueID); //结束时间 string endtime = Utils.GetFormValue(txtEndTime.UniqueID); //会议地点 string place = Utils.GetFormValue(txtPlace.UniqueID); //会议纪要 string content = Utils.GetFormValue(txtContent.UniqueID); //主键编号 string hidid = Utils.GetFormValue(hidId.UniqueID); #endregion #region 表单验证 string msg = ""; bool result = false; Response.Clear(); if (string.IsNullOrEmpty(num)) { msg += "-请输入会议编号!<br/>"; } if (string.IsNullOrEmpty(title)) { msg += "-请输入会议主题!<br/>"; } if (string.IsNullOrEmpty(type)) { msg += "-请选择会议类型!<br/>"; } if (string.IsNullOrEmpty(place)) { msg += "-请输入会议地点!<br/>"; } if (!string.IsNullOrEmpty(msg)) { result = false; Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); Response.End(); return; } #endregion #region 实体赋值 MGovMeeting Model = new MGovMeeting(); Model.Category = (Category)Utils.GetInt(type); Model.CompanyID = this.SiteUserInfo.CompanyId; Model.EndTime = Utils.GetDateTime(endtime); Model.IssueTime = DateTime.Now; Model.MeetingStaff = people; Model.Minutes = content; Model.Number = num; Model.OperatorId = this.SiteUserInfo.UserId; Model.StartTime = Utils.GetDateTime(starttime); Model.Theme = title; Model.Venue = place; Model.MGovMeetingStaff = GetMeetingStaff(people, peopleid, hidid); Model.MeetingId = hidid; #endregion #region 提交回应 BMeeting BLL = new BMeeting(); if (doType == "add") { result = BLL.AddGovMeeting(Model); msg = result ? "添加成功!" : "添加失败!"; } if (doType == "update") { result = BLL.UpdateGovMeeting(Model); msg = result ? "修改成功!" : "修改失败!"; } Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); Response.End(); #endregion }