protected void Page_Load(object sender, EventArgs e) { #region//必须的参数信息初始化 if (!string.IsNullOrEmpty(Request["RECID"])) { recid = decimal.Parse(Request["RECID"]); } if (!string.IsNullOrEmpty(Request["WFID"])) { wf_obj_id = int.Parse(Request["WFID"]); if (wf_obj_id <= 0) { if (recid <= 0) { Response.Redirect("SelWFID.aspx"); } if (ViewState["WFID"] != null) { wf_obj_id = Convert.ToInt32(ViewState["WFID"]); } } if (ViewState["WFCNAME"] == null) { wfcname = BLLTable <WF_WFOBJECT> .Factory(conn).GetOneValue(WF_WFOBJECT.Attribute.WF_OBJ_ID, wf_obj_id, WF_WFOBJECT.Attribute.WF_OBJ_NAME); ViewState["WFCNAME"] = wfcname; } else { wfcname = ViewState["WFCNAME"].ToString(); } } else { if (recid <= 0) { Response.Redirect("SelWFID.aspx"); } if (ViewState["WFID"] != null) { wf_obj_id = Convert.ToInt32(ViewState["WFID"]); } } #endregion theme = WebHelper.GetAppPath() + "Themes/" + BasePage._ThemeName; backUrl = WebHelper.GetAppPath() + "WF/FORMList.aspx?mime=1&WFID=" + wf_obj_id; if (preUrl != "") { backUrl = preUrl; } title = wfcname + title; if (!IsPostBack) { Form.Enctype = "multipart/form-data"; UpFilesBfSubmit1.ShowPathPre = "../"; UpFilesBfSubmit1.SavePath = "UploadFiles/WF/Rec/"; txtDEPT_ID.ORG_ID = "7"; #region//默认信息初始化 HR_STAFF staff = userBase.GetStaff(); //如果账户没有员工对应 if (staff != null && !staff.IsNull()) { txtCSTAFF_ID.Value = staff.STAFF_ID.ToString(); txtCSTAFF_NAME.Value = staff.STAFF_NAME; txtDEPT_ID.DEPT_ID = Convert.ToString(staff.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); txtSTAFF_ID.Staff_NAME = staff.STAFF_NAME; txtSTAFF_ID.Staff_ID = staff.STAFF_ID; txtRECNO.Value = WFRecordInfo.GetRECNO(Convert.ToString(staff.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID))); HR_DEPT dept = BLLTable <HR_DEPT> .Factory(conn).GetRowData(HR_DEPT.Attribute.DEPT_ID, Convert.ToString(staff.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID))); if (dept != null && !dept.IsNull()) { txtCDEPT_ID.Value = dept.DEPT_ID; txtCDEPT_NAME.Value = dept.DEPT_NAME; } else { litWarn.Text = "您的账户未设置所属部门"; } } else { litWarn.Text = "您的账户未有对应员工"; } #endregion ViewState["CHECK_INFO"] = ""; WFOBJECT_BLL wfobj = new WFOBJECT_BLL(wf_obj_id); //WFINFO_EXD wfexd = new WFINFO_EXD(wfid,0); FORM_BLL formexd = wfobj.FORM_BLL; if (recid > 0) { #region//单据信息编辑 WF_FORMBASE baseVal = BLLTable <WF_FORMBASE> .Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid); WFRecordInfo recObj = new WFRecordInfo(baseVal, true); if (recObj.HadRecord == false) { ScriptHelper.AlertAndGo(Page, "您要编辑的申请记录不存在!", backUrl); return; } if (wf_obj_id <= 0) { ViewState["WFID"] = baseVal.WFID;//记录下当前工作流ID wf_obj_id = baseVal.WFID; } Dictionary <string, WFieldInfo> dicMore = recObj.ExdFields; //zlg关键-构建表单 litFormMore.Text = formexd.WF_HtmlEditForm(recObj);// WFHtml.ShowMoreFormHtml(wfid, dicMore, ref sbDetail); hadDetail = formexd.HadSubForm; ViewState["STATUS"] = baseVal.STATUS; if (!string.IsNullOrEmpty(baseVal.CHECK_INFO)) { ViewState["CHECK_INFO"] = baseVal.CHECK_INFO; } if (recObj.Base.STATUS == WFEnum.RecStatus.Checking.ToString("d") || recObj.Base.STATUS == WFEnum.RecStatus.ReCheck.ToString("d") || recObj.Base.STATUS == WFEnum.RecStatus.Accepted.ToString("d")) { ScriptHelper.AlertAndGo(Page, "该记录已经进入审批流程,不允许修改!", backUrl); } else { if (recObj.Base.STATUS == WFEnum.RecStatus.NoAccept.ToString("d")) { btnOK.Text = "重新提交"; } WF_FORMBASE valObj = recObj.Base; #region txtDEPT_ID.DEPT_NAME = Convert.ToString(valObj.DEPT_NAME); txtDEPT_ID.DEPT_ID = Convert.ToString(valObj.DEPT_ID);//Convert.ToString txtSTAFF_ID.Staff_ID = valObj.STAFF_ID; txtCSTAFF_ID.Value = Convert.ToString(valObj.CSTAFF_ID); //Convert.ToString txtCSTAFF_NAME.Value = Convert.ToString(valObj.CSTAFF_NAME); //Convert.ToString txtNOTE.Value = Convert.ToString(valObj.NOTE); //Convert.ToString #endregion if (valObj.STAFF_ID != userBase.StaffID && valObj.CSTAFF_ID != userBase.StaffID) { //不是自己提交的申请不能修改或提交审批 btnSave.Enabled = false; } } UpFilesBfSubmit1.ShowOldFiles(baseVal.ANNEX_FILE); #endregion } else { litFormMore.Text = formexd.WF_HtmlEditForm();// WFHtml.ShowMoreFormHtml(wfid, null, ref sbDetail); hadDetail = formexd.HadSubForm; } } }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "�༭"; Page.Title = title; if (!string.IsNullOrEmpty(Request["STAFF_ID"])) { keyid = Request["STAFF_ID"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!string.IsNullOrEmpty(Request["DEPT_ID"])) { deptid = Request["DEPT_ID"]; } if (!string.IsNullOrEmpty(Request["PID"])) { pid = Request["PID"]; } if (!IsPostBack) { txtGENDER.Items.AddRange(FormHelper.GetListItem(HR_STAFF.Attribute.GENDER)); txtWORK_TYPE_CODE.Items.AddRange(FormHelper.GetListItem(HR_STAFF.Attribute.WORK_TYPE_CODE)); txtGENDER.SelectedIndex = 2; try { if (keyid != "") { Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID); HR_STAFF cons = new HR_STAFF(); cons.STAFF_ID = Convert.ToInt32(keyid); List<HR_STAFF> lst = BLLTable<HR_STAFF>.Factory(conn).Select(new HR_STAFF(), rel, new HR_DEPT_STAFF(), cons); //valObj = BLLTable<HR_STAFF>.Factory(conn).GetRowData(HR_STAFF.Attribute.STAFF_ID, keyid); if (lst.Count == 0) return; valObj = lst[0]; SYS_USER user = BLLTable<SYS_USER>.Factory(conn).GetRowData(SYS_USER.Attribute.STAFF_ID, valObj.STAFF_ID); if (user != null && user.IsNotNull()) { txtUSER_ID.Value = Convert.ToString(user.USER_ID); txtUSER_NAME.Value = Convert.ToString(user.USER_NAME); txtUSER_NAME1.Value = Convert.ToString(user.USER_NAME); txtPASS.Value = Convert.ToString(user.PASS); } txtSTAFF_ID.Value = Convert.ToString(valObj.STAFF_ID);//Convert.ToDecimal txtSTAFF_NO.Value = Convert.ToString(valObj.STAFF_NO);//Convert.ToString txtNAME.Value = Convert.ToString(valObj.STAFF_NAME);//Convert.ToString wucSelDept1.DEPT_ID = Convert.ToString(valObj.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); hidDEPT_ID.Value = Convert.ToString(valObj.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); //txtDEPT_ID.Value = Convert.ToString(valObj.DEPT_ID);//Convert.ToString //txtDEPT_Name.Value = BLLTable<HR_DEPT>.Factory(conn).GetOneValue(HR_DEPT.Attribute.DEPT_ID, valObj.DEPT_ID, HR_DEPT.Attribute.DEPT_NAME); wucSelDept1.Enabled = true; txtGENDER.Value = valObj.GENDER; txtPHOTO.Value = Convert.ToString(valObj.PHOTO);//Convert.ToString txtPOS_NAME.Value = Convert.ToString(valObj.POS_NAME);//Convert.ToString //txtSTATION_CODE.Value = Convert.ToString(valObj.STATION_CODE);//Convert.ToString wucSelStation1.STATION_ID = valObj.STATION_CODE; txtWORK_TYPE_CODE.Value = valObj.WORK_TYPE_CODE; txtTECH_LEVEL_CODE.Value = Convert.ToString(valObj.TECH_LEVEL_CODE);//Convert.ToString txtYMD.Value = valObj.YMD;//Convert.ToString txtMOBILE.Value = Convert.ToString(valObj.MOBILE);//Convert.ToString txtOFFICE_TEL.Value = Convert.ToString(valObj.OFFICE_TEL);//Convert.ToString txtCERT_FLAG.Value = Convert.ToString(valObj.CERT_FLAG);//Convert.ToString txtFIXED_FLAG.Value = Convert.ToString(valObj.FIXED_FLAG);//Convert.ToString txtON_POS_FLAG.Value = Convert.ToString(valObj.ON_POS_FLAG);//Convert.ToString txtPROFESSION_CODE.Value = Convert.ToString(valObj.PROFESSION_CODE);//Convert.ToString txtPROFESSION_BGN_DATE.Value = Convert.ToString(valObj.PROFESSION_BGN_DATE);//Convert.ToString txtJOIN_DATE.Value = Convert.ToString(valObj.JOIN_DATE);//Convert.ToString txtPOLITICAL_STATUS_CODE.Value = Convert.ToString(valObj.POLITICAL_STATUS_CODE);//Convert.ToString txtTITLE_CODE.Value = Convert.ToString(valObj.TITLE_CODE);//Convert.ToString txtSTATUS_CODE.Value = Convert.ToString(valObj.STATUS_CODE);//Convert.ToString txtADDR.Value = Convert.ToString(valObj.ADDR);//Convert.ToString txtEMAIL.Value = Convert.ToString(valObj.EMAIL);//Convert.ToString txtNATION.Value = Convert.ToString(valObj.NATION);//Convert.ToString txtNATIVE_PLACE.Value = Convert.ToString(valObj.NATIVE_PLACE);//Convert.ToString txtPOST_NO.Value = Convert.ToString(valObj.POST_NO);//Convert.ToString txtDEGREE_CODE.Value = Convert.ToString(valObj.DEGREE_CODE);//Convert.ToString txtGRAD_SCHOOL.Value = Convert.ToString(valObj.GRAD_SCHOOL);//Convert.ToString txtGRAD_DATE.Value = Convert.ToString(valObj.GRAD_DATE);//Convert.ToString txtMAJOR.Value = Convert.ToString(valObj.MAJOR);//Convert.ToString txtREMARK.Value = Convert.ToString(valObj.REMARK);//Convert.ToString txtUSER_ID.Value = Convert.ToString(valObj.USER_ID);//Convert.ToDecimal txtSNAME.Value = Convert.ToString(valObj.SNAME);//Convert.ToString ViewState["txtSNAME"] = valObj.SNAME; txtRNAME.Value = Convert.ToString(valObj.RNAME);//Convert.ToString txtEXP1.Value = Convert.ToString(valObj.EXP1);//Convert.ToString txtEXP2.Value = Convert.ToString(valObj.EXP2);//Convert.ToString txtEXP3.Value = Convert.ToString(valObj.EXP3);//Convert.ToString } else { if (pid != "" && pid != "0") { //deptid = BLLTable<HR_STAFF>.Factory(conn).GetOneValue(HR_STAFF.Attribute.STAFF_ID, pid, HR_STAFF.Attribute.DEPT_ID); Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID); HR_STAFF cons = new HR_STAFF(); cons.STAFF_ID = Convert.ToInt32(pid); List<HR_STAFF> lst = BLLTable<HR_STAFF>.Factory(conn).Select(new HR_STAFF(), rel, new HR_DEPT_STAFF(), cons); if (lst.Count > 0) deptid = Convert.ToString(lst[0].GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); } if (deptid != "") { wucSelDept1.DEPT_ID = deptid; hidDEPT_ID.Value = deptid; //wucSelDept1.Enabled = false; //txtDEPT_ID.Value = deptid; //txtDEPT_Name.Value = BLLTable<HR_DEPT>.Factory(conn).GetOneValue(HR_DEPT.Attribute.DEPT_ID, deptid, HR_DEPT.Attribute.DEPT_NAME); } } } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { title = valObj._ZhName + "编辑"; Page.Title = title; if (!string.IsNullOrEmpty(Request["STAFF_ID"])) { keyid = Request["STAFF_ID"]; } if (!string.IsNullOrEmpty(Request["KeyID"])) { keyid = Request["KeyID"]; } if (!string.IsNullOrEmpty(Request["DEPT_ID"])) { deptid = Request["DEPT_ID"]; } if (!string.IsNullOrEmpty(Request["PID"])) { pid = Request["PID"]; } if (!IsPostBack) { txtGENDER.Items.AddRange(FormHelper.GetListItem(HR_STAFF.Attribute.GENDER)); txtWORK_TYPE_CODE.Items.AddRange(FormHelper.GetListItem(HR_STAFF.Attribute.WORK_TYPE_CODE)); txtGENDER.SelectedIndex = 2; try { if (keyid != "") { Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID); HR_STAFF cons = new HR_STAFF(); cons.STAFF_ID = Convert.ToInt32(keyid); List <HR_STAFF> lst = BLLTable <HR_STAFF> .Factory(conn).Select(new HR_STAFF(), rel, new HR_DEPT_STAFF(), cons); //valObj = BLLTable<HR_STAFF>.Factory(conn).GetRowData(HR_STAFF.Attribute.STAFF_ID, keyid); if (lst.Count == 0) { return; } valObj = lst[0]; SYS_USER user = BLLTable <SYS_USER> .Factory(conn).GetRowData(SYS_USER.Attribute.STAFF_ID, valObj.STAFF_ID); if (user != null && user.IsNotNull()) { txtUSER_ID.Value = Convert.ToString(user.USER_ID); txtUSER_NAME.Value = Convert.ToString(user.USER_NAME); txtUSER_NAME1.Value = Convert.ToString(user.USER_NAME); txtPASS.Value = Convert.ToString(user.PASS); } txtSTAFF_ID.Value = Convert.ToString(valObj.STAFF_ID); //Convert.ToDecimal txtSTAFF_NO.Value = Convert.ToString(valObj.STAFF_NO); //Convert.ToString txtNAME.Value = Convert.ToString(valObj.STAFF_NAME); //Convert.ToString wucSelDept1.DEPT_ID = Convert.ToString(valObj.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); hidDEPT_ID.Value = Convert.ToString(valObj.GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); //txtDEPT_ID.Value = Convert.ToString(valObj.DEPT_ID);//Convert.ToString //txtDEPT_Name.Value = BLLTable<HR_DEPT>.Factory(conn).GetOneValue(HR_DEPT.Attribute.DEPT_ID, valObj.DEPT_ID, HR_DEPT.Attribute.DEPT_NAME); wucSelDept1.Enabled = true; txtGENDER.Value = valObj.GENDER; txtPHOTO.Value = Convert.ToString(valObj.PHOTO); //Convert.ToString txtPOS_NAME.Value = Convert.ToString(valObj.POS_NAME); //Convert.ToString //txtSTATION_CODE.Value = Convert.ToString(valObj.STATION_CODE);//Convert.ToString wucSelStation1.STATION_ID = valObj.STATION_CODE; txtWORK_TYPE_CODE.Value = valObj.WORK_TYPE_CODE; txtTECH_LEVEL_CODE.Value = Convert.ToString(valObj.TECH_LEVEL_CODE); //Convert.ToString txtYMD.Value = valObj.YMD; //Convert.ToString txtMOBILE.Value = Convert.ToString(valObj.MOBILE); //Convert.ToString txtOFFICE_TEL.Value = Convert.ToString(valObj.OFFICE_TEL); //Convert.ToString txtCERT_FLAG.Value = Convert.ToString(valObj.CERT_FLAG); //Convert.ToString txtFIXED_FLAG.Value = Convert.ToString(valObj.FIXED_FLAG); //Convert.ToString txtON_POS_FLAG.Value = Convert.ToString(valObj.ON_POS_FLAG); //Convert.ToString txtPROFESSION_CODE.Value = Convert.ToString(valObj.PROFESSION_CODE); //Convert.ToString txtPROFESSION_BGN_DATE.Value = Convert.ToString(valObj.PROFESSION_BGN_DATE); //Convert.ToString txtJOIN_DATE.Value = Convert.ToString(valObj.JOIN_DATE); //Convert.ToString txtPOLITICAL_STATUS_CODE.Value = Convert.ToString(valObj.POLITICAL_STATUS_CODE); //Convert.ToString txtTITLE_CODE.Value = Convert.ToString(valObj.TITLE_CODE); //Convert.ToString txtSTATUS_CODE.Value = Convert.ToString(valObj.STATUS_CODE); //Convert.ToString txtADDR.Value = Convert.ToString(valObj.ADDR); //Convert.ToString txtEMAIL.Value = Convert.ToString(valObj.EMAIL); //Convert.ToString txtNATION.Value = Convert.ToString(valObj.NATION); //Convert.ToString txtNATIVE_PLACE.Value = Convert.ToString(valObj.NATIVE_PLACE); //Convert.ToString txtPOST_NO.Value = Convert.ToString(valObj.POST_NO); //Convert.ToString txtDEGREE_CODE.Value = Convert.ToString(valObj.DEGREE_CODE); //Convert.ToString txtGRAD_SCHOOL.Value = Convert.ToString(valObj.GRAD_SCHOOL); //Convert.ToString txtGRAD_DATE.Value = Convert.ToString(valObj.GRAD_DATE); //Convert.ToString txtMAJOR.Value = Convert.ToString(valObj.MAJOR); //Convert.ToString txtREMARK.Value = Convert.ToString(valObj.REMARK); //Convert.ToString txtUSER_ID.Value = Convert.ToString(valObj.USER_ID); //Convert.ToDecimal txtSNAME.Value = Convert.ToString(valObj.SNAME); //Convert.ToString ViewState["txtSNAME"] = valObj.SNAME; txtRNAME.Value = Convert.ToString(valObj.RNAME); //Convert.ToString txtEXP1.Value = Convert.ToString(valObj.EXP1); //Convert.ToString txtEXP2.Value = Convert.ToString(valObj.EXP2); //Convert.ToString txtEXP3.Value = Convert.ToString(valObj.EXP3); //Convert.ToString } else { if (pid != "" && pid != "0") { //deptid = BLLTable<HR_STAFF>.Factory(conn).GetOneValue(HR_STAFF.Attribute.STAFF_ID, pid, HR_STAFF.Attribute.DEPT_ID); Relation rel = new Relation(HR_STAFF.Attribute.STAFF_ID, HR_DEPT_STAFF.Attribute.STAFF_ID); HR_STAFF cons = new HR_STAFF(); cons.STAFF_ID = Convert.ToInt32(pid); List <HR_STAFF> lst = BLLTable <HR_STAFF> .Factory(conn).Select(new HR_STAFF(), rel, new HR_DEPT_STAFF(), cons); if (lst.Count > 0) { deptid = Convert.ToString(lst[0].GetValue(HR_DEPT_STAFF.Attribute.DEPT_ID)); } } if (deptid != "") { wucSelDept1.DEPT_ID = deptid; hidDEPT_ID.Value = deptid; //wucSelDept1.Enabled = false; //txtDEPT_ID.Value = deptid; //txtDEPT_Name.Value = BLLTable<HR_DEPT>.Factory(conn).GetOneValue(HR_DEPT.Attribute.DEPT_ID, deptid, HR_DEPT.Attribute.DEPT_NAME); } } } catch (Exception ex) { litWarn.Text = ex.Message; } } }