Пример #1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (recid > 0)
     {
         WFOBJECT_BLL wfbll = new WFOBJECT_BLL(WF_OBJ_ID, recid);
         string       err   = "";
         //bool ck = wfbll.WF_CheckStepChecker(recid, out err);
         bool ck = true;
         if (ck == false)
         {
             AgileFrame.Core.ScriptHelper.Alert(Page, err + " 无法提交。");
         }
         else
         {
             string chckerUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + WF_OBJ_ID + "&PROCID=" + PROCID + "&RECID=" + recid;
             Response.Redirect(chckerUrl, false);
         }
     }
 }
Пример #2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (recid > 0)
        {
            WFOBJECT_BLL wfbll = new WFOBJECT_BLL(WF_OBJ_ID, recid);
            string err = "";
            //bool ck = wfbll.WF_CheckStepChecker(recid, out err);
            bool ck = true;
            if (ck == false)
            {
                AgileFrame.Core.ScriptHelper.Alert(Page, err + " �޷��ύ��");
            }
            else
            {
                string chckerUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + WF_OBJ_ID + "&PROCID=" + PROCID + "&RECID=" + recid;
                Response.Redirect(chckerUrl, false);
            }

        }
    }
Пример #3
0
    protected string checkDB(TF_TB_FIELD fdObj, TF_TABLE tbObj)
    {
        if (string.IsNullOrEmpty(tbObj.TB_NAME))
        {
            return(null);
        }
        string ret = ""; DataBaseTable dt1; DataBaseField df1;

        if (!DataBaseHelper.dbMain.TryGetValue(tbObj.TB_NAME, fdObj.FIELD_NAME, out dt1, out df1))
        {
            ret = string.Format("<font color='red'>物理字段不存在</font><a href='FIELDEdit.aspx?KeyID={0}&tree=" + DateTime.Now.Millisecond + "'>新增</a>", fdObj.FIELD_ID);
        }
        string FORM_TB = WFOBJECT_BLL.GetWFTempTBName(tbObj);

        if (!string.IsNullOrEmpty(FORM_TB) &&
            !DataBaseHelper.dbMain.TryGetValue(FORM_TB, fdObj.FIELD_NAME, out dt1, out df1))
        {
            ret = string.Format("<font color='red'>流程表中,物理字段不存在</font><a href='FIELDEdit.aspx?KeyID={0}&tree=" + DateTime.Now.Millisecond + "'>新增</a>", fdObj.FIELD_ID);
        }
        return(ret);
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["RECID"]))
        {
            recid = decimal.Parse(Request["RECID"]);
        }
        else
        {
            Response.Write("�Ƿ����ӣ�");
            Response.End();
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            WFOBJ_ID = int.Parse(Request["WFID"]);
        }
        if (!IsPostBack)
        {

            //try
            //{

            ViewState["CHECK_INFO"] = "";
            StringBuilder sbDetail = new StringBuilder();
            if (recid > 0)
            {
                WF_FORMBASE valObj = BLLTable<WF_FORMBASE>.Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid);
                if (WFOBJ_ID <= 0)
                {
                    WFOBJ_ID = valObj.WFID;
                }
                WFOBJECT_BLL wfbll = new WFOBJECT_BLL(WFOBJ_ID);
                FORM_BLL formbll = wfbll.FORM_BLL;

                //WFINFO_EXD wfExd = wfbll.WFExd;// new WFINFO_EXD(WFID, valObj.PROCID);
                //WFORM_EXD wform = wfExd.GetFORM();
                litTitle.Text = valObj.RECNAME;
                WFRecordInfo recObj = new WFRecordInfo(valObj, true);
                if (recObj.HadRecord == false)
                {
                    Response.Write("��Ҫ�鿴�������¼�����ڣ�");
                    Response.End();
                    return;
                }

                PROCID = valObj.PROCID;

                title = valObj.RECNAME;
                if (!string.IsNullOrEmpty(valObj.CHECK_INFO))
                {
                    ViewState["CHECK_INFO"] = valObj.CHECK_INFO;
                }
                if (sbDetail.Length > 1)
                {
                    ViewState["HadDetail"] = true;
                    litDetail.Text = sbDetail.ToString();
                }

                if (valObj.PROCID > 0) {
                    ViewState["PROCID"] = valObj.PROCID;
                }
                litDetail.Text = formbll.WF_HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                if (!string.IsNullOrEmpty(valObj.ANNEX_FILE))
                {
                    //litAnnex.Text = "<dl class='row'><dt>������</dt><dd><a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a></dd></dl>";
                    string tempStr = "<tr><td class='lbl'><label>Ա������</label></td><td colspan='4'><span>�»���</span></td></tr>";
                    tempStr = StringHelper.ReplaceNonCase(tempStr, "Ա����", "����");
                    litAnnex.Text = StringHelper.ReplaceNonCase(tempStr, "�»���", "<a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a>");
                }

                bool hadPower = false;
                litWFPath.Text = wfbll.HtmlWFTextMap(recid, userBase.StaffID, ref hadPower);// WFHtml.ShowProcessTextMap(wfid, valObj.PROCID, recid, userBase.StaffID, ref hadPower);

            }
            //}
            //catch (Exception ex)
            //{
            //    litWarn.Text = ex.Message; txtREASON.Value = "00000000";
            //}

        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title ="���뵥�б�";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wf_obj_id = int.Parse(Request["WFID"]);
            wfbll = new WFOBJECT_BLL(wf_obj_id);
            if (wfbll.Base != null)
            {
                bllform = wfbll.FORM_BLL;
                wfobj = wfbll.Base;
            }
            else
            {
                return;
            }
        }
        else
        {
            return;
        }
        appPath = WebHelper.GetAppPath();
        if (!IsPostBack)
        {
            staff_id = userBase.GetStaff().STAFF_ID;
            title = wfbll.Base._WF_OBJ_NAME;
           ////////////
            WF_INFO cond = new WF_INFO();
            cond.STATUS = "1";
            List<WF_INFO> lst = BLLTable<WF_INFO>.Factory(conn).Select(new WF_INFO(), cond);

            List<WF_TYPE> lstType = BLLTable<WF_TYPE>.Factory(conn).Select(new WF_TYPE(), new WF_TYPE());
            for (int i = 0; i < lstType.Count; i++)
            {
                var lll = lst.Where(l => l._TYPE_ID == lstType[i]._TYPE_ID);
                litMenu.Text += "<li><a>" + lstType[i].TYPE_NAME + "</a><ul>";
                foreach (WF_INFO l in lll)
                {
                    litMenu.Text += "<li><a href='" + appPath + "WF/FORMList.aspx?mine=1&WFID=" + l.WFID + "' data=\"{key:'wf" + l.WFID + "mylist'}\">" + l.WFCNAME + "����</a></li>";
                }
                litMenu.Text += "</ul></li>";
            }
            ////////////

            //���û�������Ա����ô�����staff_id == 0

            ViewState["STAFF_ID"] = staff_id;
            #region//Ĭ�����Գ�ʼ��
            aspPager.CurrentPageIndex = 1;
            aspPager.ShowInputBox = AgileFrame.Core.WebSystem.ShowInputBox.Auto;//.WebCtrls
            txtPageSize.Value = "30";
            aspPager.PageSize = 30;

            #endregion

            #region//���ݳ�ʼ��

            //txtSTATUS.Items.AddRange(FormHelper.GetListItem(WF_FORMBASE.Attribute.STATUS));
            #endregion

            BindList(1);

        }
    }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        theme = WebHelper.GetAppPath() + "Themes/" + BasePage._ThemeName;

        if (!string.IsNullOrEmpty(Request["RECID"]))
        {
            recid = decimal.Parse(Request["RECID"]);
        }
        else
        {
            Response.Write("非法连接!");
            Response.End();
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            WF_OBJ_ID = int.Parse(Request["WFID"]);
        }
        if (!IsPostBack)
        {
            //try
            //{
            hideButton();

            ViewState["CHECK_INFO"] = "";
            StringBuilder sbDetail = new StringBuilder();
            if (recid > 0)
            {
                WF_FORMBASE valObj = BLLTable <WF_FORMBASE> .Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid);

                if (WF_OBJ_ID <= 0 && valObj != null)
                {
                    WF_OBJ_ID = valObj.WFID;
                }
                if (WF_OBJ_ID <= 0)
                {
                    return;
                }

                //WFINFO_EXD wfExd = new WFINFO_EXD(WFID, valObj.PROCID);
                //WFORM_EXD wform = wfExd.GetFORM();
                WFOBJECT_BLL wfbll = new WFOBJECT_BLL(WF_OBJ_ID, recid);
                litTitle.Text = valObj.RECNAME;
                WFRecordInfo recObj = new WFRecordInfo(valObj, true);
                if (recObj.HadRecord == false)
                {
                    Response.Write("您要查看的申请记录不存在!");
                    Response.End();
                    return;
                }
                PROCID = valObj.PROCID;
                title  = valObj.RECNAME;
                //zlg
                if (MyDebugger.IsAttached)
                {
                    title += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|" + wfbll.FORM_BLL.DbTable.TB_NAME
                             + "|" + wfbll.WFExd.Base._FORM_TB + "|" + wfbll.WFExd.Base._FILE_TB;
                }
                //CHECK_INFO 为空,是有问题的。
                if (!string.IsNullOrEmpty(valObj.CHECK_INFO))
                {
                    ViewState["CHECK_INFO"] = valObj.CHECK_INFO;
                }
                else
                {
                    "".ToString();
                }
                if (sbDetail.Length > 1)
                {
                    ViewState["HadDetail"] = true;
                    litDetail.Text         = sbDetail.ToString();
                }

                if ((valObj.STATUS == WFEnum.RecStatus.Submit.ToString("d") ||
                     valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d") ||
                     valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d")) && valObj.CSTAFF_ID == userBase.StaffID)
                {
                    btnSubmit.Enabled = true;
                    if (valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d"))
                    {
                        btnSubmit.Text = "重新提交";
                    }
                    if (valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d"))
                    {
                        btnSubmit.Text = "重新启动";
                    }
                }
                else
                {
                    btnSubmit.Enabled = false;
                }
                bool canStop = valObj.STATUS == WFEnum.RecStatus.Checking.ToString("d") && valObj.CSTAFF_ID == userBase.StaffID;

                btnStop.Enabled = canStop;

                if ((valObj.STATUS == WFEnum.RecStatus.Submit.ToString("d") || valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d") || valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d")) && valObj.CSTAFF_ID == userBase.StaffID)
                {
                    btnToEdit.Enabled = true;
                }
                else
                {
                    btnToEdit.Enabled = false;
                }

                if (valObj.PROCID > 0)
                {
                    ViewState["PROCID"] = valObj.PROCID;
                }

                //jinsj  从字段中获取HTML
                //litDetail.Text = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);// wform.HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                string status = valObj.STATUS;
                status         = WFEnum.GetRecStatus(status);
                litDetail.Text = valObj.HTML_TEXT.Replace("!STATUS!", status);// wform.HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                if (!string.IsNullOrEmpty(valObj.ANNEX_FILE))
                {
                    string[] lstAnnex = valObj.ANNEX_FILE.Split(',');
                    string   html     = "";
                    foreach (string strAnnex in lstAnnex)
                    {
                        html += "<a href='" + WebHelper.GetAppPath() + strAnnex + "' target='_blank'>" + strAnnex.Substring(strAnnex.LastIndexOf("/") + 1) + "</a></br>";
                    }
                    //litAnnex.Text = "<dl class='row'><dt>附件:</dt><dd><a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a></dd></dl>";
                    string tempStr = "<tr><td class='lbl'><label>员工名:</label></td><td colspan='4'><span>陈焕许</span></td></tr>";
                    tempStr       = StringHelper.ReplaceNonCase(tempStr, "员工名", "附件");
                    litAnnex.Text = StringHelper.ReplaceNonCase(tempStr, "陈焕许", html);
                }

                bool hadPower = false;
                litWFPath.Text = wfbll.HtmlWFTextMapNew(recid, userBase.StaffID, ref hadPower);// wfExd.HtmlWFTextMap(recid, userBase.StaffID, ref hadPower);// WFHtml.ShowProcessTextMap(wfid, valObj.PROCID, recid, userBase.StaffID, ref hadPower);
                //获取流程图
                htmlText = wfbll.GetStepPath(recid, ref script);
                //zlg
                if (!hadPower)
                {
                    hadPower = (userBase.UserName == "sys");
                }

                btnToCheck.Enabled = hadPower && (valObj.STATUS == WFEnum.RecStatus.Checking.ToString("d") || valObj.STATUS == WFEnum.RecStatus.ReCheck.ToString("d"));// && (ViewState["PROCID"] != null);
                //Response.Write(hadPower.ToString());
            }
            //}
            //catch (Exception ex)
            //{
            //    litWarn.Text = ex.Message; txtREASON.Value = "00000000";
            //}

            if (Request["fromTab"] != null)
            {
                btnBack.Value = "关闭";
            }

            if (Request["notice"] != null)
            {
                hideButton();
                btnBack.Value = "关闭";
            }
        }
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    intWfId  = Common.GetReqIntValue("wfid");
        string strWhere = Common.GetReqStrValue("where");
        int    recount  = -1;
        string strCOLS  = "";

        string[]  arr = null;
        DataTable dt  = null;

        WFOBJECT_BLL wfbll   = new WFOBJECT_BLL(intWfId);
        FORM_BLL     bllform = null;

        if (wfbll.Base != null)
        {
            bllform = wfbll.FORM_BLL;
        }

        if (bllform != null)
        {
            dt = bllform.WF_SelectByPage(intWfId, 12, 1, ref recount, strWhere, out strCOLS);

            //在合同里增加 金额 字段
            arr = StringHelper.GetStringArray(strCOLS, ',');
        }

        Response.Clear();
        Response.Buffer  = true;
        Response.Charset = "GB2312";
        //Response.ContentEncoding = System.Text.Encoding.UTF8;

        Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("流程列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls"));
        Response.ContentType = "application/vnd.ms-excel";
        string header = "";
        string body   = "";

        header += "编号\t";
        header += "提交人\t";
        header += "申请单名称\t";
        header += "申请部门\t";
        header += "提交时间\t";
        header += "审批情况\t";
        if (arr != null)
        {
            for (int i = 0; i < arr.Length; i++)
            {
                string[] aaa = arr[i].Split(':');
                if (aaa.Length > 1)
                {
                    header += aaa[1] + "\t";
                }
            }
        }
        header += "\n";

        if (dt != null)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                body += Convert.ToString(dt.Rows[i]["RECID"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["CSTAFF_NAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["RECNAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["DEPT_NAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["ADDTIME"]) + "\t";
                body += WFEnum.GetRecStatus(Convert.ToString(dt.Rows[i]["STATUS"])) + "\t";
                if (arr != null)
                {
                    for (int j = 0; j < arr.Length; j++)
                    {
                        string[] aaa = arr[j].Split(':');
                        if (aaa.Length > 1)
                        {
                            body += Convert.ToString(dt.Rows[i][aaa[0]]) + "\t";
                        }
                    }
                }
                body += "\n";
            }
        }

        Response.Write(header);
        Response.Write(body);
        Response.End();
    }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["RECID"]))
        {
            recid = decimal.Parse(Request["RECID"]);
        }
        else
        {
            Response.Write("非法连接!");
            Response.End();
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            WFOBJ_ID = int.Parse(Request["WFID"]);
        }
        if (!IsPostBack)
        {
            //try
            //{


            ViewState["CHECK_INFO"] = "";
            StringBuilder sbDetail = new StringBuilder();
            if (recid > 0)
            {
                WF_FORMBASE valObj = BLLTable <WF_FORMBASE> .Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid);

                if (WFOBJ_ID <= 0)
                {
                    WFOBJ_ID = valObj.WFID;
                }
                WFOBJECT_BLL wfbll   = new WFOBJECT_BLL(WFOBJ_ID);
                FORM_BLL     formbll = wfbll.FORM_BLL;

                //WFINFO_EXD wfExd = wfbll.WFExd;// new WFINFO_EXD(WFID, valObj.PROCID);
                //WFORM_EXD wform = wfExd.GetFORM();
                litTitle.Text = valObj.RECNAME;
                WFRecordInfo recObj = new WFRecordInfo(valObj, true);
                if (recObj.HadRecord == false)
                {
                    Response.Write("您要查看的申请记录不存在!");
                    Response.End();
                    return;
                }

                PROCID = valObj.PROCID;

                title = valObj.RECNAME;
                if (!string.IsNullOrEmpty(valObj.CHECK_INFO))
                {
                    ViewState["CHECK_INFO"] = valObj.CHECK_INFO;
                }
                if (sbDetail.Length > 1)
                {
                    ViewState["HadDetail"] = true;
                    litDetail.Text         = sbDetail.ToString();
                }

                if (valObj.PROCID > 0)
                {
                    ViewState["PROCID"] = valObj.PROCID;
                }
                litDetail.Text = formbll.WF_HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                if (!string.IsNullOrEmpty(valObj.ANNEX_FILE))
                {
                    //litAnnex.Text = "<dl class='row'><dt>附件:</dt><dd><a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a></dd></dl>";
                    string tempStr = "<tr><td class='lbl'><label>员工名:</label></td><td colspan='4'><span>陈焕许</span></td></tr>";
                    tempStr       = StringHelper.ReplaceNonCase(tempStr, "员工名", "附件");
                    litAnnex.Text = StringHelper.ReplaceNonCase(tempStr, "陈焕许", "<a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a>");
                }

                bool hadPower = false;
                litWFPath.Text = wfbll.HtmlWFTextMap(recid, userBase.StaffID, ref hadPower);// WFHtml.ShowProcessTextMap(wfid, valObj.PROCID, recid, userBase.StaffID, ref hadPower);
            }
            //}
            //catch (Exception ex)
            //{
            //    litWarn.Text = ex.Message; txtREASON.Value = "00000000";
            //}
        }
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int intWfId = Common.GetReqIntValue("wfid");
        string strWhere = Common.GetReqStrValue("where");
        int recount = -1;
        string strCOLS = "";
        string[] arr = null;
        DataTable dt = null;

        WFOBJECT_BLL wfbll = new WFOBJECT_BLL(intWfId);
        FORM_BLL bllform = null;
        if (wfbll.Base != null)
        {
            bllform = wfbll.FORM_BLL;
        }

        if (bllform != null)
        {
            dt = bllform.WF_SelectByPage(intWfId, 12, 1, ref recount, strWhere, out strCOLS);

            //在合同里增加 金额 字段
            arr = StringHelper.GetStringArray(strCOLS, ',');

        }

        Response.Clear();
        Response.Buffer = true;
        Response.Charset = "GB2312";
        //Response.ContentEncoding = System.Text.Encoding.UTF8;

        Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("流程列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls"));
        Response.ContentType = "application/vnd.ms-excel";
        string header = "";
        string body = "";
        header += "编号\t";
        header += "提交人\t";
        header += "申请单名称\t";
        header += "申请部门\t";
        header += "提交时间\t";
        header += "审批情况\t";
        if (arr != null)
        {
            for (int i = 0; i < arr.Length; i++)
            {
                string[] aaa = arr[i].Split(':');
                if (aaa.Length > 1)
                    header += aaa[1] + "\t";
            }
        }
        header += "\n";

        if (dt != null)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                body += Convert.ToString(dt.Rows[i]["RECID"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["CSTAFF_NAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["RECNAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["DEPT_NAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["ADDTIME"]) + "\t";
                body += WFEnum.GetRecStatus(Convert.ToString(dt.Rows[i]["STATUS"])) + "\t";
                if (arr != null)
                {
                    for (int j = 0; j < arr.Length; j++)
                    {
                        string[] aaa = arr[j].Split(':');
                        if (aaa.Length > 1)
                            body += Convert.ToString(dt.Rows[i][aaa[0]]) + "\t";
                    }
                }
                body += "\n";
            }
        }

        Response.Write(header);
        Response.Write(body);
        Response.End();
    }
Пример #10
0
    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;
            }
        }
    }
