/// <summary> /// 添加周例会 /// </summary> /// <param name="weekMeeting"></param> public static void AddWeekMeeting(Model.Meeting_WeekMeeting weekMeeting) { Model.SUBHSSEDB db = Funs.DB; Model.Meeting_WeekMeeting newWeekMeeting = new Model.Meeting_WeekMeeting { WeekMeetingId = weekMeeting.WeekMeetingId, ProjectId = weekMeeting.ProjectId, UnitId = weekMeeting.UnitId, WeekMeetingCode = weekMeeting.WeekMeetingCode, WeekMeetingName = weekMeeting.WeekMeetingName, WeekMeetingDate = weekMeeting.WeekMeetingDate, CompileMan = weekMeeting.CompileMan, WeekMeetingContents = weekMeeting.WeekMeetingContents, CompileDate = weekMeeting.CompileDate, States = weekMeeting.States, AttentPersonNum = weekMeeting.AttentPersonNum, MeetingHours = weekMeeting.MeetingHours, MeetingHostMan = weekMeeting.MeetingHostMan, AttentPerson = weekMeeting.AttentPerson, MeetingPlace = weekMeeting.MeetingPlace, MeetingHostManId = weekMeeting.MeetingHostManId, AttentPersonIds = weekMeeting.AttentPersonIds, }; db.Meeting_WeekMeeting.InsertOnSubmit(newWeekMeeting); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectWeekMeetingMenuId, weekMeeting.ProjectId, null, weekMeeting.WeekMeetingId, weekMeeting.CompileDate); }
/// <summary> /// 修改周例会 /// </summary> /// <param name="weekMeeting"></param> public static void UpdateWeekMeeting(Model.Meeting_WeekMeeting weekMeeting) { Model.SUBHSSEDB db = Funs.DB; Model.Meeting_WeekMeeting newWeekMeeting = db.Meeting_WeekMeeting.FirstOrDefault(e => e.WeekMeetingId == weekMeeting.WeekMeetingId); if (newWeekMeeting != null) { //newWeekMeeting.ProjectId = weekMeeting.ProjectId; newWeekMeeting.UnitId = weekMeeting.UnitId; newWeekMeeting.WeekMeetingCode = weekMeeting.WeekMeetingCode; newWeekMeeting.WeekMeetingName = weekMeeting.WeekMeetingName; newWeekMeeting.WeekMeetingDate = weekMeeting.WeekMeetingDate; newWeekMeeting.CompileMan = weekMeeting.CompileMan; newWeekMeeting.WeekMeetingContents = weekMeeting.WeekMeetingContents; newWeekMeeting.CompileDate = weekMeeting.CompileDate; newWeekMeeting.States = weekMeeting.States; newWeekMeeting.AttentPersonNum = weekMeeting.AttentPersonNum; newWeekMeeting.MeetingHours = weekMeeting.MeetingHours; newWeekMeeting.MeetingHostMan = weekMeeting.MeetingHostMan; newWeekMeeting.AttentPerson = weekMeeting.AttentPerson; newWeekMeeting.MeetingPlace = weekMeeting.MeetingPlace; newWeekMeeting.MeetingHostManId = weekMeeting.MeetingHostManId; newWeekMeeting.AttentPersonIds = weekMeeting.AttentPersonIds; db.SubmitChanges(); } }
/// <summary> /// 根据主键删除周例会 /// </summary> /// <param name="weekMeetingId"></param> public static void DeleteWeekMeetingById(string weekMeetingId) { Model.SUBHSSEDB db = Funs.DB; Model.Meeting_WeekMeeting weekMeeting = db.Meeting_WeekMeeting.FirstOrDefault(e => e.WeekMeetingId == weekMeetingId); if (weekMeeting != null) { ///删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(weekMeeting.WeekMeetingId); ////删除附件表 BLL.CommonService.DeleteAttachFileById(weekMeeting.WeekMeetingId); ///删除工程师日志收集记录 var flowOperate = from x in db.Sys_FlowOperate where x.DataId == weekMeeting.WeekMeetingId select x; if (flowOperate.Count() > 0) { foreach (var item in flowOperate) { BLL.HSSELogService.CollectHSSELog(weekMeeting.ProjectId, item.OperaterId, item.OperaterTime, "28", "周例会", Const.BtnDelete, 1); } ////删除流程表 BLL.CommonService.DeleteFlowOperateByID(weekMeeting.WeekMeetingId); } db.Meeting_WeekMeeting.DeleteOnSubmit(weekMeeting); 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); } }