protected void InitData(string detailSerial) { Qisda.PMS.Entity.SdpDetail detail = new SdpDetail(); detail.Serial = Convert.ToInt32(detailSerial); detail = myTaskDetailBiz.GetDetailInfoBySerial(detail); if (detail != null) { this.TextBoxActualCost.Text = detail.Actualcost.ToString(); this.TextBoxComplete.Text = (detail.Completedpercent == null) ? string.Empty : detail.Completedpercent.ToString(); //add by Abel.Li 2014-01-06 this.TextBoxTaskStatus.Text = (detail.TaskStatusDesc == null) ? string.Empty : detail.TaskStatusDesc; //this.TextBoxForeTask.Text = (detail.PretaskNo == null) ? string.Empty : detail.PretaskNo.ToString(); this.TextBoxPlanCost.Text = (detail.Plancost == null) ? string.Empty : detail.Plancost.ToString(); this.TextBoxRemark.Text = (detail.Remark == null) ? string.Empty : detail.Remark.Trim(); this.TextBoxTaskName.Text = (detail.TaskName == null) ? string.Empty : detail.TaskName.Trim(); this.TextBoxPlanEnd.Text = pmsCommonBiz.ConvertDateToString(detail.Planendday); this.TextBoxPlanStart.Text = pmsCommonBiz.ConvertDateToString(detail.Planstartday); this.DateTextBoxActualEnd.Text = pmsCommonBiz.ConvertDateToString(detail.Actualendday); this.DateTextBoxActualStart.Text = pmsCommonBiz.ConvertDateToString(detail.Actualstartday); this.TextBoxRole.Text = (detail.Role == null) ? string.Empty : detail.Role.Trim(); this.TextBoxResource.Text = (detail.Resource == null) ? string.Empty : detail.Resource.Trim(); } PmsHead head = new PmsHeadBiz().SelectPmsHeadByPmsId(detail.Pmsid)[0]; if (head != null) { this.TextBoxProjectName.Text = (head.PmsName == null) ? string.Empty : head.PmsName.Trim(); this.TextBoxSysName.Text = (head.System == null) ? string.Empty : head.System.Trim(); } }
private void ChangeTextBoxHost() { PmsHead head = new PmsHeadBiz().SelectPmsHeadByPmsId(PmsID)[0]; if (DropDownListMeetingMinuteType.SelectedValue == PmsCommonEnum.MeetingType.PESMeeting.GetDescription()) { TextBoxHost.Text = head.Pm; } if (DropDownListMeetingMinuteType.SelectedValue == PmsCommonEnum.MeetingType.PISMeeting.GetDescription()) { TextBoxHost.Text = head.Sd; } if (DropDownListMeetingMinuteType.SelectedValue == PmsCommonEnum.MeetingType.STPMeeting.GetDescription()) { TextBoxHost.Text = head.Qa; } if (DropDownListMeetingMinuteType.SelectedValue == PmsCommonEnum.MeetingType.STCMeeting.GetDescription()) { TextBoxHost.Text = head.Qa; } if (DropDownListMeetingMinuteType.SelectedValue == PmsCommonEnum.MeetingType.RLNMeeting.GetDescription()) { TextBoxHost.Text = head.Sd; } if (DropDownListMeetingMinuteType.SelectedValue == PmsCommonEnum.MeetingType.Other.GetDescription()) { TextBoxHost.Text = head.Sd; } }
protected void ItemDataBound(DataListItemEventArgs e) { if (e.Item.ItemType != ListItemType.Header) { HiddenField serial = e.Item.FindControl("HiddenFieldSerial") as HiddenField; HiddenField headSerial = e.Item.FindControl("HiddenFieldHeadSerial") as HiddenField; Label taskName = e.Item.FindControl("LabelTaskName") as Label; Label project = e.Item.FindControl("LabelProject") as Label; //var url = "../Maintain/EditApprovedTask.aspx?PmsID=" + pmsId + "&CrId=" + crId + "&Phase=" + phase + "&Serial=" + serial + "&Radom=" + Math.random(); //var features = "dialogWidth=630px;dialogHeight=540px;center=yes;help=no;status=no;scroll=no";System.Guid.NewGuid().ToString() //var result = window.showModalDialog(url, "", features); PmsHead pmsHead = new PmsHeadBiz().SelectCrIdSystemVersionByPmsId(headSerial.Value.Trim()); string crId = pmsHead.CrId; if (taskName != null) { taskName.Attributes.Add("onmouseover", "TaskNameMouseOver(this)"); taskName.Attributes.Add("onmouseout", "TaskNameMouseOut(this)"); //taskName.Attributes.Add("onclick", "window.open('MyTaskDetail.aspx?Serial=" + serial.Value.Trim() + "')"); //taskName.Attributes.Add("onclick", "showModalDialog('MyTaskDetail.aspx?id=" + // + "&Action=Detail&Serial=" + serial.Value.Trim() + "','','dialogWidth=720px;dialogHeight=450px;center=yes;help=no;status=no;resizable=yes;scroll=no');"); taskName.Attributes.Add("onclick", "showModalDialog('EditApprovedTask.aspx?PmsID=" + headSerial.Value.Trim() + "&CrId=" + crId + "&Serial=" + serial.Value.Trim() + "&Radom=" + System.Guid.NewGuid().ToString() + "','','dialogWidth=630px;dialogHeight=545px;center=yes;help=no;status=no;resizable=yes;scroll=no');document.getElementById('ButtonRefresh').click()"); project.Attributes.Add("onmouseover", "TaskNameMouseOver(this)"); project.Attributes.Add("onmouseout", "TaskNameMouseOut(this)"); //project.Attributes.Add("onclick", "window.open('SDPDetail.aspx?Action=Detail&HeadSerial=" + headSerial.Value.Trim() + "')"); project.Attributes.Add("onclick", "javascript:window.location='ProjectsInformation.aspx?PmsID=" + headSerial.Value.Trim() + "'"); //" href is :" + (href == null) ? string.Empty : href.InnerText + } } }
public void InitGrid(object sender, EventArgs e) { try { PmsHead pmsHead = new PmsHead(); pmsHead.Vid = "PM"; pmsHead.NoStageName = "'CLose','HardClosed'"; //if (UserStatus == "PM") // pmsHead.Pm = textboxPM.Text.ToString().Trim(); //else // pmsHead.UserName = textboxUserName.Text.ToString().Trim(); pmsHead.UserName = textboxUserName.Text.Trim(); pmsHead.CrId = textboxCrNo.Text.Trim(); PmsHeadBiz pmsHeadBiz = new PmsHeadBiz(); IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHeadOther(pmsHead); gridViewMain.DataSource = pmsHeadList; gridViewMain.DataBind(); gridViewMain.Columns[13].Visible = false; } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('InitGrid failure!');", true); } }
private void InitPage() { pmsId = Request.Params["PmsID"]; string viewData = Request.Params["ViewData"]; // Abel Test if (pmsId == null) { Msgbox("Data Bind Error!"); Stop = false; return; } //pmsId = "PMS201303010003"; IList <PmsHead> pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(pmsId); if (pmsHead == null || pmsHead.Count == 0) { Msgbox("Data Bind Error!"); Stop = false; return; } //获取pmsHead dudate等信息 ObjPmsHead = pmsHead[0]; Stop = true; //BindDropDownListPhase(); }
private void InitPage() { PmsId = Request.Params["PmsID"]; string resource = Request.Params["resource"]; Serials = Request.Params["serials"]; //var url = "../Maintain/ModifyResource.aspx?PmsID=" + pmsId + "&serials=" // + serials + "&resource=" + resource + "&Radom=" + Math.random(); IList <PmsHead> pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(PmsId); PmsHead objPmsHead = new PmsHead(); if (pmsHead != null && pmsHead.Count > 0) { objPmsHead = pmsHead[0]; } else { Msgbox("Data Bind Error!"); return; } Hashtable rTable = new Hashtable(); rTable.Add("PM", objPmsHead.Pm); rTable.Add("SD", objPmsHead.Sd); rTable.Add("SE", objPmsHead.Se); rTable.Add("QA", objPmsHead.Qa); this.TextBoxOldResource.Text = resource.Trim(); BindDropDownListNewResource(rTable); }
private void InitTextBoxAttendee() { PmsHead head = new PmsHeadBiz().SelectPmsHeadByPmsId(PmsID)[0]; string attendee = string.Empty; if (!string.IsNullOrEmpty(head.Pm)) { attendee = attendee + head.Pm + ";"; } if (!string.IsNullOrEmpty(head.Sd) && !attendee.Contains(head.Sd)) { attendee = attendee + head.Sd + ";"; } if (!string.IsNullOrEmpty(head.Qa) && !attendee.Contains(head.Qa)) { attendee = attendee + head.Qa + ";"; } if (!string.IsNullOrEmpty(head.Se) && !attendee.Contains(head.Se)) { attendee = attendee + head.Se + ";"; } if (attendee.Contains(";")) { attendee = attendee.TrimEnd(';'); } TextBoxAttendee.Text = attendee; }
private void InitPage() { Serial = int.Parse(Request.Params["Serial"]); string PmsId = Request.Params["PmsID"]; string crId = Request.Params["CrId"]; //Abel test用 //Serial = 697; //PmsId = "PMS201303010003"; SdpDetail sdpDetailParms = new SdpDetail(); sdpDetailParms.Serial = Serial; IList <PmsHead> pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(PmsId); ; PmsHead ph = pmsHead[0]; TextBoxCrNo.Text = crId; TextBoxCrName.Text = ph.PmsName; IList <SdpDetail> sdpDetailList = new SdpDetailBiz().SelectSdpDetail(sdpDetailParms); if (sdpDetailList == null && sdpDetailList.Count == 0) { Msgbox("Data is null"); return; } SdpDetailResult = (sdpDetailList == null || sdpDetailList.Count == 0) ? new SdpDetail() : sdpDetailList[0]; ApprovedOutData(); ControlEnabled(SdpDetailResult.TaskStatus); }
public string GetResourceList(string pmsid) { PmsHead ObjPmsHead = new PmsHead(); IList <PmsHead> pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(pmsid); if (pmsHead != null && pmsHead.Count > 0) { ObjPmsHead = pmsHead[0]; Hashtable rTable = new Hashtable(); rTable.Add("PM", ObjPmsHead.Pm); rTable.Add("SD", ObjPmsHead.Sd); rTable.Add("SE", ObjPmsHead.Se); rTable.Add("QA", ObjPmsHead.Qa); string resourceList = ""; foreach (string str in rTable.Values) { string[] sArray = str.Split(';'); foreach (string name in sArray) { if (!resourceList.Contains(name)) { resourceList += name + ","; } } } return(resourceList); } else { return(""); } }
private void InitPage() { try { LoginName = WSC.GlobalDefinition.Cookie_LoginUser.Replace(" ", "."); ButtonSaveTop.Attributes.Add("onclick", "return CheckBeforeSave()"); ButtonSaveUnder.Attributes.Add("onclick", "return CheckBeforeSave()"); ButtonCancelTop.OnClientClick = "window.close()"; ButtonCancelUnder.OnClientClick = "window.close()"; //取得project,module PmsHead pmsHead = new PmsHead(); pmsHead.Vid = "PM"; pmsHead.UserName = LoginName; pmsHead.CrId = CrID; string minID = string.Empty; PmsMinHeadBiz pmsMinHeadBiz = new PmsMinHeadBiz(); pmsMinHeadBiz.GetMinId(out minID); MinID = minID; // 保存到ViewState,发mail时使用 PmsHeadBiz pmsHeadBiz = new PmsHeadBiz(); IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHeadOther(pmsHead); string project = pmsHeadList[0].BugFreeProject; string module = pmsHeadList[0].BugFreeModule; string IssueCreateUrl = ConfigurationManager.AppSettings["IssueCreateUrl"]; string paraMeter = "&PmsID=" + Server.UrlEncode(GetBase64Encode(PmsID)) + "&UserName="******".", " "))) + "&CrID=" + Server.UrlEncode(GetBase64Encode(CrID)) + "&BugFreeProject=" + Server.UrlEncode(GetBase64Encode(project)) + "&BugFreeModule=" + Server.UrlEncode(GetBase64Encode(module)) + "&MNID=" + Server.UrlEncode(GetBase64Encode(MinID)); ButtonCreateIssue.OnClientClick = "javascript:window.open('" + IssueCreateUrl + paraMeter + "');"; BindDropDown(); InitTextBox(); GridViewBind(null); GridViewIssueBind(); } catch (Exception ex) { Msgbox("Init Page Failed !"); } }
private void InitPage() { PmsId = Request.Params["PmsID"]; CrID = Request.Params["CrId"]; Phase = Request.Params["Phase"]; int serial = 0; int.TryParse(Request.Params["Serial"], out serial); if (serial == 0) { return; } else { Serial = serial; } IList <PmsHead> pmsHeadList = new PmsHeadBiz().SelectPmsHead(PmsId, ""); PmsHead ph; if (pmsHeadList != null && pmsHeadList.Count > 0) { ph = pmsHeadList[0]; } else { Msgbox("Data is null"); return; } //IList<PmsHead> pmsHead = new PmsHeadBiz().SelectPmsHead(PmsId, ""); ; //PmsHead ph = pmsHead[0]; TextBoxCrNo.Text = CrID; TextBoxCrName.Text = ph.PmsName; Hashtable rTable = new Hashtable(); rTable.Add("PM", ph.Pm); rTable.Add("SD", ph.Sd); rTable.Add("SE", ph.Se); rTable.Add("QA", ph.Qa); ViewState["Roles"] = rTable; foreach (string key in rTable.Keys) { this.DropDownListRoleInfo.Items.Add(new ListItem(key, rTable[key].ToString())); } PmsCommonEnum.PlanPhase planPhase = (PmsCommonEnum.PlanPhase)System.Enum.Parse(typeof(PmsCommonEnum.PlanPhase), Phase); TextBoxPhase.Text = planPhase.GetDescription(); BindDropDownList(); EditOutData(); }
private void InitPage() { PmsId = Request.Params["PmsID"]; CrID = Request.Params["CrId"]; if (string.IsNullOrEmpty(Request.Params["Phase"])) { PhaseNull = true; } Phase = Request.Params["Phase"]; string Action = Request.Params["Action"]; IList <PmsHead> pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(PmsId); if (pmsHead != null && pmsHead.Count > 0) { ObjPmsHead = pmsHead[0]; } else { Msgbox("Data Bind Error!"); return; } TextBoxCrNo.Text = CrID; TextBoxCrName.Text = ObjPmsHead.PmsName; Hashtable rTable = new Hashtable(); rTable.Add("PM", ObjPmsHead.Pm); rTable.Add("SD", ObjPmsHead.Sd); rTable.Add("SE", ObjPmsHead.Se); rTable.Add("QA", ObjPmsHead.Qa); ViewState["Roles"] = rTable; foreach (string key in rTable.Keys) { this.DropDownListRoleInfo.Items.Add(new ListItem(key, rTable[key].ToString())); } if (!PhaseNull) { PmsCommonEnum.PlanPhase planPhase = (PmsCommonEnum.PlanPhase)System.Enum.Parse(typeof(PmsCommonEnum.PlanPhase), Phase); TextBoxPhase.Text = planPhase.GetDescription(); TextBoxPhase.Visible = true; LabelPhaseMark.Visible = false; DropDownListPhases.Visible = false; } BindDropDownList(); if (Action != "Add") { EditOutData(); } }
protected void gridViewMeetingMinute_RowCommand(object sender, GridViewCommandEventArgs e) { int currentRowIndex = int.Parse(e.CommandArgument.ToString()); string minID = gridViewMeetingMinute.Rows[currentRowIndex].Attributes["Mnid"]; string pmsID = gridViewMeetingMinute.Rows[currentRowIndex].Attributes["PmsId"]; string message = string.Empty; PmsMinHead pmsMinHead = new PmsMinHeadBiz().SelectPmsMinHeadByPmsIdMinId(pmsID, minID).FirstOrDefault(); switch (e.CommandName) { case "Delete": # region Delete if (!LoginName.Equals(pmsMinHead.Creator)) { Msgbox("this item only can be deleted by creator!"); return; } int returnSerial = new PmsMinHeadBiz().DeletePmsMinHeadAndPmsMinConclution(pmsID, minID, out message); if (returnSerial == 0) { Msgbox(message); return; } BindGrid(); break; # endregion case "EditPage": # region Edit PmsHead pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(pmsID).FirstOrDefault(); if (!LoginName.Equals(pmsMinHead.Creator) && !LoginName.Equals(pmsHead.Sd)) { Msgbox("this item only can be edit by creator or sd!"); return; } break; # endregion default: break; } }
protected void textboxRelatedCrNo_TextChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textboxRelatedCrNo.Text.Trim())) { PmsHead pmsHead = new PmsHeadBiz().SelectSystemInforByCrId(textboxRelatedCrNo.Text.Trim()); if (pmsHead == null) { Msgbox("The Related CR No does not exist,Please input the right CR No!"); textboxRelatedCrNo.Text = ""; textboxRelatedCrNo.Focus(); return; } SetDropDownListItem(dropdownlistSite, pmsHead.Site); SetDropDownListItem(dropdownlistDomain, pmsHead.Domain); SetDropDownListItem(dropdownlistImpactSite, pmsHead.ImpactSite); textboxSystem.Text = pmsHead.System; PmsSystemVersion pmsSystemVersion = GetVersionNewAndOld(dropdownlistDomain.SelectedValue, textboxSystem.Text.Trim(), dropdownlistSite.SelectedValue, dateTextBoxPlanStartDate.Text, dateTextBoxDueDate.Text); if (pmsSystemVersion != null) { textboxOldVersion.Text = (pmsSystemVersion.OldVersion ?? string.Empty).Trim(); //不可以给NewVersion赋值,不然会覆盖用户填写的值。 textboxNewVersion.Text = (pmsSystemVersion.NewVersion ?? string.Empty).Trim(); HiddenFieldOldVersion.Value = (pmsSystemVersion.OldVersion ?? string.Empty).Trim(); //使用BugFreeModule栏位临时存储是否需要将NeedSTC,NeedSTP是否需要 if (pmsSystemVersion.BugFreeModule == "Y") { RadioButtonNeedSTPYes.Checked = true; RadioButtonNeedSTCYes.Checked = true; RadioButtonNeedSTPNo.Checked = false; RadioButtonNeedSTCNo.Checked = false; } } else { textboxOldVersion.Text = ""; //不可以给NewVersion赋值,不然会覆盖用户填写的值。 // textboxNewVersion.Text = ""; HiddenFieldOldVersion.Value = ""; } } }
protected void ButtonSave_Click(object sender, EventArgs e) { SdpDetailBiz sdpDetailBiz = new SdpDetailBiz(); SdpDetail sdpDetailPage = SdpDetailResult; DateTime dateTime = PmsSysBiz.GetDBDateTime(); //Check 日期是否跨周、大于三天、超过dudate PmsHead objHead = new PmsHeadBiz().SelectPmsHeadByPmsId(PmsId)[0]; if (!ValidatePlanDate((TextBox)DateTextBoxPlanStartDate, (TextBox)DateTextBoxPlanEndDate, int.Parse(Phase), objHead.DueDate, objHead.Type)) { return; } //如果任务类型为 Review Meeting 不检查任务名和资源等重复 if (DropDownListTaskType.SelectedItem.Text.Trim() != "Review Meeting") { // 当TaskName或Resource发生改变时Check TaskName和Resource不能重复 if (SdpDetailResult.TaskName != TextBoxTaskName.Text.Trim() || SdpDetailResult.Resource != DropDownListResource.Text.Trim()) { SdpDetail sdpDetail = new SdpDetail(); sdpDetail.Pmsid = PmsId; sdpDetail.TaskName = TextBoxTaskName.Text.Trim(); sdpDetail.Phase = Phase.ToString(); sdpDetail.Role = DropDownListRole.Text.Trim(); sdpDetail.Resource = DropDownListResource.Text.Trim(); IList <SdpDetail> sdpDetailList = sdpDetailBiz.SelectSdpDetail(sdpDetail); if (sdpDetailList != null && sdpDetailList.Count > 0) { if (sdpDetailList[0].TaskName == sdpDetail.TaskName && sdpDetailList[0].Resource == sdpDetail.Resource) { Msgbox("The same taskname and resource has been exist!"); return; } } } } sdpDetailPage.TaskName = TextBoxTaskName.Text.Trim(); sdpDetailPage.TaskType = int.Parse(DropDownListTaskType.Text.Trim()); sdpDetailPage.FunctionType = int.Parse(DropDownListFunctionType.Text.Trim()); sdpDetailPage.ProgramLanguage = int.Parse(DropDownListProgramLanguage.Text.Trim()); sdpDetailPage.TaskComplexity = int.Parse(DropDownListTaskComplexity.Text.Trim()); //sdpDetailPage.Actualcost = double.Parse(TextBoxRefCost.Text.Trim()); sdpDetailPage.Refcost = double.Parse(HiddenFieldRefCost.Value.Trim()); sdpDetailPage.Plancost = double.Parse(TextBoxPlanCost.Text.Trim()); sdpDetailPage.Planstartday = DateTime.Parse(DateTextBoxPlanStartDate.Text.Trim()); sdpDetailPage.Planendday = DateTime.Parse(DateTextBoxPlanEndDate.Text.Trim()); sdpDetailPage.Resource = DropDownListResource.Text.Trim(); sdpDetailPage.Auditor = new BaseDataUserBiz().SelectLeaderByLoginName(LoginName); HiddenFieldAuditor.Value = sdpDetailPage.Auditor; //sdpDetailPage.Role = DropDownListRole.Text.Trim(); sdpDetailPage.Role = HiddenFieldRole.Value.Trim(); sdpDetailPage.ScheduleRemark = TextBoxPlanRemark.Text.Trim(); sdpDetailPage.Maintaindate = dateTime; sdpDetailPage.Maintainuser = LoginName; //获得对应AuditStatus //SdpDetail sParms = new SdpDetail(); //sParms.Serial = Serial; //SdpDetail sResult = new SdpDetailBiz().SelectSdpDetail(sParms)[0]; if (SdpDetailResult.AuditStatus == 0) { sdpDetailPage.AuditStatus = 1; sdpDetailPage.TaskStatus = 1; sdpDetailPage.Iseditable = "Y"; sdpDetailPage.Deleteflag = "N"; sdpDetailPage.Createdate = dateTime; sdpDetailPage.Createuser = LoginName; } else { int auditStatus = GetAuditStatus(SdpDetailResult, sdpDetailPage); if (auditStatus == -1) { return; } else { sdpDetailPage.AuditStatus = auditStatus; } } if (sdpDetailBiz.UpdateSdpDetail(sdpDetailPage)) { SdpDetailPage = sdpDetailPage; HiddenFieldAuditStatus.Value = sdpDetailPage.AuditStatus.ToString(); HiddenFieldAuditStatusDesc.Value = System.Enum.Parse(typeof(PmsCommonEnum.AuditStatus), sdpDetailPage.AuditStatus.ToString()).GetDescription(); HiddenFieldTaskStatus.Value = sdpDetailPage.TaskStatus.ToString(); HiddenFieldTaskStatusDesc.Value = System.Enum.Parse(typeof(PmsCommonEnum.TaskStatus), sdpDetailPage.TaskStatus.ToString()).GetDescription(); ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "SaveSuccess();", true); } else { Msgbox("Update this item failed!"); return; } // 更新head表的PlanStartDate new PmsHeadBiz().UpdatePmsHeadPlanStartDate(PmsId); }
protected void gridViewMeetingMinute_RowDataBound(object sender, GridViewRowEventArgs e) { try { GridView gridView = sender as GridView; if (gridView == null) { return; } if (e.Row.RowType != DataControlRowType.DataRow) { return; } PmsMinHead dataItem = (PmsMinHead)e.Row.DataItem; if (dataItem == null) { return; } e.Row.Attributes["PmsId"] = dataItem.PmsId.ToString(); e.Row.Attributes["Mnid"] = dataItem.Mnid.ToString(); Label labelTypeName = e.Row.FindControl("labelTypeName") as Label; labelTypeName.Text = GetMeetingMinuteTypeDesc(dataItem.MeetingType); PmsMinHead pmsMinHead = new PmsMinHeadBiz().SelectPmsMinHeadByPmsIdMinId(dataItem.PmsId.ToString(), dataItem.Mnid.ToString()).FirstOrDefault(); PmsHead pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(dataItem.PmsId.ToString()).FirstOrDefault(); PmsItarmMapping pmsItarmMapping = new PmsItarmMappingBiz().SelectPmsItarmMappingOther(dataItem.PmsId.ToString()).FirstOrDefault(); string crId = pmsItarmMapping.CrId; if (LoginName.Equals(pmsMinHead.Creator) || LoginName.Equals(pmsHead.Sd)) { ImageButton imageButtonEdit = e.Row.FindControl("imageButtonEdit") as ImageButton; if (imageButtonEdit != null) { imageButtonEdit.Attributes.Add("onclick", string.Format("return OpenEditMeetingMinute('{0}','{1}','{2}');", dataItem.PmsId.ToString(), crId, dataItem.Mnid.ToString())); } } ImageButton imageButtonDetail = e.Row.FindControl("imageButtonDetail") as ImageButton; if (imageButtonDetail != null) { imageButtonDetail.Attributes.Add("onclick", string.Format("return OpenViewMeetingMinute('{0}','{1}','{2}');", dataItem.PmsId.ToString(), crId, dataItem.Mnid.ToString())); } IssueFreeBiz issueFreeBiz = new IssueFreeBiz(); IList <BfIssueinfo> listBfIssueinfo = issueFreeBiz.GetIssueinfo(crId, dataItem.Mnid); string returnIssueID = string.Empty; int i = 1; string issueViewUrl = ConfigurationManager.AppSettings["IssueViewUrl"]; if (listBfIssueinfo.Count > 0) { returnIssueID += "<table cellSpacing='0' cellPadding='0' border='0'>"; foreach (BfIssueinfo bfIssueinfo in listBfIssueinfo) { string issueID = bfIssueinfo.Issueid.ToString(); string url = issueViewUrl + issueID; returnIssueID = returnIssueID + "<tr><td>" + "<a id='FileList" + i + "' style='color:Blue;cursor:hand;white-space:nowrap;text-overflow:ellipsis;overflow:hidden' " + "HREF = '" + url + "' Target='_blank'>" + issueID + "</a></td></tr>"; i++; } returnIssueID += "</table>"; HtmlContainerControl divOpenIssue = e.Row.FindControl("divOpenIssue") as HtmlContainerControl; divOpenIssue.InnerHtml = returnIssueID; } } catch (Exception) { Msgbox("GridView Bind Fail!"); } }
protected void buttonSave_Click(object sender, EventArgs e) { try { #region Check Validity if (dropdownlistDocType != null && dropdownlistDocType.Items.Count > 0) { if (dropdownlistDocType.SelectedItem.Text.ToString().Trim() == "") { Msgbox("Please select Document Type!"); dropdownlistDocType.Focus(); return; } } if (textboxUrl.Text.Trim() == "") { Msgbox("Please input URL!"); textboxUrl.Focus(); return; } if (textboxUrl.Text.Length > 500) { Msgbox("The length of URL is larger than 500!"); textboxUrl.Focus(); return; } if (!ValidateUrl(textboxUrl.Text.Trim())) { Msgbox("The Url is not legal!"); textboxUrl.Focus(); return; } #endregion #region For Insert PmsDocuments PmsDocuments pmsDocuments = new PmsDocuments(); pmsDocuments.PmsId = PmsID; pmsDocuments.DocTypeId = int.Parse(dropdownlistDocType.SelectedValue); pmsDocuments.FileName = FileName; if (textboxUrl.Text.Trim().LastIndexOf("\\") != -1) { pmsDocuments.FileName = Server.UrlDecode(textboxUrl.Text.Trim().Substring(textboxUrl.Text.Trim().LastIndexOf("\\") + 1)); } else { pmsDocuments.FileName = Server.UrlDecode(textboxUrl.Text.Trim().Substring(textboxUrl.Text.Trim().LastIndexOf("/") + 1)); } int documentTypeId = int.Parse(dropdownlistDocType.SelectedValue); PmsHead pmsHead = new PmsHeadBiz().SelectCrIdSystemVersionByPmsId(PmsID); string errorInfo; if (!CheckFileName(pmsDocuments.FileName, documentTypeId, pmsHead.CrId, pmsHead.System, pmsHead.NewVersion, out errorInfo)) { Msgbox(errorInfo); return; } pmsDocuments.Path = textboxUrl.Text.Trim(); DateTime dtCurDate = PmsSysBiz.GetDBDateTime(); pmsDocuments.Creator = LoginName; pmsDocuments.CreateDate = dtCurDate; //默认给"0" pmsDocuments.Size = "0"; PmsDocumentsBiz pmsDocBiz = new PmsDocumentsBiz(); IList <PmsDocuments> pmsDocList = pmsDocBiz.SelectPmsDocuments(pmsDocuments); int saveResult = 0; if (pmsDocList != null && pmsDocList.Count > 0) { Msgbox("File Exists!"); return; } saveResult = pmsDocBiz.InsertPmsDocuments(pmsDocuments); if (saveResult <= 0) { Msgbox("Save failure!"); return; } #endregion Session["DocPage_Refresh"] = "Y"; Msgbox("Save Successfully!"); PageRegisterStartupScript("window.close();"); } catch { Msgbox("Save failure!"); } }
protected void Page_Load(object sender, EventArgs e) { string PmsId = Request.QueryString["PmsID"]; string CrID = Request.QueryString["CrId"]; string Phase = Request.QueryString["Phase"]; int Serial = 0; int.TryParse(Request.QueryString["Serial"], out Serial); if (PmsId == null || CrID == null || Phase == null || Serial == 0) { return; } IList <PmsHead> pmsHeadList = new PmsHeadBiz().SelectPmsHead(PmsId, ""); PmsHead pmsHead; if (pmsHeadList != null && pmsHeadList.Count > 0) { pmsHead = pmsHeadList[0]; } else { return; } SdpDetail sdpDetailParms = new SdpDetail(); sdpDetailParms.Serial = Serial; sdpDetailParms.Pmsid = PmsId; IList <SdpDetail> sdpDetailList = new SdpDetailBiz().SelectSdpDetail(sdpDetailParms); SdpDetail sdpDetailResult = (sdpDetailList == null || sdpDetailList.Count == 0) ? new SdpDetail() : sdpDetailList[0]; PmsCommonEnum.PlanPhase planPhase = (PmsCommonEnum.PlanPhase)System.Enum.Parse(typeof(PmsCommonEnum.PlanPhase), Phase); string phaseDescription = planPhase.GetDescription(); string formatPlanstartday = new PmsCommonBiz().FormatDateTime(sdpDetailResult.Planstartday.ToString("yyyy-MM-dd").Trim()); string formatPlanendday = new PmsCommonBiz().FormatDateTime(sdpDetailResult.Planendday.ToString("yyyy-MM-dd").Trim()); string resultHtml = "<table class='ViewTaskTable'>" + "<tr><td><span class='ViewTaskSpan'>CR No</span></td><td colspan='3'><input type='text' class='ViewTaskOnlyTextBox' value='" + pmsHead.CrId + "' /></td></tr>" + "<tr><td><span class='ViewTaskSpan'>CR Name</span></td><td colspan='3'><input type='text' class='ViewTaskOnlyTextBox' value='" + pmsHead.PmsName + "'style='width: 325px;'/></td></tr>" + "<tr><td><span class='ViewTaskSpan'>任务阶段</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + phaseDescription + "'/></td>" + "<td><span class='ViewTaskSpan'>审核状态</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.AuditStatusDesc + "' /></td></tr>" + "<tr><td><span class='ViewTaskSpan'>任务状态</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.TaskStatusDesc + "' /></td><td> </td><td> </td></tr>" + "<tr><td><span class='ViewTaskSpan'>任务名称</span></td>" + "<td colspan='3'><div style=' border-bottom: 1px solid #CCCCCC;width: 325px; white-space: normal;text-overflow: ellipsis; text-align: Left'>" + sdpDetailResult.TaskName + "</div></td></tr>" + "<tr><td><span class='ViewTaskSpan'>作业方式</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.OperationTypeDesc + "'/></td>" + "<td><span class='ViewTaskSpan'>任务类型</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.TaskTypeDesc + "'/></td></tr>" + "<tr><td><span class='ViewTaskSpan'>功能分类</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.FunctionTypeDesc + "'/></td>" + "<td><span class='ViewTaskSpan'>语言</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.ProgramLanguageDesc + "'/></td></tr>" + "<tr><td><span class='ViewTaskSpan'>复杂度</span></td>" + "<td colspan='3'><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.TaskComplexityDesc + "'/></td></tr>" + "<tr><td><span class='ViewTaskSpan'>参考工时</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.Actualcost + "' /></td>" + "<td><span class='ViewTaskSpan'>计划工时</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.Plancost + "' /></td></tr>" + "<tr><td><span class='ViewTaskSpan'>计划开始</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + formatPlanstartday + "' /></td>" + "<td><span class='ViewTaskSpan'>计划结束</span></td><td><input type='text' class='ViewTaskOnlyTextBox' value='" + formatPlanendday + "' /> </td></tr>" + "<tr><td><span class='ViewTaskSpan'>指派给</span></td>" + "<td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.Resource + "'/></td><td><span class='ViewTaskSpan'>资源角色</span></td>" + "<td><input type='text' class='ViewTaskOnlyTextBox' value='" + sdpDetailResult.Role + "'/></td></tr>" + "<tr><td><span class='ViewTaskSpan'>说明</span></td>" + "<td colspan='3'><div style='border-bottom: 1px solid #CCCCCC; width: 325px; white-space: normal;text-overflow: ellipsis; text-align: Left'>" + sdpDetailResult.ScheduleRemark + "</div></td></tr>"; Response.Write(resultHtml); }
//private void BindDropDownListSiteAndImpactSite() //{ // try // { // PmsSys pmsSys = new PmsSys(); // pmsSys.Vid = "PM"; // pmsSys.Type = "Site"; // PmsSysBiz pmsSysBiz = new PmsSysBiz(); // IList<PmsSys> pmsSysList = pmsSysBiz.SelectData1ByType(pmsSys); // dropdownlistSite.DataSource = pmsSysList; // dropdownlistSite.DataTextField = "Data1"; // dropdownlistSite.DataValueField = "Data1"; // dropdownlistSite.DataBind(); // dropdownlistSite.Items.Insert(0, ""); // dropdownlistImpactSite.DataSource = pmsSysList; // dropdownlistImpactSite.DataTextField = "Data1"; // dropdownlistImpactSite.DataValueField = "Data1"; // dropdownlistImpactSite.DataBind(); // QWeb.SelectItem(dropdownlistImpactSite, "QCS"); // //dropdownlistSite.Items.Insert(0, new ListItem()); // //dropdownlistSite.Items[0].Text = ""; // //dropdownlistSite.Items[0].Value = ""; // //dropdownlistImpactSite.Items.Insert(0, new ListItem()); // //dropdownlistImpactSite.Items[0].Text = ""; // //dropdownlistImpactSite.Items[0].Value = ""; // } // catch // { // ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Bind ImpactSite failure');", true); // } //} #endregion #endregion protected void buttonSave_Click(object sender, EventArgs e) { try { //#region Define Variable ////string strSavePath = ""; ////int iTypeID = 0; //#endregion //检查控件中的值 if (!CheckControlValue()) { return; } //获取新的Pmsid,CrId以及他们的创建时间 DateTime dtCurDate; string strPmsID = string.Empty; string strCrId = string.Empty; m_PmsCRCreatBiz.GetNewPmsIdTempCrId(out dtCurDate, out strPmsID, out strCrId); #region Get StageID PmsFlowTemplateBiz pmsFlowTemplateBiz = new PmsFlowTemplateBiz(); IList <PmsFlowTemplate> pmsFlowTemplateList = pmsFlowTemplateBiz.SelectPmsFlowTemplateByTypeId(dropdownlistType.SelectedValue.Trim()); int stageId = pmsFlowTemplateList[0].Stageid; #endregion #region For Insert PmsHead PmsHead pmsHeadInsert = new PmsHead(); pmsHeadInsert.Vid = "PM"; pmsHeadInsert.PmsId = strPmsID; pmsHeadInsert.PmsName = textboxPmsName.Text.Trim().Replace("'", ""); pmsHeadInsert.Type = dropdownlistType.SelectedItem.Text.Trim(); pmsHeadInsert.Description = textboxDescription.Text.Trim().Replace("'", ""); pmsHeadInsert.System = textboxSystem.Text.Trim().Replace("'", ""); pmsHeadInsert.Domain = dropdownlistDomain.SelectedItem.Text.Trim(); pmsHeadInsert.Priority = dropdownlistPriority.SelectedItem.Text.Trim(); pmsHeadInsert.Site = dropdownlistSite.SelectedValue; pmsHeadInsert.ImpactSite = dropdownlistImpactSite.SelectedItem.Text.Trim(); pmsHeadInsert.NeedSTP = RadioButtonNeedSTPYes.Checked ? "Y" : "N"; pmsHeadInsert.NeedSTC = RadioButtonNeedSTCYes.Checked ? "Y" : "N"; //要插VB2Net add by ITO.Abel.Li 2014-01-06 pmsHeadInsert.Category = RadioButtonVB2NetYes.Checked ? "Y" : "N"; pmsHeadInsert.NewVersion = textboxNewVersion.Text.Trim().Replace("'", ""); // pmsHeadInsert.OldVersion = textboxOldVersion.Text.Trim().Replace("'", ""); pmsHeadInsert.OldVersion = HiddenFieldOldVersion.Value.Trim().Replace("'", ""); pmsHeadInsert.DueDate = DateTime.Parse(dateTextBoxDueDate.Text.Trim()); pmsHeadInsert.PlanStartDate = DateTime.Parse(dateTextBoxPlanStartDate.Text.Trim()); //pmsHeadInsert.ReleaseDate = 0; //pmsHeadInsert.CloseDate = 0; pmsHeadInsert.Stage = stageId; pmsHeadInsert.Pm = textboxPM.Text.Trim().Replace("'", ""); pmsHeadInsert.Sd = ""; pmsHeadInsert.Se = ""; pmsHeadInsert.Qa = ""; pmsHeadInsert.AbnormalStage = 0; pmsHeadInsert.Rerver1 = ""; pmsHeadInsert.Rerver2 = ""; pmsHeadInsert.Rerver3 = ""; pmsHeadInsert.Rerver4 = ""; pmsHeadInsert.Rerver5 = ""; pmsHeadInsert.CreateDate = dtCurDate; pmsHeadInsert.Creator = LoginName; //pmsHeadInsert.MaintainDate = dtCurDate; pmsHeadInsert.MaintainUser = ""; pmsHeadInsert.OwnerDept = m_PmsCRCreatBiz.GetOwnerDept(LoginName) ?? string.Empty; pmsHeadInsert.RelatedCrNo = textboxRelatedCrNo.Text.Trim(); #endregion #region For Insert PMS_ITARM_Mapping PmsItarmMapping pmsItarmMapping = new PmsItarmMapping(); pmsItarmMapping.PmsId = strPmsID; pmsItarmMapping.CrId = strCrId; pmsItarmMapping.Creator = LoginName; pmsItarmMapping.CreateDate = dtCurDate; #endregion #region File(注释不用) #region Get Document Type //PmsDocumentType pmsDocType = new PmsDocumentType(); //pmsDocType.Vid = "PM"; //pmsDocType.TypeName = "PES"; //PmsDocumentTypeBiz pmsDocTypeBiz = new PmsDocumentTypeBiz(); //IList<PmsDocumentType> pmsDocTypeList = pmsDocTypeBiz.SelectPmsDocumentType(pmsDocType); //if (pmsDocTypeList != null && pmsDocTypeList.Count > 0) //{ // iTypeID = pmsDocTypeList[0].TypeId; //} #endregion #region Get UploadFilePath //PmsSys pmsSys = new PmsSys(); //pmsSys.Vid = "PM"; //pmsSys.Type = "UploadFilePath"; //PmsSysBiz pmsSysBiz = new PmsSysBiz(); //IList<PmsSys> pmsSysList = pmsSysBiz.SelectData1ByType(pmsSys); //if (pmsSysList != null && pmsSysList.Count > 0) //{ // strSavePath = pmsSysList[0].Data1.ToString().Trim(); //} //else //{ // ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Please maintain UploadFilePath!');", true); // return; //} #endregion #region For Insert PmsDocuments //PmsDocuments pmsDocuments = new PmsDocuments(); //pmsDocuments.PmsId = strPmsID; //pmsDocuments.DocTypeId = iTypeID; //pmsDocuments.FileName = pesUpload.PostedFile.FileName.Substring(pesUpload.PostedFile.FileName.LastIndexOf("\\") + 1); //string strTmp = strSavePath + "\\" + strPmsID + "\\" + pmsDocuments.FileName; //if (strTmp.Length > 150) //{ // ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('The length of SavePath is larger than 150!');", true); // pesUpload.Focus(); // return; //} //pmsDocuments.Path = strSavePath + "\\" + strPmsID + "\\" + pmsDocuments.FileName; //pmsDocuments.Size = pesUpload.PostedFile.ContentLength.ToString().Trim(); //pmsDocuments.Creator = LoginName; //pmsDocuments.CreateDate = dtCurDate; //#endregion //#region Upload PES File //if (pmsDocuments.FileName != "") //{ // strSavePath = strSavePath + "\\" + strPmsID; // if (!QFile.CheckFolderExist(strSavePath)) // { // QFile.CreateDirectory(strSavePath); // } // strSavePath = strSavePath + "\\" + pmsDocuments.FileName; // pesUpload.PostedFile.SaveAs(strSavePath); //} #endregion #endregion #region For Insert SdpDetail SdpDetail sdpDetail = new SdpDetail(); sdpDetail.Pmsid = strPmsID; sdpDetail.Type = dropdownlistType.SelectedValue.Trim(); #endregion #region For Insert PmsFlow //pmsFlowTemplateList = pmsFlowTemplateBiz.SelectPmsFlowTemplateByTypeId(dropdownlistType.SelectedValue.Trim()); PmsFlow pmsFlow = new PmsFlow(); pmsFlow.FlowId = pmsFlowTemplateList[0].FlowId; pmsFlow.PmsId = strPmsID; pmsFlow.Creator = LoginName; pmsFlow.CreateDate = dtCurDate; #endregion #region For Insert PMSChangeHistory PmsChangeHistory pmsChangeHistory = new PmsChangeHistory(); pmsChangeHistory.PmsId = strPmsID; pmsChangeHistory.ChangeContent = ""; pmsChangeHistory.Action = "CREATE"; pmsChangeHistory.CreateDate = dtCurDate; pmsChangeHistory.Creator = LoginName; #endregion #region For Insert Itarm_Cr_List ItarmCrList itarmCrList = new ItarmCrList(); itarmCrList.CrId = strCrId; itarmCrList.CrName = textboxPmsName.Text.Trim().Replace("'", ""); itarmCrList.Site = dropdownlistSite.SelectedValue; itarmCrList.Creator = LoginName; itarmCrList.CreateDate = dtCurDate; itarmCrList.Pm = textboxPM.Text.Trim().Replace("'", ""); itarmCrList.System = textboxSystem.Text.Trim().Replace("'", ""); #endregion #region Insert PmsHeadBiz pmsInsert = new PmsHeadBiz(); string errorInfo; int insertResult = pmsInsert.InsertPmsHeadAndDoc(pmsHeadInsert, sdpDetail, pmsChangeHistory, pmsItarmMapping, pmsFlow, itarmCrList, null, out errorInfo); if (insertResult == 0) { Msgbox("Save Fail!"); } else { #region 更新系统版本表 bool upVerResult = m_PmsCRCreatBiz.UpdateSysVersion(dropdownlistDomain.SelectedValue, textboxSystem.Text.Trim(), dropdownlistSite.SelectedValue, textboxNewVersion.Text.Trim()); if (!upVerResult) { Msgbox("Updated system version number fail!"); } #endregion // Session["InquiryPage_Refresh"] = "Y"; //发送创建成功的Mail LoginName.Replace(".", " "); pmsHeadInsert.UserName = LoginName; new MailBiz().SendCreateMail(pmsHeadInsert); Msgbox("Create Successful!"); PageRegisterStartupScript("window.close();"); } #endregion } catch (Exception exception) { Msgbox("Save Fail!"); } }
//Abel 注释掉 on 2014-01-22 //private bool DevelopTestCheck(string type, out string message) //{ // message = ""; // try // { // IList<string> phaseList = m_ProjectProgressBiz.SelectSdpDetailTemplatePhase(type); // foreach (string phase in phaseList) // { // int intPhase = int.Parse(phase.Trim()); // if (intPhase == (int)PmsCommonEnum.EnumSdpPhase.Design) // { // string designCompletedPercent = PageProjectsInformation.DesignCompletedPercent; // if (designCompletedPercent != "100.0%") // { // message = "Please finish the design phase of SDP!"; // return false; // } // } // if (intPhase == (int)PmsCommonEnum.EnumSdpPhase.Development) // { // string developmentCompletedPercent = PageProjectsInformation.DevelopmentCompletedPercent; // if (developmentCompletedPercent != "100.0%") // { // message = "Please finish the development phase of SDP!"; // return false; // } // } // if (intPhase == (int)PmsCommonEnum.EnumSdpPhase.Test && type != PmsCommonEnum.ProjectTypeFlowId.Service.GetDescription()) // { // string testCompletedPercent = PageProjectsInformation.TestCompletedPercent; // if (testCompletedPercent != "100.0%") // { // message = "Please finish the test phase of SDP!"; // return false; // } // } // } // return true; // } // catch (Exception) // { // return false; // } //} #endregion protected void ImageButtonStage_Click(object sender, ImageClickEventArgs e) { #region 获取信息pmsHead //从数据库中获取最新数据 PmsHead pmsHead = null; PmsHeadBiz pmsHeadBiz = new PmsHeadBiz(); IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHead(PmsID, null); if (pmsHeadList != null && pmsHeadList.Count > 0) { pmsHead = pmsHeadList[0]; } else { Msgbox("无相关资料!"); return; } #endregion #region 检查是否符合推进条件 string message; if (!CheckPromote(pmsHead, out message)) { Msgbox(message); return; } #endregion #region 更新数据库(推进成功) //获取当前的type类型对应的pmsFlow int intPending = (int)PmsCommonEnum.ProjectStage.Pending; int intHardClosed = (int)PmsCommonEnum.ProjectStage.HardClosed; int intCancelled = (int)PmsCommonEnum.ProjectStage.Cancelled; int intReactive = (int)PmsCommonEnum.ProjectStage.Reactive; IList <int> stages = ProjectTypeStageList.Select(t => t) .Where(p => (p.Typeid == ProjectType && p.Stageid != intPending && p.Stageid != intHardClosed && p.Stageid != intCancelled && p.Stageid != intReactive)) .OrderBy(m => m.Order) .Select(t => t.Stageid) .ToList(); int oldStage = Stage; int newStage = 0; for (int i = 0; i < stages.Count; i++) { if (oldStage == stages[i]) { newStage = stages[i + 1]; } } string strAction = Enum.Parse(typeof(PmsCommonEnum.ProjectStage), oldStage.ToString()).GetDescription(); #region SDP confirm //Pm or Sd must confirm the SDP Change only Sd confirm //if (IsPm(pmsHead.Pm, CurrentUser.LoginName) || IsSd(pmsHead.Sd, CurrentUser.LoginName)) if (IsSd(pmsHead.Sd, CurrentUser.LoginName)) { switch (pmsHead.Type) { case "CR": case "Study": case "Project": if (strAction == PmsCommonEnum.ProjectStage.PIS_STP.GetDescription()) { if (pmsHead.SDPConfirmDate.ToString("yyyy") == "0000" || pmsHead.SDPConfirmDate.ToString("yyyy") == "0001" || pmsHead.SDPConfirmDate.ToString("yyyy") == "1900") { Msgbox("Please Click SDP Confirm First"); return; } } break; case "Small CR": if (strAction == PmsCommonEnum.ProjectStage.Develop_Test.GetDescription()) { if (pmsHead.SDPConfirmDate.ToString("yyyy") == "0000" || pmsHead.SDPConfirmDate.ToString("yyyy") == "0001" || pmsHead.SDPConfirmDate.ToString("yyyy") == "1900") { Msgbox("Please Click SDP Confirm First"); return; } } break; default: break; } } #endregion bool blResult = new BasicInformationDetailBiz().UpdateStages(PmsID, LoginName, oldStage, newStage, strAction); //从waitingclose到Close,需要更新Head页签closeday事件 if (oldStage == (int)PmsCommonEnum.ProjectStage.WaitingClosed) { DateTime closeDate = PmsSysBiz.GetDBDateTime(); pmsHeadBiz.UpdatePmsHeadCloseDate(PmsID, LoginName, closeDate); //修改BasicInformationDetail页面和Service页面上的close时间; PageProjectsInformation.CloseDate = m_PmsCommonBiz.FormatDateTime(closeDate.ToString("yyyy-MM-dd").Trim()); PageProjectsInformation.CloseDateForService = m_PmsCommonBiz.FormatDateTime(closeDate.ToString("yyyy-MM-dd").Trim()); } if (!blResult) { Msgbox("更新stage数据失败!"); } #endregion #region 重绘控件 //如果推进到release 则点亮BasicInformationDetail.ascx if (newStage == (int)PmsCommonEnum.ProjectStage.Release) { PageProjectsInformation.SetReleaseButtonEnable(); } Stage = newStage; InitPmsFlow(Stage, ProjectType); #endregion #region 发送相关的mail LoginName.Replace(".", " "); pmsHead.UserName = LoginName; new MailBiz().SendPromoteMail(pmsHead, newStage); #endregion }
public void BindGrid(object sender, EventArgs e) { #region Bind DataTable to GridView try { if (sender == null) { DataTable dt = new DataTable(); gridViewMain.DataSource = dt; gridViewMain.DataBind(); } else { #region Get Values PmsHead pmsHead = new PmsHead(); pmsHead.Vid = "PM"; pmsHead.StageName = PmsCommonEnum.ProjectStage.AssignMember.GetDescription(); #endregion PmsHeadBiz pmsHeadBiz = new PmsHeadBiz(); IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHeadOther(pmsHead); #region Sort Modify By Albee List <PmsHead> SdpHeadList = (List <PmsHead>)pmsHeadList; #region Descending if (GridViewSortDirection == SortDirection.Descending) { switch (ViewState["SortExpression"].ToString()) { case "CrId": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.CrId.CompareTo(x.CrId)); }); break; case "Type": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Type.CompareTo(x.Type)); }); break; case "PmsName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.PmsName.CompareTo(x.PmsName)); }); break; case "Progress": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Progress.CompareTo(x.Progress)); }); break; case "DueDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.DueDate.CompareTo(x.DueDate)); }); break; case "ReleaseDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.ReleaseDate.CompareTo(x.ReleaseDate)); }); break; case "CreateDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.CreateDate.CompareTo(x.CreateDate)); }); break; case "StageName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.StageName.CompareTo(x.StageName)); }); break; case "Priority": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Priority.CompareTo(x.Priority)); }); break; case "Sd": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Sd.CompareTo(x.Sd)); }); break; case "System": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.System.CompareTo(x.System)); }); break; default: break; } } #endregion #region Ascending else { switch (ViewState["SortExpression"].ToString()) { case "CrId": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.CrId.CompareTo(y.CrId)); }); break; case "Type": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Type.CompareTo(y.Type)); }); break; case "PmsName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.PmsName.CompareTo(y.PmsName)); }); break; case "Progress": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Progress.CompareTo(y.Progress)); }); break; case "DueDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.DueDate.CompareTo(y.DueDate)); }); break; case "ReleaseDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.ReleaseDate.CompareTo(y.ReleaseDate)); }); break; case "CreateDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.CreateDate.CompareTo(y.CreateDate)); }); break; case "StageName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.StageName.CompareTo(y.StageName)); }); break; case "Priority": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Priority.CompareTo(y.Priority)); }); break; case "Sd": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Sd.CompareTo(y.Sd)); }); break; case "System": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.System.CompareTo(y.System)); }); break; default: break; } } #endregion gridViewMain.DataSource = SdpHeadList; #endregion #region Get gridViewTaskAudit Values //借用Creator传LoginName pmsHead.Creator = LoginName; IList <PmsHead> pmsHeadListAudit = pmsHeadBiz.SelectPmsHeadForAuditor(pmsHead); List <PmsHead> SdpHeadListAudit = (List <PmsHead>)pmsHeadListAudit; gridViewTaskAudit.DataSource = SdpHeadListAudit; #endregion IList <PmsHead> pmsHeadListAgent = pmsHeadBiz.SelectPmsHeadForAgent(pmsHead); List <PmsHead> SdpHeadListAgent = (List <PmsHead>)pmsHeadListAgent; gridViewTaskAgent.DataSource = SdpHeadListAgent; #region Get gridViewTaskAgent Values #endregion gridViewMain.DataBind(); gridViewTaskAudit.DataBind(); gridViewTaskAgent.DataBind(); } } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('BindGrid failure!');", true); } #endregion }
public void BindGrid(object sender, EventArgs e) { #region Bind DataTable to GridView try { if (sender == null) { DataTable dt = new DataTable(); gridViewMain.DataSource = dt; gridViewMain.DataBind(); gridViewMain.Columns[13].Visible = false; } else { #region Get Values PmsHead pmsHead = new PmsHead(); pmsHead.Vid = "PM"; if (this.dropdownlistDomain.SelectedItem != null && this.dropdownlistDomain.SelectedItem.Text.ToUpper() != "") { pmsHead.Domain = this.dropdownlistDomain.SelectedItem.Text.ToString(); } else { pmsHead.Domain = ""; } pmsHead.System = textboxSystem.Text.Trim(); pmsHead.CrId = textboxCrNo.Text.Trim(); pmsHead.PmsName = textboxPmsName.Text.Trim(); if (this.dropdownlistType.SelectedItem != null && this.dropdownlistType.SelectedItem.Text.ToUpper() != "") { pmsHead.Type = this.dropdownlistType.SelectedItem.Value.ToString(); } else { pmsHead.Type = ""; } if (this.dropdownlistSite.SelectedItem != null && this.dropdownlistSite.SelectedItem.Text.ToUpper() != "") { pmsHead.Site = this.dropdownlistSite.SelectedItem.Value.ToString(); } else { pmsHead.Site = ""; } if (this.dropdownlistStage.SelectedItem != null && this.dropdownlistStage.SelectedItem.Text.ToUpper() != "") { pmsHead.StageName = this.dropdownlistStage.SelectedItem.Text.ToString().Trim(); } else { pmsHead.StageName = ""; } // pmsHead.Pm = textboxPM.Text.ToString().Trim(); // pmsHead.UserName = textboxUserName.Text.ToString().Trim(); if (this.dropdownlistPriority.SelectedItem != null && this.dropdownlistPriority.SelectedItem.Text.ToUpper() != "") { pmsHead.Priority = this.dropdownlistPriority.SelectedItem.Text.ToString().Trim(); } else { pmsHead.Priority = ""; } pmsHead.UserName = textboxUserName.Text.ToString().Trim(); if (this.dateTextBoxCreateDateFrom.Text.ToString().Trim() != "") { pmsHead.CreateDateFrom = DateTime.Parse(dateTextBoxCreateDateFrom.Text.ToString().Trim()); } if (this.dateTextBoxCreateDateTo.Text.ToString().Trim() != "") { pmsHead.CreateDateTo = DateTime.Parse(dateTextBoxCreateDateTo.Text.ToString().Trim()); } if (this.dateTextBoxReleaseDateFrom.Text.ToString().Trim() != "") { pmsHead.ReleaseDateFrom = DateTime.Parse(dateTextBoxReleaseDateFrom.Text.ToString().Trim()); } if (this.dateTextBoxReleaseDateTo.Text.ToString().Trim() != "") { pmsHead.ReleaseDateTo = DateTime.Parse(dateTextBoxReleaseDateTo.Text.ToString().Trim()); } if (this.dateTextBoxDueDateFrom.Text.ToString().Trim() != "") { pmsHead.DueDateFrom = DateTime.Parse(dateTextBoxDueDateFrom.Text.ToString().Trim()); } if (this.dateTextBoxDueDateTo.Text.ToString().Trim() != "") { pmsHead.DueDateTo = DateTime.Parse(dateTextBoxDueDateTo.Text.ToString().Trim()); } #endregion PmsHeadBiz pmsHeadBiz = new PmsHeadBiz(); IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHeadOther(pmsHead); #region Sort Modify By Albee List <PmsHead> SdpHeadList = (List <PmsHead>)pmsHeadList; if (SdpHeadList != null && SdpHeadList.Count > 0) { #region Descending if (GridViewSortDirection == SortDirection.Descending) { switch (ViewState["SortExpression"].ToString()) { case "CrId": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.CrId.CompareTo(x.CrId)); }); break; case "Type": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Type.CompareTo(x.Type)); }); break; case "PmsName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.PmsName.CompareTo(x.PmsName)); }); break; case "Progress": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Progress.CompareTo(x.Progress)); }); break; case "DueDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.DueDate.CompareTo(x.DueDate)); }); break; case "ReleaseDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.ReleaseDate.CompareTo(x.ReleaseDate)); }); break; case "CreateDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.CreateDate.CompareTo(x.CreateDate)); }); break; case "StageName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.StageName.CompareTo(x.StageName)); }); break; case "Pm": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Pm.CompareTo(x.Pm)); }); break; case "Sd": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.Sd.CompareTo(x.Sd)); }); break; case "System": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(y.System.CompareTo(x.System)); }); break; default: break; } } #endregion #region Ascending else { switch (ViewState["SortExpression"].ToString()) { case "CrId": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.CrId.CompareTo(y.CrId)); }); break; case "Type": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Type.CompareTo(y.Type)); }); break; case "PmsName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.PmsName.CompareTo(y.PmsName)); }); break; case "Progress": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Progress.CompareTo(y.Progress)); }); break; case "DueDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.DueDate.CompareTo(y.DueDate)); }); break; case "ReleaseDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.ReleaseDate.CompareTo(y.ReleaseDate)); }); break; case "CreateDate": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.CreateDate.CompareTo(y.CreateDate)); }); break; case "StageName": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.StageName.CompareTo(y.StageName)); }); break; case "Pm": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Pm.CompareTo(y.Pm)); }); break; case "Sd": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.Sd.CompareTo(y.Sd)); }); break; case "System": SdpHeadList.Sort(delegate(PmsHead x, PmsHead y) { return(x.System.CompareTo(y.System)); }); break; default: break; } } #endregion } //gridViewDetailList.DataSource = pmsSdpHeadList; //mark by Albee 2010-08-03 gridViewMain.DataSource = SdpHeadList; #endregion //gridViewMain.DataSource = pmsHeadList; gridViewMain.DataBind(); gridViewMain.Columns[13].Visible = false; } } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('BindGrid failure!');", true); } #endregion }
protected void ButtonSave_Click(object sender, EventArgs e) { try { //get creator,createDate,pmsID,crID string creator = WSC.GlobalDefinition.Cookie_LoginUser.Replace(" ", "."); DateTime createDate; string pmsID = string.Empty; string crId = string.Empty; m_PmsCRCreatBiz.GetNewPmsIdTempCrId(out createDate, out pmsID, out crId); //get pmsHead,pmsflow,sdpDetail,getPmsChangeHistory,getPmsItarmMapping,getPmsFlow,itarmCrList PmsHead pmsHead = getPmsHead(creator, createDate, pmsID); SdpDetail sdpDetail = getSdpDetail(pmsID); PmsChangeHistory pmsChangeHistory = getPmsChangeHistory(creator, createDate, pmsID); PmsItarmMapping pmsItarmMapping = getPmsItarmMapping(creator, createDate, pmsID, crId); PmsFlow pmsFlow = getPmsFlow(creator, createDate, pmsID); ItarmCrList itarmCrList = getItarmCrList(creator, createDate, crId); IList <PmsDocuments> pmsDocuments = getPmsDocuments(creator, createDate, pmsID, crId); if (pmsHead == null) { Msgbox("Save failed"); return; } //Insert PmsHeadBiz pmsInsert = new PmsHeadBiz(); string errorInfo; int insertResult = pmsInsert.InsertPmsHeadAndDoc(pmsHead, sdpDetail, pmsChangeHistory, pmsItarmMapping, pmsFlow, itarmCrList, pmsDocuments, out errorInfo); if (insertResult == 0) { Msgbox(errorInfo); } else { //将TempFile文件夹里的文件移动到UploadFile下以CRNO命名的文件夹里并删除Temp里的文件。 MoveUploadFileDeleteTempFile(crId); LoginName.Replace(".", " "); pmsHead.UserName = LoginName; new MailBiz().SendCreateMail(pmsHead); // 更新Stage 自动把这个Cr推进到AssginMember int oldStage = (int)PmsCommonEnum.ProjectStage.PES; int newStage = (int)PmsCommonEnum.ProjectStage.AssignMember; string strAction = Enum.Parse(typeof(PmsCommonEnum.ProjectStage), oldStage.ToString()).GetDescription(); bool blResult = new BasicInformationDetailBiz().UpdateStages(pmsID, LoginName, oldStage, newStage, strAction); if (!blResult) { Msgbox("更新stage数据失败!"); return; } new MailBiz().SendPromoteMail(pmsHead, newStage); Msgbox("Create Successful!"); PageRegisterStartupScript("window.close();"); } } catch (Exception exception) { throw new Exception(exception.ToString()); } }