Пример #11
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        WFOBJECT_BLL wfobj = new WFOBJECT_BLL(wf_obj_id);
        Button       btn   = (Button)sender;//当前单击的按钮
        //WFINFO_EXD wfExd = new WFINFO_EXD(wfid,0);
        WFRecordInfo recInfo = new WFRecordInfo(wf_obj_id, recid);

        //FORM_BLL wform = wfobj.FORM_BLL;

        WF_FORMBASE valObj = new WF_FORMBASE();

        //WF_FORMDETAIL formDetail = null;
        #region                        //通用基本信息赋值
        valObj.RECNO = txtRECNO.Value; //单号唯一

        if (txtDEPT_ID.DEPT_ID != "")
        {
            valObj.DEPT_ID = Convert.ToString(txtDEPT_ID.DEPT_ID);

            HR_DEPT dept = BLLTable <HR_DEPT> .Factory(conn).GetRowData(HR_DEPT.Attribute.DEPT_ID, valObj.DEPT_ID);

            HR_ORG org = BLLTable <HR_ORG> .Factory(conn).GetRowData(HR_ORG.Attribute.ORG_ID, dept.ORG_ID);

            valObj.ORG_ID    = org.ORG_ID;
            valObj.ORG_NAME  = org.ORG_NAME;
            valObj.DEPT_NAME = dept.DEPT_NAME;
        }

        if (txtSTAFF_ID.Staff_ID > 0)
        {
            valObj.STAFF_ID   = txtSTAFF_ID.Staff_ID;
            valObj.STAFF_NAME = txtSTAFF_ID.Staff_NAME;
        }

        if (txtCSTAFF_ID.Value != "")
        {
            valObj.CSTAFF_ID  = Convert.ToDecimal(txtCSTAFF_ID.Value);
            valObj.CDEPT_ID   = txtCDEPT_ID.Value;
            valObj.CDEPT_NAME = txtCDEPT_NAME.Value;

            HR_DEPT_STAFF cond = new HR_DEPT_STAFF();
            cond.STAFF_ID = valObj.CSTAFF_ID;
            Relation reldep = new Relation(HR_DEPT_STAFF.Attribute.DEPT_ID, HR_DEPT.Attribute.DEPT_ID);
            Relation relorg = new Relation(HR_ORG.Attribute.ORG_ID, HR_DEPT.Attribute.ORG_ID);

            List <Relation> lstrel = new List <Relation>();
            lstrel.Add(reldep);
            lstrel.Add(relorg);

            List <ITableImplement> lstcond = new List <ITableImplement>();
            lstcond.Add(cond);

            List <HR_ORG> lstOrg = BLLTable <HR_ORG> .Select(new HR_ORG(), lstrel, null, lstcond);

            if (lstOrg.Count > 0)
            {
                valObj.CORG_ID   = lstOrg[0].ORG_ID;
                valObj.CORG_NAME = lstOrg[0].ORG_NAME;
            }
        }
        if (txtCSTAFF_NAME.Value != "")
        {
            valObj.CSTAFF_NAME = Convert.ToString(txtCSTAFF_NAME.Value);
        }
        valObj.EDITIME    = DateTime.Now;
        valObj.NOTE       = txtNOTE.Value;
        valObj.ANNEX_FILE = UpFilesBfSubmit1.GetUpFilesString();

        //if (hadDetail)//若有明细表单,创建明细表单通用信息对象并赋值
        //{
        //    formDetail = new WF_FORMDETAIL();
        //    formDetail.DEPT_ID = valObj.DEPT_ID;
        //    formDetail.DEPT_NAME = valObj.DEPT_NAME;
        //    formDetail.STAFF_ID = valObj.STAFF_ID;
        //    formDetail.STAFF_NAME = valObj.STAFF_NAME;
        //    formDetail.STATUS = "0";
        //    formDetail.DETAIL_NO = "0";
        //}
        #endregion
        if (recid > 0)
        {
            #region//编辑单据信息

            valObj.RECID       = recid;
            valObj.WFID        = wf_obj_id;
            valObj.FORM_PRI_ID = recInfo.Base.FORM_PRI_ID; //扩展表修改必须使用此字段的值。*********

            count = wfobj.UpdateRecord(valObj);            //【2】通用单据信息赋值,与配置扩展信息同时保存到数据库。
            if (count < 0)
            {
                litWarn.Text = "保存基本信息失败。";//【2】保存信息失败,提示。。
                return;
            }
            if (hadDetail && hidDetailRows.Value != "")
            {
                int rows = int.Parse(hidDetailRows.Value);//【3】判断是否有明细信息,若有,保存明细信息到数据库。
                //formDetail.RECID = recid;
                wfobj.UpdateDetail(valObj, rows);
            }

            //jinsj  获取页面静态代码
            WFOBJECT_BLL wfbll  = new WFOBJECT_BLL(wf_obj_id, recid);
            WFRecordInfo recObj = new WFRecordInfo(valObj, true);
            WF_FORMBASE  objUp  = new WF_FORMBASE();
            objUp.RECID     = recid;
            objUp.HTML_TEXT = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);
            BLLTable <WF_FORMBASE> .Factory(conn).Update(objUp, WF_FORMBASE.Attribute.RECID);

            if (btn.ID.IndexOf("btnOK") != -1)//重新提交单据,进入审批流程
            {
                backUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + wf_obj_id + "&PROCID=" + 0 + "&RECID=" + recid;
            }
            Response.Redirect(backUrl);

            #endregion
        }
        else
        {
            #region//新建单据
            valObj.ADDTIME    = DateTime.Now;
            valObj.RECNAME    = "[" + userBase.StaffName + "]" + wfcname + valObj.ADDTIME.ToString("yyyyMMddHHmm");
            valObj.WFID       = wf_obj_id;
            valObj.PROCID     = 0;
            valObj.CHECK_INFO = "";
            valObj.CHECKERS   = "";
            valObj.STATUS     = WFEnum.RecStatus.Submit.ToString("d");
            //AgileFrame.Orm.PersistenceLayer.DAL.Base.Runtime_PersistenceLayer.RefreshRuntime_PersistenceLayer();
            count = wfobj.InsertRecord(valObj);//【1】通用单据信息赋值,与配置扩展信息同时保存到数据库
            if (count <= 0)
            {
                litWarn.Text = "单据信息保存失败,请联系管理员。";//【1】保存信息失败,提示
                return;
            }
            recid = valObj.RECID;
            if (hadDetail && hidDetailRows.Value != "")//【2】判断是否有明细信息,若有,保存明细信息到数据库。
            {
                int rows = int.Parse(hidDetailRows.Value);
                //formDetail.RECID = recid;
                wfobj.InsertDetail(valObj, rows);
            }

            //jinsj  获取页面静态代码
            WFOBJECT_BLL wfbll  = new WFOBJECT_BLL(wf_obj_id, recid);
            WFRecordInfo recObj = new WFRecordInfo(valObj, true);
            WF_FORMBASE  objUp  = new WF_FORMBASE();
            objUp.RECID     = recid;
            objUp.HTML_TEXT = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);
            BLLTable <WF_FORMBASE> .Factory(conn).Update(objUp, WF_FORMBASE.Attribute.RECID);

            if (btn.ID.IndexOf("btnOK") != -1)
            {
                string err = "";
                //bool ck = wfobj.WF_CheckStepChecker(recid, out err);
                bool ck = true;
                if (ck == false)
                {
                    ScriptHelper.AlertAndGo(Page, err + " 无法提交。", "FormList.aspx?mine=1&WFID=" + wf_obj_id);
                }
                else
                {
                    string chckerUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + wf_obj_id + "&RECID=" + recid;
                    Response.Redirect(chckerUrl, false);//【6】转到审批人选择页面
                }
            }
            else
            {
                if (recid > 0)
                {
                    Response.Redirect(backUrl);//【3】跳转到原来的页面。
                }
                else
                {
                    AgileFrame.Core.ScriptHelper.Alert(Page, "保存失败!");
                }
            }
            #endregion
        }
    }
