protected void BindCheckItem(string Dept) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); BindData(grdInfo, oStandard.GetPrelaunchCheckItem(lblBu.Text, lblBuilding.Text, Dept)); }
private void DelTeamMember(string id) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_NPI_APP_MEMBER oModel_NPI_APP_Member = new Model_NPI_APP_MEMBER(); oModel_NPI_APP_Member._ID = int.Parse(id); try { Dictionary <string, object> result = oStandard.RecordOperation_APPMemeber(oModel_NPI_APP_Member, Status_Operation.DELETE); if ((bool)result["Result"]) { Alert("刪除成功!"); } else { Alert((string)result["ErrMsg"].ToString()); } } catch (Exception ex) { Alert(ex.Message); } }
private void DelTeamMenber(string id, string enName) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oModel = new Model_DFX_PARAM(); oModel._ID = id; try { Dictionary <string, object> result = oStandard.PRAME_RecordOperation(oModel, Status_Operation.DELETE); if ((bool)result["Result"]) { //foreach (string list in Role) //{ // oStandard.Role_Operation(list,enName, "Delete",null); //} ShowMsg("删除團隊成員成功!"); BindTeamMember(cobDept.SelectedItem.Text); } else { Alert((string)result["ErrMsg"].ToString()); } } catch (Exception ex) { Alert(ex.ToString()); } }
private void DelTeamDept(string id) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oModel = new Model_DFX_PARAM(); oModel._ID = id; try { Dictionary <string, object> result = oStandard.PRAME_RecordOperation(oModel, Status_Operation.DELETE); if ((bool)result["Result"]) { Alert("刪除部門成功!"); BindTeamDept(); } else { Alert((string)result["ErrMsg"].ToString()); } } catch (Exception ex) { Alert(ex.Message); } }
private void DeleteItem(string ID) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_PRELAUNCH_CHECKITEMCONFIG oModel = new Model_PRELAUNCH_CHECKITEMCONFIG(); oModel._ID = ID; try { Dictionary <string, object> result = oStandard.RecordOperation_PrelaunchItem(oModel, Status_Operation.DELETE); if ((bool)result["Result"]) { Alert("删除成功!"); BindCheckItem(cobDept.SelectedItem.Text); } else { Alert((string)result["ErrMsg"].ToString()); } } catch (Exception ex) { Alert(ex.ToString()); } }
protected void btnInsert_Click(object sender, DirectEventArgs e) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); #region [為空驗證] string ErrorMsg = ""; string dept = cobDept.SelectedItem.Text.Trim(); string CheckItem = txtCheckItem.Text.Trim(); string AttachmentFlag = cmbAttachment.SelectedItem.Value.Trim(); string UPDATE_USERID = lblLogonId.Text; if (string.IsNullOrEmpty(dept)) { ErrorMsg += "部門,"; } if (string.IsNullOrEmpty(CheckItem)) { ErrorMsg += "項目,"; } if (string.IsNullOrEmpty(AttachmentFlag)) { ErrorMsg += "上傳附件否,"; } if (ErrorMsg.Length > 0) { Alert(ErrorMsg.Substring(0, ErrorMsg.Length - 1) + "不能為空"); return; } #endregion Model_PRELAUNCH_CHECKITEMCONFIG oModel = new Model_PRELAUNCH_CHECKITEMCONFIG(); oModel._Bu = lblBu.Text; oModel._Building = lblBuilding.Text; oModel._Dept = dept; oModel._CheckItem = CheckItem; oModel._AttachmentFlag = AttachmentFlag; oModel._UpdateUser = UPDATE_USERID; oModel._UpdateTime = DateTime.Now; try { Dictionary <string, object> result = oStandard.RecordOperation_PrelaunchItem(oModel, Status_Operation.ADD); if ((bool)result["Result"]) { Alert("新增 CheckItem成功!"); BindCheckItem(""); } else { Alert((string)result["ErrMsg"].ToString()); } } catch (Exception ex) { Alert(ex.ToString()); } }
private void BindMemberList(Model_NPI_MEMBER oModel_Member) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); DataTable dt = oStandard.GetNPIMemeberList(oModel_Member); BindData(grdInfo, dt); }
protected void BindMember(string DocNo, string Category) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); DataTable dt = oStandard.GetAppMember(DocNo, Category); BindGrid(dt, grdInfo); }
protected void btnDelete_Click(object sender, DirectEventArgs e) { string Category = string.Empty; string Dept = string.Empty; string ename = string.Empty; string Id = string.Empty; RowSelectionModel sm = grdInfo.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count <= 0) { Alert("請勾選需刪除的信息!"); return; } string json = e.ExtraParams["Values"]; Dictionary <string, string>[] sele = JSON.Deserialize <Dictionary <string, string>[]>(json); StringBuilder msg = new StringBuilder(); foreach (Dictionary <string, string> row in sele) { Category = row["CATEGORY"].ToString(); Dept = row["DEPT"].ToString(); ename = row["ENAME"].ToString(); Id = row["ID"].ToString(); NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_NPI_MEMBER oModel = new Model_NPI_MEMBER(); oModel._ID = Id; try { Dictionary <string, object> result = oStandard.RecordOperation_NPIMember(oModel, Status_Operation.DELETE); if ((bool)result["Result"]) { Alert("删除團隊成員成功!"); BindMemberList(oModel); } else { Alert((string)result["ErrMsg"].ToString()); } } catch (Exception ex) { msg.Append(string.Format("類別:{0},部門:{1},英文名稱:{2} 刪除作業失敗!ErrMsg:{3}<BR/>", Category, Dept, ename, ex.Message)); } } if (msg.Length > 0) { Alert(msg.ToString()); } else { Alert(string.Format("刪除作業成功!")); } }
private void SPMAfterSend_DBIO(SPMTaskVariables SPMTaskVars, EFFormFields FormFields, ref IInterfaceHandleResult HandleResult, SPMRoutingVariable RoutingVariable) { try { string stepName = (string)SPMTaskVars.ReadDatum("STEPNAME"); int caseID = int.Parse((string)(SPMTaskVars.ReadDatum("CASEID"))); NPIMgmt oMgmt = new NPIMgmt(oUIControls.lblSite.Text, oUIControls.lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Dictionary <string, object> result = new Dictionary <string, object>(); Model_PRELAUNCH_MAIN oModel = new Model_PRELAUNCH_MAIN(); string Handler = oPara.LoginId; switch (RoutingVariable.Key) { case SPMRoutingVariableKey.spm_Recall: //修改本单据数据状态为Abort oModel._CaseId = caseID; oModel._Status = "Abort"; result = oStandard.RecordOperation_PrelaunchMain(oModel, Status_Operation.UPDATE); if (!(bool)result["Result"]) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = (string)result["ErrMsg"]; } break; case SPMRoutingVariableKey.spm_Jump: //1.标示当前关卡已核准(如为最后一关,则变更状态为Finished) string ApproverRemark = string.Empty; string ApproverResult = string.Empty; for (int i = 0; i < oUIControls.rgResult.Items.Count; i++) { if (oUIControls.rgResult.Items[i].Checked == true) { ApproverResult = oUIControls.rgResult.Items[i].BoxLabel.Trim(); } } result = oStandard.UpdateDOAHandlerStatus(caseID, stepName, Handler, ApproverResult, oUIControls.txtReslutOpinion.Text.Trim()); if (!(bool)result["Result"]) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = (string)result["ErrMsg"]; } break; } } catch (Exception e) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = e.Message; } }
protected void SetApproveResultValue(NPIGating_HISUIShadow lUIControls, SPMTaskVariables SPMTaskVars) { string stepname = SPMTaskVars.ReadDatum("STEPNAME").ToString(); string caseid = SPMTaskVars.ReadDatum("CASEID").ToString(); NPIMgmt oMgmt = new NPIMgmt(oUIControls.lblSite.Text, oUIControls.lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); DataTable dt = new DataTable(); dt = oStandard.GetNPIApproveResult(caseid); BindGrid(dt, lUIControls.grdResult); }
protected void btnDelete_Click(object sender, DirectEventArgs e) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); RowSelectionModel sm = this.grdInfo.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count <= 0) { Alert("请选择须删除项!"); return; } string json = e.ExtraParams["Values"]; Dictionary <string, string>[] companies = JSON.Deserialize <Dictionary <string, string>[]>(json); string id = string.Empty; string dept = string.Empty; string enName = string.Empty; string errMsg = string.Empty; foreach (Dictionary <string, string> row in companies) { id = row["ID"]; dept = row["PARAME_VALUE1"]; enName = row["PARAME_VALUE3"]; try { //string[] handler = enName.Split(';'); //foreach (string i in handler) //{ // foreach (string list in Role) // { // oStandard.Role_Operation(list, i, "Delete", lblLogonId.Text); // } //} DelTeamDept(id); } catch (Exception ex) { errMsg += string.Format("刪除部門{0}錯誤:{1}<br/>", dept, ex.Message); } } if (errMsg.Length > 0) { Alert(errMsg); } else { Alert("部門刪除成功!"); } BindTeamDept(); }
private void BindCheckItem(ref Aspose.Cells.Worksheet sheet, string FormNo, string Bu) { //page 格式設定 SetStyle(ref sheet, Aspose.Cells.PageOrientationType.Landscape); Aspose.Cells.Cells cells = sheet.Cells; Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(); Aspose.Cells.Style style = wb.Styles[wb.Styles.Add()]; NPIMgmt oMgmt = new NPIMgmt("CZ", Bu); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); #region//獲取主表資訊 DataTable dtMaster = oStandard.GetPrelaunchInconformity(FormNo); if (dtMaster.Rows.Count > 0) { int templateIndex = 1; //模板row起始位置 int insertIndexEnCounter = templateIndex + 1; //new row起始位置 cells.InsertRows(insertIndexEnCounter, dtMaster.Rows.Count - 1); cells.CopyRows(cells, templateIndex, insertIndexEnCounter, dtMaster.Rows.Count - 1); //複製模板row格式至新行 string url = "http://icm651.liteon.com/WF_PrelaunchReport/"; for (int i = 0; i < dtMaster.Rows.Count; i++) { DataRow dr = dtMaster.Rows[i]; string FileName = dr["FileName"].ToString(); cells[i + templateIndex, 0].PutValue(dr["ID"].ToString()); cells[i + templateIndex, 1].PutValue(dr["Dept"].ToString()); cells[i + templateIndex, 2].PutValue(dr["CheckItem"].ToString()); cells[i + templateIndex, 3].PutValue(dr["Description"].ToString()); cells[i + templateIndex, 4].PutValue(dr["Status"].ToString()); cells[i + templateIndex, 5].PutValue(dr["Remark"].ToString()); cells[i + templateIndex, 6].PutValue(dr["Suggestion"].ToString()); cells[i + templateIndex, 7].PutValue(dr["CompleteDate"].ToString().Length > 0 ? Convert.ToDateTime(dr["CompleteDate"].ToString()).ToString("yyyy/MM/dd") : dr["CompleteDate"].ToString()); cells[i + templateIndex, 8].PutValue(dr["UpateUser"].ToString()); cells[i + templateIndex, 9].PutValue(dr["UpdateTime"].ToString().Length > 0 ? Convert.ToDateTime(dr["UpdateTime"].ToString()).ToString("yyyy/MM/dd") : dr["UpdateTime"].ToString()); if (!string.IsNullOrEmpty(FileName)) { string destFileName = url + dr["AttacheFile"].ToString(); style.HorizontalAlignment = Aspose.Cells.TextAlignmentType.Center; cells[i + templateIndex, 10].PutValue(FileName); cells[i + templateIndex, 10].SetStyle(style); sheet.Hyperlinks.Add(i + templateIndex, 10, 1, 1, destFileName); cells.Merge(i + templateIndex, 10, 1, 3); } } } #endregion }
protected void BindcobNum() { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oDFX_PARAM = new Model_DFX_PARAM(); oDFX_PARAM._FUNCTION_NAME = "NumRule"; oDFX_PARAM._PARAME_NAME = "CATEGORY"; oDFX_PARAM._PARAME_ITEM = lblBu.Text.Trim(); oDFX_PARAM._Building = lblBuilding.Text.Trim(); DataTable dt = oStandard.PARAME_GetBasicData_Filter(oDFX_PARAM); BindData(cobNum, dt); }
/// <summary> /// 綁定部門清單信息 /// </summary> protected void BindTeamDept() { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oDFX_PARAM = new Model_DFX_PARAM(); oDFX_PARAM._FUNCTION_NAME = "TeamMember"; oDFX_PARAM._PARAME_NAME = "Dept"; oDFX_PARAM._PARAME_ITEM = lblBu.Text.Trim(); oDFX_PARAM._Building = txtBuilding.Text.Trim(); DataTable dtDept = oStandard.PARAME_GetBasicData_Filter(oDFX_PARAM); BindData(grdInfo, dtDept); }
/// <summary> /// 填充頁面數據 /// </summary> /// <param name="sheet">worksheet</param> /// <param name="docno">試產主單號</param> /// <param name="subdocno">試產從單號</param> private void BindExcel(ref Aspose.Cells.Worksheet sheet, string caseID, string Bu, string Building, string DocNo) { //page 格式設定 SetStyle(ref sheet, Aspose.Cells.PageOrientationType.Landscape); Aspose.Cells.Cells cells = sheet.Cells; //string logoPath = Page.Server.MapPath("") + "\\log.png"; //sheet.Pictures.Add(0, 0, 4, 10, logoPath); NPIMgmt oMgmt = new NPIMgmt("CZ", Bu); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); #region//獲取主表資訊 DataTable dtMaster = oStandard.GetDFXInconformity(DocNo, "", ""); //string xmlReason = string.Empty; //string xmlPMC = string.Empty; //string xmlResult = string.Empty; //string xmlReasonDetail = string.Empty; if (dtMaster.Rows.Count > 0) { int templateIndexDFX = 5; //模板row起始位置 int insertIndexEnCounter = templateIndexDFX + 1; //new row起始位置 cells.InsertRows(insertIndexEnCounter, dtMaster.Rows.Count - 1); cells.CopyRows(cells, templateIndexDFX, insertIndexEnCounter, dtMaster.Rows.Count - 1); //複製模板row格式至新行 for (int i = 0; i < dtMaster.Rows.Count; i++) { DataRow dr = dtMaster.Rows[i]; cells[i + templateIndexDFX, 1].PutValue(dr["ItemType"].ToString()); cells[i + templateIndexDFX, 2].PutValue(dr["Item"].ToString()); cells[i + templateIndexDFX, 3].PutValue(dr["Location"].ToString()); cells[i + templateIndexDFX, 4].PutValue(dr["Requirements"].ToString()); cells[i + templateIndexDFX, 5].PutValue(""); cells[i + templateIndexDFX, 6].PutValue(dr["Compliance"].ToString()); cells[i + templateIndexDFX, 7].PutValue(dr["PriorityLevel"].ToString()); cells[i + templateIndexDFX, 8].PutValue(dr["MaxPoints"].ToString()); cells[i + templateIndexDFX, 9].PutValue(dr["DFXPoints"].ToString()); cells[i + templateIndexDFX, 10].PutValue(dr["Comments"].ToString()); cells[i + templateIndexDFX, 11].PutValue(dr["Actions"].ToString()); cells[i + templateIndexDFX, 12].PutValue(dr["CompletionDate"].ToString().Length > 0 ? Convert.ToDateTime(dr["CompletionDate"].ToString()).ToString("yyyy/MM/dd"):dr["CompletionDate"].ToString()); cells[i + templateIndexDFX, 13].PutValue(dr["Tracking"].ToString()); cells[i + templateIndexDFX, 14].PutValue(dr["Remark"].ToString()); cells[i + templateIndexDFX, 15].PutValue(dr["WriteDept"].ToString()); } } #endregion }
private void BindPFMA(ref Aspose.Cells.Worksheet sheet, string caseID, string Bu, string Building, string DocNo) { //page 格式設定 SetStyle(ref sheet, Aspose.Cells.PageOrientationType.Landscape); Aspose.Cells.Cells cells = sheet.Cells; //string logoPath = Page.Server.MapPath("") + "\\log.png"; //sheet.Pictures.Add(0, 0, 4, 10, logoPath); NPIMgmt oMgmt = new NPIMgmt("CZ", Bu); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); #region//獲取主表資訊 DataTable dtMaster = oStandard.GetFMEAInconformity(DocNo, "", "", ""); if (dtMaster.Rows.Count > 0) { int templateIndexDFX = 6; //模板row起始位置 int insertIndexEnCounter = templateIndexDFX + 1; //new row起始位置 cells.InsertRows(insertIndexEnCounter, dtMaster.Rows.Count - 1); cells.CopyRows(cells, templateIndexDFX, insertIndexEnCounter, dtMaster.Rows.Count - 1); //複製模板row格式至新行 for (int i = 0; i < dtMaster.Rows.Count; i++) { DataRow dr = dtMaster.Rows[i]; cells[i + templateIndexDFX, 1].PutValue(dr["Item"].ToString()); cells[i + templateIndexDFX, 2].PutValue(dr["Stantion"].ToString()); cells[i + templateIndexDFX, 3].PutValue(dr["Source"].ToString()); cells[i + templateIndexDFX, 4].PutValue(dr["Source"].ToString()); cells[i + templateIndexDFX, 5].PutValue(dr["PotentialFailureMode"].ToString()); cells[i + templateIndexDFX, 6].PutValue(dr["Loess"].ToString()); cells[i + templateIndexDFX, 8].PutValue(dr["Loess"].ToString()); cells[i + templateIndexDFX, 7].PutValue(dr["Sev"].ToString()); cells[i + templateIndexDFX, 8].PutValue(dr["Occ"].ToString()); cells[i + templateIndexDFX, 9].PutValue(dr["DET"].ToString()); cells[i + templateIndexDFX, 10].PutValue(dr["RPN"].ToString()); cells[i + templateIndexDFX, 11].PutValue(dr["PotentialFailure"].ToString()); cells[i + templateIndexDFX, 12].PutValue(dr["TargetCompletionDate"].ToString().Length > 0 ? Convert.ToDateTime(dr["TargetCompletionDate"].ToString()).ToString("yyyy/MM/dd") : dr["TargetCompletionDate"].ToString()); cells[i + templateIndexDFX, 13].PutValue(dr["ActionsTaken"].ToString()); cells[i + templateIndexDFX, 14].PutValue(dr["ResultsSev"].ToString()); cells[i + templateIndexDFX, 15].PutValue(dr["ResultsOcc"].ToString()); cells[i + templateIndexDFX, 16].PutValue(dr["ResultsDet"].ToString()); cells[i + templateIndexDFX, 17].PutValue(dr["ResultsRPN"].ToString()); cells[i + templateIndexDFX, 18].PutValue(dr["WriteDept"].ToString()); } } #endregion }
protected void BindDept() { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_APPLICATION_PARAM oModel_Param = new Model_APPLICATION_PARAM(); oModel_Param._APPLICATION_NAME = "NPI_REPORT"; oModel_Param._FUNCTION_NAME = "Configuration"; oModel_Param._PARAME_NAME = "SubscribeDept"; oModel_Param._PARAME_ITEM = lblBu.Text.Trim(); oModel_Param._PARAME_VALUE1 = lblBuilding.Text.Trim(); DataTable dt = oStandard.PARAME_GetBasicData_Filter(oModel_Param); BindData(cobDept, dt); }
protected DataTable BindParamer(string ParameName) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_APPLICATION_PARAM oModel_Param = new Model_APPLICATION_PARAM(); oModel_Param._APPLICATION_NAME = "NPI_REPORT"; oModel_Param._FUNCTION_NAME = "Configuration"; oModel_Param._PARAME_NAME = ParameName; oModel_Param._PARAME_ITEM = lblBu.Text.Trim(); oModel_Param._PARAME_VALUE1 = lblBuilding.Text.Trim(); DataTable dt = oStandard.PARAME_GetBasicData_Filter(oModel_Param); return(dt); }
private void InitialControl_FormInfo() { //取單號 oUIControls.txtFormNo.Text = Borg_Tools.GetFormNO("NPI"); //日期控件初始化 oUIControls.txtDate.Text = DateTime.Today.ToString("yyyy/MM/dd"); //取登陸人信息 NPIMgmt oMgmt = new NPIMgmt(oUIControls.lblSite.Text, oUIControls.lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); //取登陸人信息 LiteOn.EA.CommonModel.Model_BorgUserInfo oModel_BorgUserInfo = new LiteOn.EA.CommonModel.Model_BorgUserInfo(); Borg_User oBorg_User = new Borg_User(); oModel_BorgUserInfo = oBorg_User.GetUserInfoByLogonId(oPara.LoginId); }
protected void btnDelete_Click(object sender, DirectEventArgs e) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oDFX_PARAM = new Model_DFX_PARAM(); RowSelectionModel sm = this.grdInfo.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count <= 0) { Alert("请选择须删除项!"); return; } string json = e.ExtraParams["Values"]; Dictionary <string, string>[] companies = JSON.Deserialize <Dictionary <string, string>[]>(json); string id = string.Empty; string type = string.Empty; string value = string.Empty; string errMsg = string.Empty; string bu = string.Empty; foreach (Dictionary <string, string> row in companies) { id = row["ID"]; type = row["PARAME_NAME"]; value = row["PARAME_VALUE2"]; bu = row["PARAME_ITEM"]; try { DelTeamDept(id); } catch (Exception ex) { errMsg += string.Format("刪除錯誤,類型:{0} 名稱:{1},ErrMsg:{2}<br/>", type, value, ex.Message); } } if (errMsg.Length > 0) { Alert(errMsg); } else { ShowMsg("刪除成功!"); } BindNumRule(""); }
private void BindHomePage(ref Aspose.Cells.Worksheet sheet, string caseID, string Bu, string Building, string DocNo) { //page 格式設定 SetStyle(ref sheet, Aspose.Cells.PageOrientationType.Landscape); Aspose.Cells.Cells cells = sheet.Cells; //string logoPath = Page.Server.MapPath("") + "\\log.png"; //sheet.Pictures.Add(0, 0, 4, 10, logoPath); NPIMgmt oMgmt = new NPIMgmt("CZ", Bu); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); #region//獲取主表資訊 DataTable dtMaster = oStandard.GetCLCAInconformity(DocNo, "", ""); if (dtMaster.Rows.Count > 0) { int templateIndexDFX = 7; //模板row起始位置 int insertIndexEnCounter = templateIndexDFX + 1; //new row起始位置 cells.InsertRows(insertIndexEnCounter, dtMaster.Rows.Count - 1); cells.CopyRows(cells, templateIndexDFX, insertIndexEnCounter, dtMaster.Rows.Count - 1); //複製模板row格式至新行 for (int i = 0; i < dtMaster.Rows.Count; i++) { DataRow dr = dtMaster.Rows[i]; cells[i + templateIndexDFX, 1].PutValue(dr["PROCESS"].ToString()); cells[i + templateIndexDFX, 2].PutValue(dr["CTQ"].ToString()); cells[i + templateIndexDFX, 3].PutValue(dr["CONTROL_TYPE"].ToString()); cells[i + templateIndexDFX, 4].PutValue(dr["ACT"].ToString()); cells[i + templateIndexDFX, 5].PutValue(dr["RESULT"].ToString()); cells[i + templateIndexDFX, 6].PutValue(dr["DESCRIPTION"].ToString()); cells[i + templateIndexDFX, 7].PutValue(dr["ROOT_CAUSE"].ToString()); cells[i + templateIndexDFX, 8].PutValue(dr["D"].ToString()); cells[i + templateIndexDFX, 9].PutValue(dr["M"].ToString()); cells[i + templateIndexDFX, 10].PutValue(dr["P"].ToString()); cells[i + templateIndexDFX, 11].PutValue(dr["E"].ToString()); cells[i + templateIndexDFX, 12].PutValue(dr["W"].ToString()); cells[i + templateIndexDFX, 13].PutValue(dr["O"].ToString()); cells[i + templateIndexDFX, 14].PutValue(dr["TEMPORARY_ACTION"].ToString()); cells[i + templateIndexDFX, 15].PutValue(dr["CORRECTIVE_PREVENTIVE_ACTION"].ToString()); cells[i + templateIndexDFX, 16].PutValue(dr["COMPLETE_DATE"].ToString().Length > 0 ? Convert.ToDateTime(dr["COMPLETE_DATE"].ToString()).ToString("yyyy/MM/dd") : dr["COMPLETE_DATE"].ToString()); cells[i + templateIndexDFX, 17].PutValue(dr["IMPROVEMENT_STATUS"].ToString()); } } #endregion }
private void BindDept() { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oDFX_PARAM = new Model_DFX_PARAM(); oDFX_PARAM._FUNCTION_NAME = "TeamMember"; oDFX_PARAM._PARAME_NAME = "Dept"; oDFX_PARAM._PARAME_ITEM = lblBu.Text.Trim(); oDFX_PARAM._Building = txtBuilding.Text.Trim(); oDFX_PARAM._PARAME_VALUE3 = lblLogonId.Text; DataTable dt = oStandard.PARAME_GetBasicData_Filter(oDFX_PARAM); BindData(cobDept, dt); if (dt.Rows.Count > 0) { BindTeamMember(dt.Rows[0]["PARAME_VALUE1"].ToString()); } }
protected void btnDelete_Click(object sender, DirectEventArgs e) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); RowSelectionModel sm = this.grdInfo.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count <= 0) { Alert("请选择须删除项!"); return; } string json = e.ExtraParams["Values"]; Dictionary <string, string>[] companies = JSON.Deserialize <Dictionary <string, string>[]>(json); string id = string.Empty; string dept = string.Empty; string enName = string.Empty; string errMsg = string.Empty; foreach (Dictionary <string, string> row in companies) { id = row["ID"]; dept = row["DEPT"]; try { DelTeamMember(id); } catch (Exception ex) { errMsg += string.Format("刪除部門{0}錯誤:{1}<br/>", dept, ex.Message); } } if (errMsg.Length > 0) { Alert(errMsg); } else { Alert("刪除成功!"); } BindMember(txtDOC_NO.Text, string.Empty); }
protected void cobNum_Select(object sender, DirectEventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("PARAME_VALUE1"); dt.Columns.Add("PARAME_VALUE2"); DataRow dr = dt.NewRow(); cobType.Text = ""; string Type = cobNum.SelectedItem.Value; switch (Type) { case "1": dr["PARAME_VALUE1"] = "Dept"; dr["PARAME_VALUE2"] = "部門"; dt.Rows.Add(dr); BindData(cobType, dt); break; case "2": dr["PARAME_VALUE1"] = "Type"; dr["PARAME_VALUE2"] = "類別"; dt.Rows.Add(dr); BindData(cobType, dt); break; case "3": NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oDFX_PARAM = new Model_DFX_PARAM(); oDFX_PARAM._FUNCTION_NAME = "NumRule"; oDFX_PARAM._PARAME_NAME = "Type"; oDFX_PARAM._PARAME_ITEM = lblBu.Text.Trim(); oDFX_PARAM._Building = lblBuilding.Text.Trim(); dt = oStandard.PARAME_GetBasicData_Filter(oDFX_PARAM); BindData(cobType, dt); break; } BindNumRule(null); }
protected void BindNumRule(string Type) { NPIMgmt oMgmt = new NPIMgmt(lblSite.Text, lblBu.Text); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); Model_DFX_PARAM oDFX_PARAM = new Model_DFX_PARAM(); oDFX_PARAM._FUNCTION_NAME = "NumRule"; if (string.IsNullOrEmpty(Type)) { oDFX_PARAM._PARAME_NAME = "Type"; } else { oDFX_PARAM._PARAME_NAME = Type; } oDFX_PARAM._PARAME_ITEM = lblBu.Text.Trim(); oDFX_PARAM._Building = lblBuilding.Text.Trim(); DataTable dt = oStandard.PARAME_GetBasicData_Filter(oDFX_PARAM); BindData(grdInfo, dt); }
private void BindIssuesList(ref Aspose.Cells.Worksheet sheet, string caseID, string Bu, string Building, string DocNo) { //page 格式設定 SetStyle(ref sheet, Aspose.Cells.PageOrientationType.Landscape); Aspose.Cells.Cells cells = sheet.Cells; //string logoPath = Page.Server.MapPath("") + "\\log.png"; //sheet.Pictures.Add(0, 0, 4, 10, logoPath); NPIMgmt oMgmt = new NPIMgmt("CZ", Bu); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); #region//獲取主表資訊 DataTable dtMaster = oStandard.GetIssuesInconformity(DocNo, "", ""); if (dtMaster.Rows.Count > 0) { int templateIndexDFX = 6; //模板row起始位置 int insertIndexEnCounter = templateIndexDFX + 1; //new row起始位置 cells.InsertRows(insertIndexEnCounter, dtMaster.Rows.Count - 1); cells.CopyRows(cells, templateIndexDFX, insertIndexEnCounter, dtMaster.Rows.Count - 1); //複製模板row格式至新行 for (int i = 0; i < dtMaster.Rows.Count; i++) { DataRow dr = dtMaster.Rows[i]; cells[i + templateIndexDFX, 1].PutValue(dr["Items"].ToString()); cells[i + templateIndexDFX, 2].PutValue(dr["STATION"].ToString()); cells[i + templateIndexDFX, 3].PutValue(dr["ISSUE_DESCRIPTION"].ToString()); cells[i + templateIndexDFX, 4].PutValue(dr["FILE_PATH"].ToString()); cells[i + templateIndexDFX, 5].PutValue(dr["ISSUE_LOSSES"].ToString()); cells[i + templateIndexDFX, 6].PutValue(dr["TEMP_MEASURE"].ToString()); cells[i + templateIndexDFX, 7].PutValue(dr["IMPROVE_MEASURE"].ToString()); cells[i + templateIndexDFX, 8].PutValue(dr["CURRENT_STATUS"].ToString()); cells[i + templateIndexDFX, 9].PutValue(dr["TRACKING"].ToString()); cells[i + templateIndexDFX, 10].PutValue(dr["REMARK"].ToString()); } } #endregion }
protected void SetMainValue(NPIGating_HISUIShadow lUIControls, SPMTaskVariables SPMTaskVars, EFFormFields FormFields) { string caseid = SPMTaskVars.ReadDatum("CASEID").ToString(); string Site = FormFields["txtSite".ToUpper()]; string Bu = "HIS"; NPIMgmt oNPIMgmt = new NPIMgmt(Site, Bu); NPI_Standard oStandard = oNPIMgmt.InitialLeaveMgmt(); DataTable dt = oStandard.GetMasterInfoHIS(caseid); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; oUIControls.txtFormNo.Text = dr["DOC_NO"].ToString(); oUIControls.txtCustomer.Text = dr["CUSTOMER"].ToString(); oUIControls.txtDate.Text = dr["APPLY_DATE"].ToString(); oUIControls.txtNotes.Text = dr["REMARK"].ToString(); oUIControls.cmbPhase.Text = dr["PHASE"].ToString(); oUIControls.cmbPlant.Text = dr["BUILDING"].ToString(); oUIControls.cbProductType.SelectedItem.Text = dr["PRODUCT_TYPE"].ToString(); oUIControls.txtModel.Text = dr["MODEL_NAME"].ToString(); oUIControls.cmbLayout.Text = dr["LAYOUT"].ToString(); oUIControls.txtPM.Text = dr["NPI_PM"].ToString(); oUIControls.txtRD.Text = dr["RD_ENGINEER"].ToString(); oUIControls.txtSales.Text = dr["SALES_OWNER"].ToString(); oUIControls.txtNextStage_BeginDate.Text = dr["NEXTSTAGE_DATE"].ToString(); oUIControls.cmbPM.SelectedItem.Text = dr["PM_LOC"].ToString(); oUIControls.txtPMExt.Text = dr["PM_EXT"].ToString(); oUIControls.cmbRD.SelectedItem.Text = dr["RD_LOC"].ToString(); oUIControls.txtRDExt.Text = dr["RD_EXT"].ToString(); oUIControls.cmbSales.SelectedItem.Text = dr["SALES_LOC"].ToString(); oUIControls.txtSalesExt.Text = dr["SALES_EXT"].ToString(); } }
// Code for 'after send' public override void SPMAfterSend(SPMSubmitMethod SubmitMethod, SPMTaskVariables SPMTaskVars, SPMVariables Variables, SPMRoutingVariable RoutingVariable, EFFormFields FormFields, ref IInterfaceHandleResult HandleResult) { string caseid = System.Web.HttpUtility.UrlDecode(Variables[SPMVariableKey.CaseId]); if (RoutingVariable != null) { string sRoutingData = string.Empty; switch (RoutingVariable.Key) { case SPMRoutingVariableKey.spm_Return: sRoutingData = RoutingVariable.Data; break; case SPMRoutingVariableKey.spm_Jump: sRoutingData = RoutingVariable.Data; break; } } //// Business logic if (SubmitMethod != SPMSubmitMethod.CreateNewCase) { SPMAfterSend_DBIO(SPMTaskVars, FormFields, ref HandleResult, RoutingVariable); } else { ////////1.待签核关卡及签核人写DB NPIMgmt oNPIMgmt = new NPIMgmt(oUIControls.lblSite.Text, oUIControls.lblBu.Text); NPI_Standard oStandard = oNPIMgmt.InitialLeaveMgmt(); Dictionary <string, object> result = oStandard.RecordDOAHandler(caseid, oUIControls.txtFormNo.Text, oUIControls.lblBu.Text, oUIControls.cmbPlant.SelectedItem.Text, oUIControls.cmbPhase.SelectedItem.Text); if (!(bool)result["Result"]) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = (string)result["ErrMsg"]; } else { StringBuilder sbLayout = new StringBuilder(); if (oUIControls.cmbLayout.SelectedItems.Count > 0) { foreach (SelectedListItem li in oUIControls.cmbLayout.SelectedItems) { sbLayout.AppendFormat("{0},", li.Text); } } Model_NPI_APP_MAIN_HIS oModel_Main = new Model_NPI_APP_MAIN_HIS(); oModel_Main._DOC_NO = oUIControls.txtFormNo.Text.Trim(); oModel_Main._BU = oUIControls.lblBu.Text; oModel_Main._BUILDING = oUIControls.cmbPlant.SelectedItem.Text; oModel_Main._APPLY_DATE = oUIControls.txtDate.Text; oModel_Main._APPLY_USERID = oPara.LoginId.Trim(); oModel_Main._MODEL_NAME = oUIControls.txtModel.Text; oModel_Main._CUSTOMER = oUIControls.txtCustomer.Text; oModel_Main._PRODUCT_TYPE = oUIControls.cbProductType.SelectedItem.Text; oModel_Main._LAYOUT = sbLayout.ToString().TrimEnd(','); oModel_Main._PHASE = oUIControls.cmbPhase.SelectedItem.Text; oModel_Main._NEXTSTAGE_DATE = oUIControls.txtNextStage_BeginDate.SelectedDate.ToString("yyyy/MM/dd"); oModel_Main._NPI_PM = oUIControls.txtPM.Text; oModel_Main._SALES_OWNER = oUIControls.txtSales.Text; oModel_Main._RD_ENGINEER = oUIControls.txtRD.Text; oModel_Main._REMARK = oUIControls.txtNotes.Text; oModel_Main._CASEID = oPara.CaseId.ToString(); oModel_Main._UPDATE_USERID = oPara.LoginId; oModel_Main._STATUS = "Pending"; oModel_Main._PMLOC = oUIControls.cmbPM.SelectedItem.Text.Trim(); oModel_Main._PMEXT = oUIControls.txtPMExt.Text.Trim(); oModel_Main._RDLOC = oUIControls.cmbRD.SelectedItem.Text.Trim(); oModel_Main._RDEXT = oUIControls.txtRDExt.Text.Trim(); oModel_Main._SALESLOC = oUIControls.cmbSales.SelectedItem.Text.Trim(); oModel_Main._SALESEXT = oUIControls.txtSalesExt.Text.Trim(); result = oStandard.RecordOperation_NPIMain(oModel_Main, Status_Operation.ADD); //result = "true"; if (!(bool)result["Result"]) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = (string)result["ErrMsg"]; } } } base.SPMAfterSend(SubmitMethod, SPMTaskVars, Variables, RoutingVariable, FormFields, ref HandleResult); }
// Fill SPM Variable public override void PrepareSPMVariables(SPMSubmitMethod SubmitMethod, SPMProcessMethod ProcessMethod, SPMTaskVariables SPMTaskVars, ref SPMVariables Variables, ref SPMRoutingVariable RoutingVariable, ref string strSPMUid, string strMemo, string strNotesForNextApprover, EFFormFields FormFields, ref IInterfaceHandleResult HandleResult, ref string SuccessMessage) { bool isError = false; string stepName = string.Empty; string errorMsg = string.Empty; string FormNo = FormFields["txtFormNo".ToUpper()]; string Applicant = oPara.LoginId; Variables.Add(SPMVariableKey.Subject, "[NPIReport_Application] [" + FormNo + "] By [" + Applicant + "]"); string Approver = string.Empty; NPIMgmt oMgmt = new NPIMgmt(oUIControls.lblSite.Text, oUIControls.lblBu.Text); //NPIMgmt oMgmt = new NPIMgmt("CZ1","HIS"); NPI_Standard oStandard = oMgmt.InitialLeaveMgmt(); if (SubmitMethod == SPMSubmitMethod.CreateNewCase) { DataTable dtDOAHandler = oModel_NPI_DOA_HandlerInfo._HANDLER; if (dtDOAHandler.Rows.Count > 0) { DataRow dr = dtDOAHandler.Rows[0]; string step_name = dr["STEP_NAME"].ToString(); string handler = dr["HANDLER"].ToString(); RoutingVariable = new SPMRoutingVariable(SPMRoutingVariableKey.spm_NextHandler, step_name + "(" + handler + ")"); } else { HandleResult.IsSuccess = false; HandleResult.CustomMessage = "無法獲取下一關簽核人信息,請聯絡系統管理員!"; } } if (SubmitMethod == SPMSubmitMethod.HandleCase_Approve) { Dictionary <string, object> result = new Dictionary <string, object>(); stepName = (string)SPMTaskVars.ReadDatum("STEPNAME"); int caseID = int.Parse((string)(SPMTaskVars.ReadDatum("CASEID"))); ////获取待签核关卡及签核人资讯 result = oStandard.GetNextStepAndHandler_NPI(caseID, FormNo, stepName, oUIControls.cmbPlant.SelectedItem.Text, oUIControls.cmbPhase.SelectedItem.Text); if (!(bool)result["Result"])//无法找到签核关卡资讯,显示ERROR { HandleResult.IsSuccess = false; HandleResult.CustomMessage = (string)result["ErrMsg"]; } else { try { RoutingVariable = new SPMRoutingVariable(SPMRoutingVariableKey.spm_Jump, (string)result["SPMRoutingVariable"]); } catch (Exception ex) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = "DOA Error:" + ex.Message; } if (RoutingVariable == null) { HandleResult.IsSuccess = false; HandleResult.CustomMessage = "Error: get RoutingVariable fail"; } } } base.PrepareSPMVariables(SubmitMethod, ProcessMethod, SPMTaskVars, ref Variables, ref RoutingVariable, ref strSPMUid, strMemo, strNotesForNextApprover, FormFields, ref HandleResult, ref SuccessMessage); }