/// <summary> /// 添加安全工程暂停令 /// </summary> /// <param name="pauseNotice"></param> public static void AddPauseNotice(Model.Check_PauseNotice pauseNotice) { Model.SUBHSSEDB db = Funs.DB; Model.Check_PauseNotice newPauseNotice = new Model.Check_PauseNotice { PauseNoticeId = pauseNotice.PauseNoticeId, PauseNoticeCode = pauseNotice.PauseNoticeCode, ProjectId = pauseNotice.ProjectId, UnitId = pauseNotice.UnitId, ProjectPlace = pauseNotice.ProjectPlace, WrongContent = pauseNotice.WrongContent, PauseTime = pauseNotice.PauseTime, PauseContent = pauseNotice.PauseContent, OneContent = pauseNotice.OneContent, SecondContent = pauseNotice.SecondContent, ThirdContent = pauseNotice.ThirdContent, IsConfirm = pauseNotice.IsConfirm, AttachUrl = pauseNotice.AttachUrl, States = pauseNotice.States, CompileManId = pauseNotice.CompileManId, CompileDate = pauseNotice.CompileDate, SignManId = pauseNotice.SignManId, SignDate = pauseNotice.SignDate, ApproveManId = pauseNotice.ApproveManId, ApproveDate = pauseNotice.ApproveDate, //DutyPersonId = pauseNotice.DutyPersonId, //DutyPersonDate = pauseNotice.DutyPersonDate, //ProfessionalEngineerId = pauseNotice.ProfessionalEngineerId, //ProfessionalEngineerTime = pauseNotice.ProfessionalEngineerTime, //ConstructionManagerId = pauseNotice.ConstructionManagerId, //ConstructionManagerTime = pauseNotice.ConstructionManagerTime, //UnitHeadManId = pauseNotice.UnitHeadManId, //UnitHeadManTime = pauseNotice.UnitHeadManTime, //SupervisorManId = pauseNotice.SupervisorManId, //SupervisorManTime = pauseNotice.SupervisorManTime, //OwnerId = pauseNotice.OwnerId, //OwnerTime = pauseNotice.OwnerTime, PauseStates = pauseNotice.PauseStates, }; db.Check_PauseNotice.InsertOnSubmit(newPauseNotice); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectPauseNoticeMenuId, pauseNotice.ProjectId, null, pauseNotice.PauseNoticeId, pauseNotice.PauseTime); }
/// <summary> /// 修改安全工程暂停令 /// </summary> /// <param name="pauseNotice"></param> public static void UpdatePauseNotice(Model.Check_PauseNotice pauseNotice) { Model.SUBHSSEDB db = Funs.DB; Model.Check_PauseNotice newPauseNotice = db.Check_PauseNotice.FirstOrDefault(e => e.PauseNoticeId == pauseNotice.PauseNoticeId); if (newPauseNotice != null) { newPauseNotice.CompileDate = pauseNotice.CompileDate; newPauseNotice.UnitId = pauseNotice.UnitId; newPauseNotice.ProjectPlace = pauseNotice.ProjectPlace; newPauseNotice.WrongContent = pauseNotice.WrongContent; newPauseNotice.PauseTime = pauseNotice.PauseTime; newPauseNotice.PauseContent = pauseNotice.PauseContent; newPauseNotice.OneContent = pauseNotice.OneContent; newPauseNotice.SecondContent = pauseNotice.SecondContent; newPauseNotice.ThirdContent = pauseNotice.ThirdContent; newPauseNotice.IsConfirm = pauseNotice.IsConfirm; newPauseNotice.AttachUrl = pauseNotice.AttachUrl; newPauseNotice.States = pauseNotice.States; newPauseNotice.SignManId = pauseNotice.SignManId; newPauseNotice.SignDate = pauseNotice.SignDate; newPauseNotice.ApproveManId = pauseNotice.ApproveManId; newPauseNotice.ApproveDate = pauseNotice.ApproveDate; //newPauseNotice.DutyPersonId = pauseNotice.DutyPersonId; //newPauseNotice.DutyPersonDate = pauseNotice.DutyPersonDate; //newPauseNotice.ProfessionalEngineerId = pauseNotice.ProfessionalEngineerId; //newPauseNotice.ProfessionalEngineerTime = pauseNotice.ProfessionalEngineerTime; //newPauseNotice.ConstructionManagerId = pauseNotice.ConstructionManagerId; //newPauseNotice.ConstructionManagerTime = pauseNotice.ConstructionManagerTime; //newPauseNotice.UnitHeadManId = pauseNotice.UnitHeadManId; //newPauseNotice.UnitHeadManTime = pauseNotice.UnitHeadManTime; //newPauseNotice.SupervisorManId = pauseNotice.SupervisorManId; //newPauseNotice.SupervisorManTime = pauseNotice.SupervisorManTime; //newPauseNotice.OwnerId = pauseNotice.OwnerId; //newPauseNotice.OwnerTime = pauseNotice.OwnerTime; newPauseNotice.PauseStates = pauseNotice.PauseStates; db.SubmitChanges(); } }
/// <summary> /// 加载页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadData(); PauseNoticeId = Request.Params["PauseNoticeId"]; if (!string.IsNullOrEmpty(PauseNoticeId)) { Model.Check_PauseNotice pauseNotice = BLL.Check_PauseNoticeService.GetPauseNoticeByPauseNoticeId(PauseNoticeId); this.txtPauseNoticeCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.PauseNoticeId); if (!string.IsNullOrEmpty(pauseNotice.UnitId)) { Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(pauseNotice.UnitId); if (unit != null) { this.txtUnit.Text = unit.UnitName; } } //if (!string.IsNullOrEmpty(pauseNotice.SignMan)) //{ // var signName = BLL.UserService.GetUserNameByUserId(pauseNotice.SignMan); // if (signName !=null) // { // this.txtSignMan.Text = signName; // } //} //if (!string.IsNullOrEmpty(pauseNotice.ApproveMan)) //{ // var approve = BLL.UserService.GetUserNameByUserId(pauseNotice.ApproveMan); // if (approve!=null) // { // this.txtApproveMan.Text = approve; // } //} this.txtProjectPlace.Text = pauseNotice.ProjectPlace; // this.txtSignPerson.Text = pauseNotice.SignPerson; if (pauseNotice.CompileDate != null) { this.txtComplieDate.Text = string.Format("{0:yyyy-MM-dd}", pauseNotice.CompileDate); } this.txtWrongContent.Text = pauseNotice.WrongContent; if (pauseNotice.PauseTime != null) { string strPauseTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", pauseNotice.PauseTime); int index1 = strPauseTime.IndexOf("-"); int index2 = strPauseTime.Substring(index1 + 1).IndexOf("-"); int index3 = strPauseTime.Substring(index1 + 1 + index2 + 1).IndexOf(" "); int index4 = strPauseTime.Substring(index1 + 1 + index2 + 1 + index3 + 1).IndexOf(":"); this.txtYear.Text = strPauseTime.Substring(0, index1); this.txtMonth.Text = strPauseTime.Substring(index1 + 1, index2); this.txtDay.Text = strPauseTime.Substring(index1 + 1 + index2 + 1, index3); this.txtHour.Text = strPauseTime.Substring(index1 + 1 + index2 + 1 + index3 + 1, index4); } this.txtPauseContent.Text = pauseNotice.PauseContent; this.txtOneContent.Text = pauseNotice.OneContent; this.txtSecondContent.Text = pauseNotice.SecondContent; this.txtThirdContent.Text = pauseNotice.ThirdContent; //this.txtProjectHeadConfirm.Text = pauseNotice.ProjectHeadConfirm; //if (pauseNotice.ConfirmDate != null) //{ // this.txtConfirmDate.Text = string.Format("{0:yyyy-MM-dd}", pauseNotice.ConfirmDate); //} this.AttachUrl = pauseNotice.AttachUrl; this.divFile1.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../", this.AttachUrl); if (Request.Params["type"] == "confirm") //签字确认 { this.txtProjectHeadConfirm.Enabled = true; this.txtConfirmDate.Enabled = true; this.txtProjectHeadConfirm.Text = this.CurrUser.UserName; this.txtConfirmDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } } ///初始化审核菜单 this.ctlAuditFlow.MenuId = BLL.Const.ProjectPauseNoticeMenuId; this.ctlAuditFlow.DataId = this.PauseNoticeId; } }
/// <summary> /// 加载页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.ProjectId = this.CurrUser.LoginProjectId; this.PauseNoticeId = Request.Params["PauseNoticeId"]; this.InitDropDownList(); if (!string.IsNullOrEmpty(PauseNoticeId)) { Model.Check_PauseNotice pauseNotice = BLL.Check_PauseNoticeService.GetPauseNoticeByPauseNoticeId(PauseNoticeId); if (pauseNotice != null) { this.ProjectId = pauseNotice.ProjectId; if (this.ProjectId != this.CurrUser.LoginProjectId) { this.InitDropDownList(); } this.txtPauseNoticeCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.PauseNoticeId); if (!string.IsNullOrEmpty(pauseNotice.UnitId)) { this.drpUnit.SelectedValue = pauseNotice.UnitId; } this.txtProjectPlace.Text = pauseNotice.ProjectPlace; //this.txtSignPerson.Text = pauseNotice.SignPerson; this.txtComplieDate.Text = string.Format("{0:yyyy-MM-dd}", pauseNotice.CompileDate); this.txtWrongContent.Text = pauseNotice.WrongContent; if (pauseNotice.PauseTime.HasValue) { string strPauseTime = string.Format("{0:yyyy-MM-dd HH:mm:ss}", pauseNotice.PauseTime); int index1 = strPauseTime.IndexOf("-"); int index2 = strPauseTime.Substring(index1 + 1).IndexOf("-"); int index3 = strPauseTime.Substring(index1 + 1 + index2 + 1).IndexOf(" "); int index4 = strPauseTime.Substring(index1 + 1 + index2 + 1 + index3 + 1).IndexOf(":"); this.txtYear.Text = strPauseTime.Substring(0, index1); this.txtMonth.Text = strPauseTime.Substring(index1 + 1, index2); this.txtDay.Text = strPauseTime.Substring(index1 + 1 + index2 + 1, index3); this.txtHour.Text = strPauseTime.Substring(index1 + 1 + index2 + 1 + index3 + 1, index4); } this.txtPauseContent.Text = pauseNotice.PauseContent; this.txtOneContent.Text = pauseNotice.OneContent; this.txtSecondContent.Text = pauseNotice.SecondContent; this.txtThirdContent.Text = pauseNotice.ThirdContent; this.AttachUrl = pauseNotice.AttachUrl; this.divFile1.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../", this.AttachUrl); if (Request.Params["type"] == "confirm") //签字确认 { this.txtProjectHeadConfirm.Enabled = true; this.txtConfirmDate.Enabled = true; this.txtProjectHeadConfirm.Text = this.CurrUser.UserName; this.txtConfirmDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } //if (!string.IsNullOrEmpty(pauseNotice.SignMan)) //{ // this.drpSignMan.SelectedValue = pauseNotice.SignMan; //} //if (!string.IsNullOrEmpty(pauseNotice.ApproveMan)) //{ // this.drpApproveMan.SelectedValue = pauseNotice.ApproveMan; //} //this.txtProjectHeadConfirm.Text = pauseNotice.ProjectHeadConfirm; //if (pauseNotice.ConfirmDate != null) //{ // this.txtConfirmDate.Text = string.Format("{0:yyyy-MM-dd}", pauseNotice.ConfirmDate); //} } } else { this.txtSignPerson.Text = this.CurrUser.UserName; this.txtComplieDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } ///初始化审核菜单 this.ctlAuditFlow.MenuId = BLL.Const.ProjectPauseNoticeMenuId; this.ctlAuditFlow.DataId = this.PauseNoticeId; this.ctlAuditFlow.ProjectId = this.ProjectId; this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; } }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { if (Request.Params["type"] == "confirm") //签字确认 { Model.Check_PauseNotice pauseNotice = BLL.Check_PauseNoticeService.GetPauseNoticeByPauseNoticeId(PauseNoticeId); //pauseNotice.ProjectHeadConfirm = this.txtProjectHeadConfirm.Text.Trim(); //pauseNotice.ConfirmDate = Funs.GetNewDateTime(this.txtConfirmDate.Text.Trim()); pauseNotice.IsConfirm = true; ////单据状态 pauseNotice.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { pauseNotice.States = this.ctlAuditFlow.NextStep; } BLL.Check_PauseNoticeService.UpdatePauseNotice(pauseNotice); BLL.LogService.AddSys_Log(this.CurrUser, pauseNotice.PauseNoticeCode, pauseNotice.PauseNoticeId, BLL.Const.ProjectPauseNoticeMenuId, BLL.Const.BtnModify); } else { Model.Check_PauseNotice pauseNotice = new Model.Check_PauseNotice { PauseNoticeCode = this.txtPauseNoticeCode.Text.Trim(), ProjectId = this.ProjectId, UnitId = this.drpUnit.SelectedValue, //SignPerson = this.txtSignPerson.Text.Trim(), //CompileDate = Funs.GetNewDateTime(this.txtComplieDate.Text.Trim()), ProjectPlace = this.txtProjectPlace.Text.Trim(), WrongContent = this.txtWrongContent.Text.Trim() }; if (!string.IsNullOrEmpty(this.txtYear.Text.Trim())) { string pauseTime = this.txtYear.Text.Trim() + "-" + this.txtMonth.Text.Trim() + "-" + this.txtDay.Text.Trim() + " " + this.txtHour.Text.Trim() + ":00:00"; try { DateTime aa = Convert.ToDateTime(pauseTime); pauseNotice.PauseTime = Convert.ToDateTime(pauseTime); } catch { ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('请填写正确的日期格式!')", true); return; } } else { pauseNotice.PauseTime = null; } pauseNotice.PauseContent = this.txtPauseContent.Text.Trim(); pauseNotice.OneContent = this.txtOneContent.Text.Trim(); pauseNotice.SecondContent = this.txtSecondContent.Text.Trim(); pauseNotice.ThirdContent = this.txtThirdContent.Text.Trim(); //pauseNotice.ProjectHeadConfirm = this.txtProjectHeadConfirm.Text.Trim(); //pauseNotice.ConfirmDate = Funs.GetNewDateTime(this.txtConfirmDate.Text.Trim()); pauseNotice.IsConfirm = false; pauseNotice.AttachUrl = this.AttachUrl; ////单据状态 pauseNotice.States = BLL.Const.State_0; //if (this.drpSignMan.SelectedValue!=BLL.Const._Null) //{ // pauseNotice.SignMan = this.drpSignMan.SelectedValue; //} //if (this.drpApproveMan.SelectedValue!=BLL.Const._Null) //{ // pauseNotice.ApproveMan = this.drpApproveMan.SelectedValue; //} if (type == BLL.Const.BtnSubmit) { pauseNotice.States = this.ctlAuditFlow.NextStep; } pauseNotice.PauseStates = pauseNotice.States; if (pauseNotice.States == Const.State_2) { pauseNotice.PauseStates = Const.State_4; } if (!string.IsNullOrEmpty(this.PauseNoticeId)) { pauseNotice.PauseNoticeId = this.PauseNoticeId; BLL.Check_PauseNoticeService.UpdatePauseNotice(pauseNotice); BLL.LogService.AddSys_Log(this.CurrUser, pauseNotice.PauseNoticeCode, pauseNotice.PauseNoticeId, BLL.Const.ProjectPauseNoticeMenuId, BLL.Const.BtnModify); } else { pauseNotice.PauseNoticeId = SQLHelper.GetNewID(typeof(Model.Check_PauseNotice)); pauseNotice.CompileManId = this.CurrUser.UserId; this.PauseNoticeId = pauseNotice.PauseNoticeId; BLL.Check_PauseNoticeService.AddPauseNotice(pauseNotice); BLL.LogService.AddSys_Log(this.CurrUser, pauseNotice.PauseNoticeCode, pauseNotice.PauseNoticeId, BLL.Const.ProjectPauseNoticeMenuId, BLL.Const.BtnAdd); } } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectCheckWorkMenuId, this.PauseNoticeId, (type == BLL.Const.BtnSubmit ? true : false), this.txtPauseContent.Text.Trim(), "../Check/PauseNoticeView.aspx?PauseNoticeId={0}"); }
/// <summary> /// 保存Check_PauseNotice /// </summary> /// <param name="newItem">工程暂停令</param> /// <returns></returns> public static void SavePauseNotice(Model.PauseNoticeItem newItem) { using (Model.SUBHSSEDB db = new Model.SUBHSSEDB(Funs.ConnString)) { Model.Check_PauseNotice newPauseNotice = new Model.Check_PauseNotice { PauseNoticeId = newItem.PauseNoticeId, PauseNoticeCode = newItem.PauseNoticeCode, ProjectId = newItem.ProjectId, UnitId = newItem.UnitId, ProjectPlace = newItem.ProjectPlace, WrongContent = newItem.WrongContent, PauseTime = Funs.GetNewDateTime(newItem.PauseTime), PauseContent = newItem.PauseContent, OneContent = newItem.OneContent, SecondContent = newItem.SecondContent, ThirdContent = newItem.ThirdContent, States = Const.State_0, PauseStates = newItem.PauseStates, }; var getUpdate = db.Check_PauseNotice.FirstOrDefault(x => x.PauseNoticeId == newItem.PauseNoticeId); if (getUpdate == null) { newPauseNotice.CompileDate = DateTime.Now; newPauseNotice.PauseNoticeId = SQLHelper.GetNewID(); newPauseNotice.PauseNoticeCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectPauseNoticeMenuId, newPauseNotice.ProjectId, newPauseNotice.UnitId); db.Check_PauseNotice.InsertOnSubmit(newPauseNotice); db.SubmitChanges(); CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectPauseNoticeMenuId, newPauseNotice.ProjectId, newPauseNotice.UnitId, newPauseNotice.PauseNoticeId, newPauseNotice.CompileDate); //// 回写巡检记录表 if (!string.IsNullOrEmpty(newItem.HazardRegisterId)) { List <string> listIds = Funs.GetStrListByStr(newItem.HazardRegisterId, ','); foreach (var item in listIds) { var getHazardRegister = Funs.DB.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.HazardRegisterId == item); if (getHazardRegister != null) { getHazardRegister.States = "3"; getHazardRegister.HandleIdea += "已下发工程暂停令:" + newPauseNotice.PauseNoticeCode; getHazardRegister.ResultId = newPauseNotice.PauseNoticeId; getHazardRegister.ResultType = "3"; Funs.SubmitChanges(); } } } //// 回写专项检查明细表 if (!string.IsNullOrEmpty(newItem.CheckSpecialDetailId)) { List <string> listIds = Funs.GetStrListByStr(newItem.CheckSpecialDetailId, ','); foreach (var item in listIds) { var getCheckSpecialDetail = db.Check_CheckSpecialDetail.FirstOrDefault(x => x.CheckSpecialDetailId == item); if (getCheckSpecialDetail != null) { getCheckSpecialDetail.DataType = "3"; getCheckSpecialDetail.DataId = newPauseNotice.PauseNoticeId; db.SubmitChanges(); } } } } else { newPauseNotice.PauseNoticeId = getUpdate.PauseNoticeId; getUpdate.PauseStates = newItem.PauseStates; if (newPauseNotice.PauseStates == "0" || newPauseNotice.PauseStates == "1") ////编制人 修改或提交 { getUpdate.UnitId = newPauseNotice.UnitId; getUpdate.ProjectPlace = newPauseNotice.ProjectPlace; getUpdate.WrongContent = newPauseNotice.WrongContent; getUpdate.PauseTime = newPauseNotice.PauseTime; getUpdate.PauseContent = newPauseNotice.PauseContent; getUpdate.OneContent = newPauseNotice.OneContent; getUpdate.SecondContent = newPauseNotice.SecondContent; getUpdate.ThirdContent = newPauseNotice.ThirdContent; if (newPauseNotice.PauseStates == "1" && !string.IsNullOrEmpty(newItem.SignManId)) { getUpdate.SignManId = newItem.SignManId; } else { newPauseNotice.PauseStates = getUpdate.PauseStates = "0"; } } else if (newPauseNotice.PauseStates == "2") ////【签发】总包安全经理 { /// 不同意 打回 同意抄送专业工程师、施工经理、相关施工分包单位并提交【批准】总包项目经理 if (newItem.IsAgree == false) { newPauseNotice.PauseStates = getUpdate.PauseStates = "0"; } else { if (!string.IsNullOrEmpty(newItem.ProfessionalEngineerId)) { getUpdate.ProfessionalEngineerId = newItem.ProfessionalEngineerId; } if (!string.IsNullOrEmpty(newItem.ConstructionManagerId)) { getUpdate.ConstructionManagerId = newItem.ConstructionManagerId; } if (!string.IsNullOrEmpty(newItem.UnitHeadManId)) { getUpdate.UnitHeadManId = newItem.UnitHeadManId; } if (!string.IsNullOrEmpty(newItem.SupervisorManId)) { getUpdate.SupervisorManId = newItem.SupervisorManId; } if (!string.IsNullOrEmpty(newItem.OwnerId)) { getUpdate.OwnerId = newItem.OwnerId; } if (!string.IsNullOrEmpty(newItem.ApproveManId)) { getUpdate.ApproveManId = newItem.ApproveManId; getUpdate.SignDate = DateTime.Now; } else { newPauseNotice.PauseStates = getUpdate.States = "1"; } } } else if (newPauseNotice.PauseStates == "3") ////【批准】总包项目经理 { /// 不同意 打回 同意下发【回执】施工分包单位 if (newItem.IsAgree == false || string.IsNullOrEmpty(newItem.DutyPersonId)) { newPauseNotice.PauseStates = getUpdate.PauseStates = "1"; } else { getUpdate.DutyPersonId = newItem.DutyPersonId; getUpdate.ApproveDate = DateTime.Now; getUpdate.IsConfirm = true; } } else if (newPauseNotice.PauseStates == "4") ////【批准】总包项目经理 { getUpdate.DutyPersonDate = DateTime.Now; getUpdate.States = Const.State_2; } db.SubmitChanges(); } if (newItem.PauseStates == Const.State_0 || newItem.PauseStates == Const.State_1) { //// 通知单附件 UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.PauseNoticeAttachUrl, 10, null), newItem.PauseNoticeAttachUrl, Const.ProjectPauseNoticeMenuId, newPauseNotice.PauseNoticeId); } if (getUpdate != null && getUpdate.States == Const.State_2) { CommonService.btnSaveData(newPauseNotice.ProjectId, Const.ProjectPauseNoticeMenuId, newPauseNotice.PauseNoticeId, newPauseNotice.CompileManId, true, newPauseNotice.PauseContent, "../Check/PauseNoticeView.aspx?PauseNoticeId={0}"); var getcheck = from x in db.Check_CheckSpecialDetail where x.DataId == getUpdate.PauseNoticeId select x; if (getcheck.Count() > 0) { foreach (var item in getcheck) { item.CompleteStatus = true; item.CompletedDate = DateTime.Now; db.SubmitChanges(); } } } } }