Пример #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = "申请单列表";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wf_obj_id = int.Parse(Request["WFID"]);
            wfbll     = new WFOBJECT_BLL(wf_obj_id);
            if (wfbll.Base != null)
            {
                bllform = wfbll.FORM_BLL;
                wfobj   = wfbll.Base;
            }
            else
            {
                return;
            }
        }
        else
        {
            return;
        }
        appPath = WebHelper.GetAppPath();
        if (!IsPostBack)
        {
            staff_id = userBase.GetStaff().STAFF_ID;
            title    = wfbll.Base._WF_OBJ_NAME;
            ////////////
            WF_INFO cond = new WF_INFO();
            cond.STATUS = "1";
            List <WF_INFO> lst = BLLTable <WF_INFO> .Factory(conn).Select(new WF_INFO(), cond);

            List <WF_TYPE> lstType = BLLTable <WF_TYPE> .Factory(conn).Select(new WF_TYPE(), new WF_TYPE());

            for (int i = 0; i < lstType.Count; i++)
            {
                var lll = lst.Where(l => l._TYPE_ID == lstType[i]._TYPE_ID);
                litMenu.Text += "<li><a>" + lstType[i].TYPE_NAME + "</a><ul>";
                foreach (WF_INFO l in lll)
                {
                    litMenu.Text += "<li><a href='" + appPath + "WF/FORMList.aspx?mine=1&WFID=" + l.WFID + "' data=\"{key:'wf" + l.WFID + "mylist'}\">" + l.WFCNAME + "管理</a></li>";
                }
                litMenu.Text += "</ul></li>";
            }
            ////////////

            //如果没存在这个员工怎么处理,staff_id == 0

            ViewState["STAFF_ID"] = staff_id;
            #region                                                                  //默认属性初始化
            aspPager.CurrentPageIndex = 1;
            aspPager.ShowInputBox     = AgileFrame.Core.WebSystem.ShowInputBox.Auto; //.WebCtrls
            txtPageSize.Value         = "30";
            aspPager.PageSize         = 30;

            #endregion

            #region//数据初始化

            //txtSTATUS.Items.AddRange(FormHelper.GetListItem(WF_FORMBASE.Attribute.STATUS));
            #endregion

            BindList(1);
        }
    }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        theme = WebHelper.GetAppPath() + "Themes/" + BasePage._ThemeName;

        if (!string.IsNullOrEmpty(Request["RECID"]))
        {
            recid = decimal.Parse(Request["RECID"]);
        }
        else
        {
            Response.Write("�Ƿ����ӣ�");
            Response.End();
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            WF_OBJ_ID = int.Parse(Request["WFID"]);
        }
        if (!IsPostBack)
        {

            //try
            //{
            hideButton();

            ViewState["CHECK_INFO"] = "";
            StringBuilder sbDetail = new StringBuilder();
            if (recid > 0)
            {
                WF_FORMBASE valObj = BLLTable<WF_FORMBASE>.Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid);
                if (WF_OBJ_ID <= 0 && valObj != null)
                {
                    WF_OBJ_ID = valObj.WFID;
                }
                if (WF_OBJ_ID <= 0)
                {
                    return;
                }

                //WFINFO_EXD wfExd = new WFINFO_EXD(WFID, valObj.PROCID);
                //WFORM_EXD wform = wfExd.GetFORM();
                WFOBJECT_BLL wfbll = new WFOBJECT_BLL(WF_OBJ_ID, recid);
                litTitle.Text = valObj.RECNAME;
                WFRecordInfo recObj = new WFRecordInfo(valObj, true);
                if (recObj.HadRecord == false)
                {
                    Response.Write("��Ҫ�鿴�������¼�����ڣ�");
                    Response.End();
                    return;
                }
                PROCID = valObj.PROCID;
                title = valObj.RECNAME;
                //zlg
                if (MyDebugger.IsAttached)
                {
                    title += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|" + wfbll.FORM_BLL.DbTable.TB_NAME
                        + "|" + wfbll.WFExd.Base._FORM_TB + "|" + wfbll.WFExd.Base._FILE_TB;
                }
                //CHECK_INFO Ϊ�գ���������ġ�
                if (!string.IsNullOrEmpty(valObj.CHECK_INFO))
                {
                    ViewState["CHECK_INFO"] = valObj.CHECK_INFO;
                }
                else
                {
                    "".ToString();
                }
                if (sbDetail.Length > 1)
                {
                    ViewState["HadDetail"] = true;
                    litDetail.Text = sbDetail.ToString();
                }

                if ((valObj.STATUS == WFEnum.RecStatus.Submit.ToString("d")
                    || valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d")
                    || valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d")) && valObj.CSTAFF_ID == userBase.StaffID)
                {
                    btnSubmit.Enabled = true;
                    if (valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d")) {
                        btnSubmit.Text = "�����ύ";
                    }
                    if (valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d"))
                    {
                        btnSubmit.Text = "�������";
                    }
                }
                else
                {
                    btnSubmit.Enabled = false;
                }
                bool canStop = valObj.STATUS == WFEnum.RecStatus.Checking.ToString("d") && valObj.CSTAFF_ID == userBase.StaffID;

                btnStop.Enabled = canStop;

                if ((valObj.STATUS == WFEnum.RecStatus.Submit.ToString("d") || valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d") || valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d")) && valObj.CSTAFF_ID == userBase.StaffID)
                {
                    btnToEdit.Enabled = true;
                }
                else {
                    btnToEdit.Enabled = false;
                }

                if (valObj.PROCID > 0) {
                    ViewState["PROCID"] = valObj.PROCID;
                }

                //jinsj  ���ֶ��л�ȡHTML
                //litDetail.Text = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);// wform.HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                string status = valObj.STATUS;
                status = WFEnum.GetRecStatus(status);
                litDetail.Text = valObj.HTML_TEXT.Replace("!STATUS!", status);// wform.HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                if (!string.IsNullOrEmpty(valObj.ANNEX_FILE))
                {
                    string[] lstAnnex = valObj.ANNEX_FILE.Split(',');
                    string html = "";
                    foreach (string strAnnex in lstAnnex)
                    {
                        html += "<a href='" + WebHelper.GetAppPath() + strAnnex + "' target='_blank'>" + strAnnex.Substring(strAnnex.LastIndexOf("/") + 1) + "</a></br>";
                    }
                    //litAnnex.Text = "<dl class='row'><dt>������</dt><dd><a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a></dd></dl>";
                    string tempStr="<tr><td class='lbl'><label>Ա������</label></td><td colspan='4'><span>�»���</span></td></tr>";
                    tempStr = StringHelper.ReplaceNonCase(tempStr, "Ա����", "����");
                    litAnnex.Text = StringHelper.ReplaceNonCase(tempStr, "�»���", html);
                }

                bool hadPower = false;
                litWFPath.Text = wfbll.HtmlWFTextMapNew(recid, userBase.StaffID, ref hadPower);// wfExd.HtmlWFTextMap(recid, userBase.StaffID, ref hadPower);// WFHtml.ShowProcessTextMap(wfid, valObj.PROCID, recid, userBase.StaffID, ref hadPower);
                //��ȡ����ͼ
                htmlText = wfbll.GetStepPath(recid, ref  script);
                //zlg
                if (!hadPower)
                    hadPower = (userBase.UserName == "sys");

                btnToCheck.Enabled = hadPower && (valObj.STATUS == WFEnum.RecStatus.Checking.ToString("d") || valObj.STATUS == WFEnum.RecStatus.ReCheck.ToString("d"));// && (ViewState["PROCID"] != null);
                //Response.Write(hadPower.ToString());

            }
            //}
            //catch (Exception ex)
            //{
            //    litWarn.Text = ex.Message; txtREASON.Value = "00000000";
            //}

            if (Request["fromTab"] != null)
            {
                btnBack.Value = "�ر�";
            }

            if (Request["notice"] != null)
            {
                hideButton();
                btnBack.Value = "�ر�";
            }
        }
    }
