/// <summary> /// 添加专题例会 /// </summary> /// <param name="specialMeeting"></param> public static void AddSpecialMeeting(Model.Meeting_SpecialMeeting specialMeeting) { Model.SUBHSSEDB db = Funs.DB; Model.Meeting_SpecialMeeting newSpecialMeeting = new Model.Meeting_SpecialMeeting { SpecialMeetingId = specialMeeting.SpecialMeetingId, ProjectId = specialMeeting.ProjectId, UnitId = specialMeeting.UnitId, SpecialMeetingCode = specialMeeting.SpecialMeetingCode, SpecialMeetingName = specialMeeting.SpecialMeetingName, SpecialMeetingDate = specialMeeting.SpecialMeetingDate, CompileMan = specialMeeting.CompileMan, SpecialMeetingContents = specialMeeting.SpecialMeetingContents, CompileDate = specialMeeting.CompileDate, States = specialMeeting.States, AttentPersonNum = specialMeeting.AttentPersonNum, MeetingHours = specialMeeting.MeetingHours, MeetingHostMan = specialMeeting.MeetingHostMan, AttentPerson = specialMeeting.AttentPerson, MeetingPlace = specialMeeting.MeetingPlace, MeetingHostManId = specialMeeting.MeetingHostManId, AttentPersonIds = specialMeeting.AttentPersonIds, }; db.Meeting_SpecialMeeting.InsertOnSubmit(newSpecialMeeting); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectSpecialMeetingMenuId, specialMeeting.ProjectId, null, specialMeeting.SpecialMeetingId, specialMeeting.CompileDate); }
/// <summary> /// 修改专题例会 /// </summary> /// <param name="specialMeeting"></param> public static void UpdateSpecialMeeting(Model.Meeting_SpecialMeeting specialMeeting) { Model.SUBHSSEDB db = Funs.DB; Model.Meeting_SpecialMeeting newSpecialMeeting = db.Meeting_SpecialMeeting.FirstOrDefault(e => e.SpecialMeetingId == specialMeeting.SpecialMeetingId); if (newSpecialMeeting != null) { //newSpecialMeeting.ProjectId = specialMeeting.ProjectId; newSpecialMeeting.UnitId = specialMeeting.UnitId; newSpecialMeeting.SpecialMeetingCode = specialMeeting.SpecialMeetingCode; newSpecialMeeting.SpecialMeetingName = specialMeeting.SpecialMeetingName; newSpecialMeeting.SpecialMeetingDate = specialMeeting.SpecialMeetingDate; newSpecialMeeting.CompileMan = specialMeeting.CompileMan; newSpecialMeeting.SpecialMeetingContents = specialMeeting.SpecialMeetingContents; newSpecialMeeting.CompileDate = specialMeeting.CompileDate; newSpecialMeeting.States = specialMeeting.States; newSpecialMeeting.AttentPersonNum = specialMeeting.AttentPersonNum; newSpecialMeeting.MeetingHours = specialMeeting.MeetingHours; newSpecialMeeting.MeetingHostMan = specialMeeting.MeetingHostMan; newSpecialMeeting.AttentPerson = specialMeeting.AttentPerson; newSpecialMeeting.MeetingPlace = specialMeeting.MeetingPlace; newSpecialMeeting.MeetingHostManId = specialMeeting.MeetingHostManId; newSpecialMeeting.AttentPersonIds = specialMeeting.AttentPersonIds; db.SubmitChanges(); } }
/// <summary> /// 根据主键删除专题例会 /// </summary> /// <param name="specialMeetingId"></param> public static void DeleteSpecialMeetingById(string specialMeetingId) { Model.SUBHSSEDB db = Funs.DB; Model.Meeting_SpecialMeeting spcialMeeting = db.Meeting_SpecialMeeting.FirstOrDefault(e => e.SpecialMeetingId == specialMeetingId); if (spcialMeeting != null) { ///删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(specialMeetingId); BLL.CommonService.DeleteAttachFileById(specialMeetingId);//删除附件 ///删除工程师日志收集记录 var flowOperate = from x in db.Sys_FlowOperate where x.DataId == spcialMeeting.SpecialMeetingId select x; if (flowOperate.Count() > 0) { foreach (var item in flowOperate) { BLL.HSSELogService.CollectHSSELog(spcialMeeting.ProjectId, item.OperaterId, item.OperaterTime, "28", "专题会议", Const.BtnDelete, 1); } ////删除流程表 BLL.CommonService.DeleteFlowOperateByID(spcialMeeting.SpecialMeetingId); } db.Meeting_SpecialMeeting.DeleteOnSubmit(spcialMeeting); db.SubmitChanges(); } }
/// <summary> /// 保存Meeting /// </summary> /// <param name="meeting">会议信息</param> /// <returns></returns> public static void SaveMeeting(Model.MeetingItem meeting) { Model.SUBHSSEDB db = Funs.DB; string menuId = string.Empty; if (meeting.MeetingType == "C") { Model.Meeting_ClassMeeting newClassMeeting = new Model.Meeting_ClassMeeting { ClassMeetingId = meeting.MeetingId, ProjectId = meeting.ProjectId, UnitId = meeting.UnitId == "" ? null : meeting.UnitId, TeamGroupId = meeting.TeamGroupId == "" ? null : meeting.TeamGroupId, ClassMeetingCode = meeting.MeetingCode, ClassMeetingName = meeting.MeetingName, ClassMeetingDate = Funs.GetNewDateTime(meeting.MeetingDate), ClassMeetingContents = meeting.MeetingContents, CompileMan = meeting.CompileManId, MeetingPlace = meeting.MeetingPlace, MeetingHours = meeting.MeetingHours, MeetingHostMan = meeting.MeetingHostMan, AttentPerson = meeting.AttentPerson, AttentPersonNum = meeting.AttentPersonNum, States = Const.State_2, }; if (meeting.States != "1") { newClassMeeting.States = Const.State_0; } var updateMeet = Funs.DB.Meeting_ClassMeeting.FirstOrDefault(x => x.ClassMeetingId == meeting.MeetingId); if (updateMeet == null) { newClassMeeting.CompileDate = DateTime.Now; meeting.MeetingId = newClassMeeting.ClassMeetingId = SQLHelper.GetNewID(); newClassMeeting.ClassMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectClassMeetingMenuId, newClassMeeting.ProjectId, null); ClassMeetingService.AddClassMeeting(newClassMeeting); } else { ClassMeetingService.UpdateClassMeeting(newClassMeeting); } if (meeting.States == "1") { CommonService.btnSaveData(meeting.ProjectId, Const.ProjectClassMeetingMenuId, newClassMeeting.ClassMeetingId, newClassMeeting.CompileMan, true, newClassMeeting.ClassMeetingName, "../Meeting/ClassMeetingView.aspx?ClassMeetingId={0}"); } menuId = Const.ProjectClassMeetingMenuId; } else if (meeting.MeetingType == "W") { Model.Meeting_WeekMeeting newWeekMeeting = new Model.Meeting_WeekMeeting { WeekMeetingId = meeting.MeetingId, ProjectId = meeting.ProjectId, UnitId = meeting.UnitId == "" ? null : meeting.UnitId, WeekMeetingCode = meeting.MeetingCode, WeekMeetingName = meeting.MeetingName, WeekMeetingDate = Funs.GetNewDateTime(meeting.MeetingDate), WeekMeetingContents = meeting.MeetingContents, CompileMan = meeting.CompileManId, CompileDate = Funs.GetNewDateTime(meeting.CompileDate), MeetingPlace = meeting.MeetingPlace, MeetingHours = meeting.MeetingHours, MeetingHostMan = meeting.MeetingHostMan, AttentPerson = meeting.AttentPerson, AttentPersonNum = meeting.AttentPersonNum, States = Const.State_2, AttentPersonIds = meeting.AttentPersonIds, }; if (meeting.States != "1") { newWeekMeeting.States = Const.State_0; } if (!string.IsNullOrEmpty(meeting.MeetingHostManId)) { newWeekMeeting.MeetingHostManId = meeting.MeetingHostManId; } var updateMeet = Funs.DB.Meeting_WeekMeeting.FirstOrDefault(x => x.WeekMeetingId == meeting.MeetingId); if (updateMeet == null) { newWeekMeeting.CompileDate = DateTime.Now; meeting.MeetingId = newWeekMeeting.WeekMeetingId = SQLHelper.GetNewID(); newWeekMeeting.WeekMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectWeekMeetingMenuId, newWeekMeeting.ProjectId, null); WeekMeetingService.AddWeekMeeting(newWeekMeeting); } else { WeekMeetingService.UpdateWeekMeeting(newWeekMeeting); } if (meeting.States == "1") { CommonService.btnSaveData(meeting.ProjectId, Const.ProjectWeekMeetingMenuId, newWeekMeeting.WeekMeetingId, newWeekMeeting.CompileMan, true, newWeekMeeting.WeekMeetingName, "../Meeting/WeekMeetingView.aspx?WeekMeetingId={0}"); } menuId = Const.ProjectWeekMeetingMenuId; } else if (meeting.MeetingType == "M") { Model.Meeting_MonthMeeting newMonthMeeting = new Model.Meeting_MonthMeeting { MonthMeetingId = meeting.MeetingId, ProjectId = meeting.ProjectId, UnitId = meeting.UnitId == "" ? null : meeting.UnitId, MonthMeetingCode = meeting.MeetingCode, MonthMeetingName = meeting.MeetingName, MonthMeetingDate = Funs.GetNewDateTime(meeting.MeetingDate), MonthMeetingContents = meeting.MeetingContents, CompileMan = meeting.CompileManId, CompileDate = Funs.GetNewDateTime(meeting.CompileDate), MeetingPlace = meeting.MeetingPlace, MeetingHours = meeting.MeetingHours, MeetingHostMan = meeting.MeetingHostMan, AttentPerson = meeting.AttentPerson, AttentPersonNum = meeting.AttentPersonNum, States = Const.State_2, AttentPersonIds = meeting.AttentPersonIds, }; if (meeting.States != "1") { newMonthMeeting.States = Const.State_0; } if (!string.IsNullOrEmpty(meeting.MeetingHostManId)) { newMonthMeeting.MeetingHostManId = meeting.MeetingHostManId; } var updateMeet = Funs.DB.Meeting_MonthMeeting.FirstOrDefault(x => x.MonthMeetingId == meeting.MeetingId); if (updateMeet == null) { newMonthMeeting.CompileDate = DateTime.Now; meeting.MeetingId = newMonthMeeting.MonthMeetingId = SQLHelper.GetNewID(); newMonthMeeting.MonthMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectMonthMeetingMenuId, newMonthMeeting.ProjectId, null); MonthMeetingService.AddMonthMeeting(newMonthMeeting); } else { MonthMeetingService.UpdateMonthMeeting(newMonthMeeting); } if (meeting.States == "1") { CommonService.btnSaveData(meeting.ProjectId, Const.ProjectMonthMeetingMenuId, newMonthMeeting.MonthMeetingId, newMonthMeeting.CompileMan, true, newMonthMeeting.MonthMeetingName, "../Meeting/MonthMeetingView.aspx?MonthMeetingId={0}"); } menuId = Const.ProjectMonthMeetingMenuId; } else if (meeting.MeetingType == "S") { Model.Meeting_SpecialMeeting newSpecialMeeting = new Model.Meeting_SpecialMeeting { SpecialMeetingId = meeting.MeetingId, ProjectId = meeting.ProjectId, UnitId = meeting.UnitId == "" ? null : meeting.UnitId, SpecialMeetingCode = meeting.MeetingCode, SpecialMeetingName = meeting.MeetingName, SpecialMeetingDate = Funs.GetNewDateTime(meeting.MeetingDate), SpecialMeetingContents = meeting.MeetingContents, CompileMan = meeting.CompileManId, CompileDate = Funs.GetNewDateTime(meeting.CompileDate), MeetingPlace = meeting.MeetingPlace, MeetingHours = meeting.MeetingHours, MeetingHostMan = meeting.MeetingHostMan, AttentPerson = meeting.AttentPerson, AttentPersonNum = meeting.AttentPersonNum, States = Const.State_2, //MeetingHostManId = meeting.MeetingHostManId, AttentPersonIds = meeting.AttentPersonIds, }; if (meeting.States != "1") { newSpecialMeeting.States = Const.State_0; } if (!string.IsNullOrEmpty(meeting.MeetingHostManId)) { newSpecialMeeting.MeetingHostManId = meeting.MeetingHostManId; } var updateMeet = Funs.DB.Meeting_SpecialMeeting.FirstOrDefault(x => x.SpecialMeetingId == meeting.MeetingId); if (updateMeet == null) { newSpecialMeeting.CompileDate = DateTime.Now; meeting.MeetingId = newSpecialMeeting.SpecialMeetingId = SQLHelper.GetNewID(); newSpecialMeeting.SpecialMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectSpecialMeetingMenuId, newSpecialMeeting.ProjectId, null); SpecialMeetingService.AddSpecialMeeting(newSpecialMeeting); } else { SpecialMeetingService.UpdateSpecialMeeting(newSpecialMeeting); } if (meeting.States == "1") { CommonService.btnSaveData(meeting.ProjectId, Const.ProjectSpecialMeetingMenuId, newSpecialMeeting.SpecialMeetingId, newSpecialMeeting.CompileMan, true, newSpecialMeeting.SpecialMeetingName, "../Meeting/SpecialMeetingView.aspx?SpecialMeetingId={0}"); } menuId = Const.ProjectSpecialMeetingMenuId; } else { Model.Meeting_AttendMeeting newAttendMeeting = new Model.Meeting_AttendMeeting { AttendMeetingId = meeting.MeetingId, ProjectId = meeting.ProjectId, UnitId = meeting.UnitId == "" ? null : meeting.UnitId, AttendMeetingCode = meeting.MeetingCode, AttendMeetingName = meeting.MeetingName, AttendMeetingDate = Funs.GetNewDateTime(meeting.MeetingDate), AttendMeetingContents = meeting.MeetingContents, CompileMan = meeting.CompileManId, CompileDate = Funs.GetNewDateTime(meeting.CompileDate), MeetingPlace = meeting.MeetingPlace, MeetingHours = meeting.MeetingHours, MeetingHostMan = meeting.MeetingHostMan, AttentPerson = meeting.AttentPerson, AttentPersonNum = meeting.AttentPersonNum, States = Const.State_2, //MeetingHostManId = meeting.MeetingHostManId, AttentPersonIds = meeting.AttentPersonIds, }; if (meeting.States != "1") { newAttendMeeting.States = Const.State_0; } if (!string.IsNullOrEmpty(meeting.MeetingHostManId)) { newAttendMeeting.MeetingHostManId = meeting.MeetingHostManId; } var updateMeet = Funs.DB.Meeting_AttendMeeting.FirstOrDefault(x => x.AttendMeetingId == meeting.MeetingId); if (updateMeet == null) { newAttendMeeting.CompileDate = DateTime.Now; meeting.MeetingId = newAttendMeeting.AttendMeetingId = SQLHelper.GetNewID(); newAttendMeeting.AttendMeetingCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectAttendMeetingMenuId, newAttendMeeting.ProjectId, null); AttendMeetingService.AddAttendMeeting(newAttendMeeting); } else { AttendMeetingService.UpdateAttendMeeting(newAttendMeeting); } if (meeting.States == "1") { CommonService.btnSaveData(meeting.ProjectId, Const.ProjectAttendMeetingMenuId, newAttendMeeting.AttendMeetingId, newAttendMeeting.CompileMan, true, newAttendMeeting.AttendMeetingName, "../Meeting/AttendMeetingView.aspx?AttendMeetingId={0}"); } menuId = Const.ProjectAttendMeetingMenuId; } if (!string.IsNullOrEmpty(menuId) && !string.IsNullOrEmpty(meeting.MeetingId)) { SaveMeetUrl(meeting.MeetingId, menuId, meeting.AttachUrl, meeting.AttachUrl1, meeting.AttachUrl2); } }