Пример #14
0
        /// <summary>
        /// 操作物理表字段,插入或更新
        /// </summary>
        public int InsertOrUpdateField(TF_TB_FIELD field, string oldbame, ref string errMsg)
        {
            try
            {
                if (string.IsNullOrEmpty(oldbame))
                {
                    oldbame = field.FIELD_NAME;
                }
                int tb_id    = field.TB_ID;
                int FIELD_ID = field.FIELD_ID;
                if (FIELD_ID != 0)//修改的时候
                {
                    if (tb_id == 0)
                    {
                        errMsg = "物理数据库中新增字段失败!";
                        tb_id  = Convert.ToInt32(BLLTable <TF_TB_FIELD> .Factory(conn).GetOneValue(TF_TB_FIELD.Attribute.FIELD_ID,
                                                                                                   field.FIELD_ID, TF_TB_FIELD.Attribute.TB_ID));
                        field.TB_ID = tb_id;
                    }
                }
                TF_TABLE tbObj = null;
                if (tb_id != 0)//插入的时候
                {
                    errMsg = "物理数据库中编辑字段失败!";
                    tbObj  = BLLTable <TF_TABLE> .Factory(conn).GetRowData(TF_TABLE.Attribute.TB_ID, tb_id);
                }
                string tbname     = tbObj.TB_NAME;
                string colname    = field.FIELD_NAME;
                string sqlcoltype = field.DB_TYPE;//decimal(10,0)
                string msg        = null;

                //修改正式表字段名称或类型
                DataBaseField f1 = null;
                DataBaseTable t1 = null;
                if (DataBase.Factory(conn).TryGetValue(tbname, oldbame.Trim(), out t1, out f1))
                {
                    DataBaseField newf1 = f1.Clone();
                    if (field.IS_NULL == 0)
                    {
                        newf1.IsAllowNull = true;
                    }
                    newf1.FieldName = field.FIELD_NAME;
                    newf1.DataType  = FieldDataType.FromString(t1.DataBase.DataBaseType, sqlcoltype, true);
                    if (!newf1.Update(f1, true, ref msg))
                    {
                        errMsg += msg; return(0);
                    }
                }
                else//如果没有存在,则新增
                {
                    DataBaseField newf1 = new DataBaseField();
                    if (field.IS_NULL == 0)
                    {
                        newf1.IsAllowNull = true;
                    }
                    newf1.FieldName = field.FIELD_NAME;
                    newf1.DataType  = FieldDataType.FromString(t1.DataBase.DataBaseType, sqlcoltype, true);
                    if (!t1.AddField(newf1, ref msg))
                    {
                        errMsg += msg; return(0);
                    }
                    if (!DataBase.Factory(conn).TryGetValue(tbname, newf1.FieldName, out t1, out f1))
                    {
                        errMsg += "未存在";
                    }
                }

                #region                                       //流程对应流程的临时表对应的字段信息
                tbname = WFOBJECT_BLL.GetWFTempTBName(tbObj); //tbObj.WF_TB_NAME;
                //修改正式表字段名称或类型
                f1 = null;
                t1 = null;
                //CHG START 为空条件判断有误 jin-shenjian 2013/10/12
                //if (!string.IsNullOrEmpty(tbname) && DataBase.Factory(conn).TryGetValue(tbname, oldbame, out t1, out f1))
                if (!string.IsNullOrEmpty(tbname))
                {
                    if (DataBase.Factory(conn).TryGetValue(tbname, oldbame, out t1, out f1))
                    //CHG END 为空条件判断有误 jin-shenjian 2013/10/12
                    {
                        DataBaseField newf1 = f1.Clone();
                        if (field.IS_NULL == 0)
                        {
                            newf1.IsAllowNull = true;
                        }
                        newf1.FieldName = field.FIELD_NAME;
                        newf1.DataType  = FieldDataType.FromString(t1.DataBase.DataBaseType, sqlcoltype, true);
                        if (!newf1.Update(f1, true, ref msg))
                        {
                            errMsg += msg; return(0);
                        }
                    }
                    else//如果没有存在,则新增
                    {
                        DataBaseField newf1 = new DataBaseField();
                        if (field.IS_NULL == 0)
                        {
                            newf1.IsAllowNull = true;
                        }
                        newf1.FieldName = field.FIELD_NAME;
                        newf1.DataType  = FieldDataType.FromString(t1.DataBase.DataBaseType, sqlcoltype, true);
                        if (!t1.AddField(newf1, ref msg))
                        {
                            errMsg += msg; return(0);
                        }
                        if (!DataBase.Factory(conn).TryGetValue(tbname, newf1.FieldName, out t1, out f1))
                        {
                            errMsg += "未存在";
                        }
                    }
                }
                #endregion

                return(1);
            }
            catch (Exception ex)
            {
                errMsg = ex.ToString();
                return(0);
            }
        }
Пример #15
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        WFOBJECT_BLL wfobj = new WFOBJECT_BLL(wf_obj_id);
        Button btn = (Button)sender;//��ǰ�����İ�ť
        //WFINFO_EXD wfExd = new WFINFO_EXD(wfid,0);
        WFRecordInfo recInfo = new WFRecordInfo(wf_obj_id,recid);

        //FORM_BLL wform = wfobj.FORM_BLL;

        WF_FORMBASE valObj = new WF_FORMBASE();
        //WF_FORMDETAIL formDetail = null;
        #region//ͨ�û�����Ϣ��ֵ
        valObj.RECNO = txtRECNO.Value;//����Ψһ

        if (txtDEPT_ID.DEPT_ID != "")
        {
            valObj.DEPT_ID = Convert.ToString(txtDEPT_ID.DEPT_ID);

            HR_DEPT dept = BLLTable<HR_DEPT>.Factory(conn).GetRowData(HR_DEPT.Attribute.DEPT_ID, valObj.DEPT_ID);
            HR_ORG org = BLLTable<HR_ORG>.Factory(conn).GetRowData(HR_ORG.Attribute.ORG_ID, dept.ORG_ID);
            valObj.ORG_ID = org.ORG_ID;
            valObj.ORG_NAME = org.ORG_NAME;
            valObj.DEPT_NAME = dept.DEPT_NAME;
        }

        if (txtSTAFF_ID.Staff_ID > 0)
        {
            valObj.STAFF_ID = txtSTAFF_ID.Staff_ID;
            valObj.STAFF_NAME = txtSTAFF_ID.Staff_NAME;
        }

        if (txtCSTAFF_ID.Value != "")
        {
            valObj.CSTAFF_ID = Convert.ToDecimal(txtCSTAFF_ID.Value);
            valObj.CDEPT_ID = txtCDEPT_ID.Value;
            valObj.CDEPT_NAME = txtCDEPT_NAME.Value;

            HR_DEPT_STAFF cond = new HR_DEPT_STAFF();
            cond.STAFF_ID = valObj.CSTAFF_ID;
            Relation reldep = new Relation(HR_DEPT_STAFF.Attribute.DEPT_ID, HR_DEPT.Attribute.DEPT_ID);
            Relation relorg = new Relation(HR_ORG.Attribute.ORG_ID, HR_DEPT.Attribute.ORG_ID);

            List<Relation> lstrel = new List<Relation>();
            lstrel.Add(reldep);
            lstrel.Add(relorg);

            List<ITableImplement> lstcond = new List<ITableImplement>();
            lstcond.Add(cond);

            List<HR_ORG> lstOrg = BLLTable<HR_ORG>.Select(new HR_ORG(), lstrel, null, lstcond);

            if (lstOrg.Count > 0)
            {
                valObj.CORG_ID = lstOrg[0].ORG_ID;
                valObj.CORG_NAME = lstOrg[0].ORG_NAME;
            }

        }
        if (txtCSTAFF_NAME.Value != "")
        {
            valObj.CSTAFF_NAME = Convert.ToString(txtCSTAFF_NAME.Value);
        }
        valObj.EDITIME = DateTime.Now;
        valObj.NOTE = txtNOTE.Value;
        valObj.ANNEX_FILE = UpFilesBfSubmit1.GetUpFilesString();

        //if (hadDetail)//������ϸ�����������ϸ���ͨ����Ϣ���󲢸�ֵ
        //{
        //    formDetail = new WF_FORMDETAIL();
        //    formDetail.DEPT_ID = valObj.DEPT_ID;
        //    formDetail.DEPT_NAME = valObj.DEPT_NAME;
        //    formDetail.STAFF_ID = valObj.STAFF_ID;
        //    formDetail.STAFF_NAME = valObj.STAFF_NAME;
        //    formDetail.STATUS = "0";
        //    formDetail.DETAIL_NO = "0";
        //}
        #endregion
        if (recid > 0)
        {
            #region//�༭������Ϣ

            valObj.RECID = recid;
            valObj.WFID = wf_obj_id;
            valObj.FORM_PRI_ID = recInfo.Base.FORM_PRI_ID;//��չ���޸ı���ʹ�ô��ֶε�ֵ��*********

            count = wfobj.UpdateRecord(valObj);//��2��ͨ�õ�����Ϣ��ֵ����������չ��Ϣͬʱ���浽���ݿ⡣
            if (count < 0)
            {
                litWarn.Text = "���������Ϣʧ�ܡ�";//��2��������Ϣʧ�ܣ���ʾ����
                return;
            }
            if (hadDetail && hidDetailRows.Value != "")
            {
                int rows = int.Parse(hidDetailRows.Value);//��3���ж��Ƿ�����ϸ��Ϣ�����У�������ϸ��Ϣ�����ݿ⡣
                //formDetail.RECID = recid;
                wfobj.UpdateDetail(valObj, rows);
            }

            //jinsj  ��ȡҳ�澲̬����
            WFOBJECT_BLL wfbll = new WFOBJECT_BLL(wf_obj_id, recid);
            WFRecordInfo recObj = new WFRecordInfo(valObj, true);
            WF_FORMBASE objUp = new WF_FORMBASE();
            objUp.RECID = recid;
            objUp.HTML_TEXT = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);
            BLLTable<WF_FORMBASE>.Factory(conn).Update(objUp, WF_FORMBASE.Attribute.RECID);

            if (btn.ID.IndexOf("btnOK") != -1)//�����ύ���ݣ�������������
            {
                backUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + wf_obj_id + "&PROCID=" + 0 + "&RECID=" + recid;
            }
            Response.Redirect(backUrl);

            #endregion
        }
        else
        {
            #region//�½�����
            valObj.ADDTIME = DateTime.Now;
            valObj.RECNAME = "[" + userBase.StaffName + "]" + wfcname + valObj.ADDTIME.ToString("yyyyMMddHHmm");
            valObj.WFID = wf_obj_id;
            valObj.PROCID = 0;
            valObj.CHECK_INFO = "";
            valObj.CHECKERS = "";
            valObj.STATUS = WFEnum.RecStatus.Submit.ToString("d");
            //AgileFrame.Orm.PersistenceLayer.DAL.Base.Runtime_PersistenceLayer.RefreshRuntime_PersistenceLayer();
            count = wfobj.InsertRecord(valObj);//��1��ͨ�õ�����Ϣ��ֵ����������չ��Ϣͬʱ���浽���ݿ�
            if (count <= 0)
            {
                litWarn.Text = "������Ϣ����ʧ�ܣ�����ϵ����Ա��";//��1��������Ϣʧ�ܣ���ʾ
                return;
            }
            recid = valObj.RECID;
            if (hadDetail && hidDetailRows.Value != "")//��2���ж��Ƿ�����ϸ��Ϣ�����У�������ϸ��Ϣ�����ݿ⡣
            {
                int rows = int.Parse(hidDetailRows.Value);
                //formDetail.RECID = recid;
                wfobj.InsertDetail(valObj, rows);
            }

            //jinsj  ��ȡҳ�澲̬����
            WFOBJECT_BLL wfbll = new WFOBJECT_BLL(wf_obj_id, recid);
            WFRecordInfo recObj = new WFRecordInfo(valObj, true);
            WF_FORMBASE objUp = new WF_FORMBASE();
            objUp.RECID = recid;
            objUp.HTML_TEXT = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);
            BLLTable<WF_FORMBASE>.Factory(conn).Update(objUp, WF_FORMBASE.Attribute.RECID);

            if (btn.ID.IndexOf("btnOK") != -1)
            {
                string err = "";
                //bool ck = wfobj.WF_CheckStepChecker(recid, out err);
                bool ck = true;
                if (ck == false)
                {
                    ScriptHelper.AlertAndGo(Page, err + " �޷��ύ��", "FormList.aspx?mine=1&WFID=" + wf_obj_id);
                }
                else
                {
                    string chckerUrl = WebHelper.GetAppPath() + "WF/Checkers.aspx?Submit=1&WFID=" + wf_obj_id + "&RECID=" + recid;
                    Response.Redirect(chckerUrl, false);//��6��ת��������ѡ��ҳ��
                }
            }
            else
            {
                if (recid > 0)
                {
                    Response.Redirect(backUrl);//��3����ת��ԭ����ҳ�档
                }
                else
                {
                    AgileFrame.Core.ScriptHelper.Alert(Page, "����ʧ�ܣ�");
                }
            }
            #endregion
        }
    }
Пример #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region//����IJ�����Ϣ��ʼ��
        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;
            }
        }
    }