Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));

            ddlStatus.Items.Clear();
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusAll").ToString(), "0"));     //全部
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusWorking").ToString(), "1")); //在办
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusFinish").ToString(), "2"));  //结案
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusSuspend").ToString(), "3")); //挂起
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusAbolish").ToString(), "4")); //作废
            ddlStatus.SelectedIndex = 0;

            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            ViewState["BaseSql"] = "SELECT * from DMIS_SYS_PACK a ";
            //显示所有的数据
            ViewState["sql"] = ViewState["BaseSql"].ToString() + " order by a.f_createdate desc ";  //主办者
            GridViewBind();

            //btnSearch_Click(null, null);
        }
    }
Exemple #2
0
    protected void grv_RowEditing(object sender, GridViewEditEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;

        grv.EditIndex = e.NewEditIndex;
        grv.EditRowStyle.BackColor = System.Drawing.Color.FromName("#F7CE90");
        GridViewBind();

        int          tableID = Convert.ToInt16(Session["MainTableId"]);
        HtmlComboBox hcb厂站   = (HtmlComboBox)grv.Rows[e.NewEditIndex].FindControl("hcb厂站");
        //HtmlComboBox hcb联系人 = (HtmlComboBox)grv.Rows[e.NewEditIndex].FindControl("hcb联系人");
        DropDownList ddl类别  = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddl类别");
        DropDownList ddl记录人 = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddl记录人");

        //FillDropDownList.FillHtmlCombxByTable(ref hcb事件来源, "DMIS_SYS_DEPART", "NAME", "ID", "order_id", "TYPE='自动化记事'");
        FillDropDownList.FillHtmlCombxByTable(ref hcb厂站, "T_STATION_TYPE", "NAME", "TID", "NO");
        FillDropDownList.FillByTable(ref ddl类别, "T_ZDH_记事_类别参数", "名称", "TID", "序号");
        FillDropDownList.FillByTable(ref ddl记录人, "DMIS_VIEW_DEPART_MEMBER_ROLE", "MEMBER_NAME", "MEMBER_ID", "MEMBER_NAME", "ROLE_ID=4");

        int tid = Convert.ToInt16(grv.DataKeys[e.NewEditIndex].Value);

        GridViewEdit.GridViewEditing(ref grv, tableID, e.NewEditIndex, tid);
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            ddlStatus.Items.Clear();
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusWorking").ToString(), "1"));
            ddlStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkStatusSuspend").ToString(), "3"));
            ddlStatus.SelectedIndex = -1;
            //主办人员
            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,"
                     + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_FINISHED_TIME "
                     + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            //从办人员
            ViewState["OtherBaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,"
                    + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_FINISHED_TIME "
                    + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B,DMIS_SYS_MEMBERSTATUS C ";

            ViewState["sql"] = ViewState["BaseSql"].ToString() + " WHERE A.F_NO=B.F_PACKNO and A.F_STATUS='1' AND B.F_STATUS='1'";  //主办者
            ViewState["OtherSql"] = ViewState["OtherBaseSql"] + " WHERE A.F_NO=B.F_PACKNO AND B.F_NO=C.F_WORKFLOWNO and A.F_NO=C.F_PACKNO and A.F_STATUS='1' AND C.F_STATUS='1'";   //从办者
            GridViewBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        info = detail_info;
        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            lblFuncName.Text = GetLocalResourceObject("PageResource1.Title").ToString();

            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            btnDeleteItem.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");

            if (!btnAppendItem.Enabled)  //没有权限修改,则把步骤的编辑列隐藏
            {
                grvList.Columns[grvList.Columns.Count - 1].Visible = false;
            }

            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME", "TID", "ORDER_ID");

            if (Request["TID"] != "")
            {
                ViewState["DxpTID"] = Request["TID"];
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, Session["TableName"].ToString(), "TID=" + Request["TID"]);
                initGridView();
            }
            else
            {
                ViewState["DxpTID"] = null;
            }
        }
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            //只有主办者才能抽回
            ViewState["BaseSql"] = "SELECT A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,"
                                   + "B.F_FLOWNAME,B.f_receiver,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.f_preflowno "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";
            System.Text.StringBuilder BaseCond = new System.Text.StringBuilder();
            BaseCond.Append(" where A.F_NO=B.F_PACKNO and A.F_STATUS='1' and b.f_working=0 AND b.F_STATUS='1' AND b.f_sender='" + Session["MemberName"] + "'");
            BaseCond.Append(" order by B.f_receivedate desc");
            ViewState["sql"] = ViewState["BaseSql"].ToString() + BaseCond.ToString();
            GridViewBind();
        }
    }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-") + "01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");
            initPackType();

            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,"
                                   + "B.F_FLOWNAME,B.F_SENDER,B.F_SENDDATE,B.F_RECEIVER,B.f_planday,B.f_receivedate,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            System.Text.StringBuilder BaseCond = new System.Text.StringBuilder();
            BaseCond.Append(" WHERE A.F_NO=B.F_PACKNO AND B.F_STATUS='1' and A.F_STATUS='" + ddlPackStatus.Text + "'");
            BaseCond.Append(" and A.f_packtypeno in(" + ViewState["packTypeIds"].ToString() + ")");
            BaseCond.Append(" order by B.F_SENDDATE desc");
            ViewState["sql"] = ViewState["BaseSql"].ToString() + BaseCond.ToString();
            GridViewBind();
            ViewState["refreshPage"] = 0;
        }
        else
        {
            if (ViewState["refreshPage"].ToString() != refreshPage.Value)  //要求页面刷新
            {
                btnSearch_Click(null, null);
                ViewState["refreshPage"] = refreshPage.Value;
            }
        }
    }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            //主办人员
            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,"
                                   + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_INCEPT_TIME "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            //从办人员
            ViewState["OtherBaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,"
                                        + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,C.f_workflowno as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_INCEPT_TIME "
                                        + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B,DMIS_SYS_MEMBERSTATUS C ";

            //针对处理实体类型是岗位时,先构造条件
            System.Text.StringBuilder entiCond = new System.Text.StringBuilder();
            string[] roles = Session["RoleIDs"].ToString().Split(',');
            string   temp;
            for (int i = 0; i < roles.Length; i++)
            {
                temp = "," + roles[i] + ",";
                entiCond.Append("INSTR(',' || b.enti_id || ',','" + temp + "')>0 or ");
            }

            System.Text.StringBuilder BaseCond  = new System.Text.StringBuilder();
            System.Text.StringBuilder OtherCond = new System.Text.StringBuilder();

            BaseCond.Append(" WHERE A.F_NO=B.F_PACKNO and A.F_STATUS='1' and B.F_STATUS='1'"   //从办人员的状态不显示在待办中
                            + " AND ((B.F_RECEIVER='" + Session["MemberName"] + "' and B.F_WORKING=0) or "
                            + "(b.enti_type='0' and (b.f_receiver='' or b.f_receiver is null) and (" + entiCond.Remove(entiCond.Length - 3, 3).ToString() + "))) ");

            OtherCond.Append(" where A.F_NO=B.F_PACKNO and A.F_NO=C.F_PACKNO and b.F_NO=c.f_workflowno and A.F_STATUS='1' and c.F_STATUS='1' and "
                             + "B.F_WORKING=0 and c.F_RECEIVER='" + Session["MemberName"].ToString() + "' ");       //处理从办人员

            BaseCond.Append(" order by B.F_SENDDATE desc");
            OtherCond.Append(" order by B.F_SENDDATE desc");

            ViewState["sql"]      = ViewState["BaseSql"].ToString() + BaseCond.ToString(); //主办者
            ViewState["OtherSql"] = ViewState["OtherBaseSql"] + OtherCond.ToString();      //从办者
            GridViewBind();
        }
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            if (Request["packTypeID"] != null && Request["packTypeID"] != "")
            {
                ViewState["packTypeID"] = Request["packTypeID"];
            }
            if (Request["linkID"] != null && Request["linkID"] != "")
            {
                ViewState["linkID"] = Request["linkID"];
            }


            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-") + "01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");
            FillDropDownList.FillHtmlCombxByTable(ref hcbMember, "dmis_sys_member", "name", "code", "depart_id,order_id");

            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,A.SUBPACKNO,"
                                   + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_FINISHED_TIME "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            System.Text.StringBuilder BaseCond = new System.Text.StringBuilder();

            BaseCond.Append(" WHERE A.F_NO=B.F_PACKNO and A.F_STATUS='1' AND B.F_STATUS='1' AND B.F_WORKING=1");

            if (ViewState["packTypeID"] != null)
            {
                BaseCond.Append(" and A.f_packtypeno = " + ViewState["packTypeID"].ToString());
            }

            if (ViewState["linkID"] != null)
            {
                BaseCond.Append(" and b.f_flowno = " + ViewState["linkID"].ToString());
            }

            BaseCond.Append(" order by B.f_receivedate desc");

            ViewState["sql"] = ViewState["BaseSql"].ToString() + BaseCond.ToString();

            GridViewBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!Page.IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            FillDropDownList.FillByTable(ref ddlStation, "DMIS_SYS_STATION", "NAME", "TID", "ORDER_ID");
            ddlStation.SelectedIndex = 1;
            ddlStation_SelectedIndexChanged(null, null);
        }
    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;
        if (!Page.IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = GetLocalResourceObject("PageResource1.Title").ToString();
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            FillDropDownList.FillByTable(ref ddlStation, "DMIS_SYS_STATION", "NAME", "TID", "ORDER_ID");

            ViewState["BaseSql"] = "select * from " + Session["TableName"] + "";
            //模块的查询条件,一般是按年、月、日查询;此变量在“检索”按钮中修改,在此初始化。
            ViewState["BaseQuery"] = "1=1";
            if (Session["Orders"] == null)   //平台中没有设置排序条件
            {
                ViewState["sql"] = ViewState["BaseSql"] + " where " + ViewState["BaseQuery"];
            }
            else
            {
                ViewState["sql"] = ViewState["BaseSql"] + " where " + ViewState["BaseQuery"] + " order by " + Session["Orders"];
            }
            GridViewBind();
            Session["CustomOrder"] = null;
        }
        else
        {
            //自定义排序页面关闭后,刷新GridView
            if (Session["CustomOrder"] != null && ViewState["sql"].ToString().IndexOf(Session["CustomOrder"].ToString()) < 0)
            {
                if (ViewState["BaseQuery"] != null)  //页面自带查询条件
                {
                    ViewState["sql"] = ViewState["BaseSql"] + " where " + ViewState["BaseQuery"] + " order by " + Session["CustomOrder"];
                }
                else   //无查询条件
                {
                    ViewState["sql"] = ViewState["BaseSql"] + " order by " + Session["CustomOrder"];
                }
                GridViewBind();
            }
        }
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            Session["sended"] = null;   //防止第二次添加时,不弹出派工任务窗口(AssignTaskWindow.aspx)

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(DateTime.Now);
            //wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("dd-MM-yyyy")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            //主办人员
            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,A.SUBPACKNO,A.F_STATUS as InstanceStatus,"
                                   + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_FINISHED_TIME "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            //从办人员
            ViewState["OtherBaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,A.PLAN_STARTTIME,A.PLAN_ENDTIME,A.SUBPACKNO,A.F_STATUS as InstanceStatus,"
                                        + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,C.f_workflowno as F_CurWorkFlowNo,A.F_MSG,B.F_LAST_FINISHED_TIME "
                                        + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B,DMIS_SYS_MEMBERSTATUS C ";


            System.Text.StringBuilder BaseCond  = new System.Text.StringBuilder();
            System.Text.StringBuilder OtherCond = new System.Text.StringBuilder();

            BaseCond.Append(" WHERE A.F_NO=B.F_PACKNO and (A.F_STATUS='1' or A.F_STATUS='暂缓') and B.F_RECEIVER='" + Session["MemberName"] + "' AND B.F_STATUS='1' AND B.F_WORKING=1");
            OtherCond.Append(" WHERE A.F_NO=B.F_PACKNO AND B.F_NO=C.F_WORKFLOWNO and A.F_NO=C.F_PACKNO and (A.F_STATUS='1' or A.F_STATUS='暂缓') "
                             + " AND C.F_RECEIVER='" + Session["MemberName"] + "' AND C.F_STATUS='1'"); //AND B.F_WORKING=1

            BaseCond.Append(" order by B.f_receivedate desc");
            OtherCond.Append(" order by B.f_receivedate desc");

            ViewState["sql"]      = ViewState["BaseSql"].ToString() + BaseCond.ToString();
            ViewState["OtherSql"] = ViewState["OtherBaseSql"] + OtherCond.ToString();   //从办者

            GridViewBind();
        }
    }
Exemple #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request["RoleID"] == null || Request["RoleID"] == "")
         {
             tdMessage.InnerText = "岗位ID没有传递!";
             return;
         }
         if (Request["Object"] == null || Request["Object"] == "")
         {
             tdMessage.InnerText = "人员控件没有传递!";
             return;
         }
         ViewState["Object"] = Request["Object"];
         FillDropDownList.FillByTable(ref ddlMemberName, "DMIS_VIEW_DRPART_MEMBER_ROLE", "MEMBER_NAME", "MEMBER_ID", "MEMBER_NAME", "ROLE_ID in(" + Request["RoleID"] + ")");
     }
 }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-") + "01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            ddlPackStatus.Items.Clear();
            ddlPackStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkReassigned").ToString(), "2"));    //已改派
            ddlPackStatus.Items.Add(new ListItem(GetGlobalResourceObject("WebGlobalResource", "WkNoReassigned").ToString(), "1"));  //未改派
            ddlPackStatus.SelectedIndex = 1;

            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,"
                                   + "B.F_FLOWNAME,B.F_SENDER,B.F_SENDDATE,B.F_RECEIVER,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            System.Text.StringBuilder BaseCond = new System.Text.StringBuilder();
            BaseCond.Append(" WHERE A.F_NO=B.F_PACKNO and A.F_STATUS='1' AND B.F_STATUS='1'");

            //未改派
            BaseCond.Append(" and A.F_NO not in(select PACKNO from DMIS_SYS_WK_OPT_HISTORY where OPT_TYPE='改派')");
            BaseCond.Append(" order by B.F_SENDDATE desc");
            ViewState["sql"] = ViewState["BaseSql"].ToString() + BaseCond.ToString();
            GridViewBind();

            ViewState["refreshPage"] = 0;
        }
        else
        {
            if (ViewState["refreshPage"].ToString() != refreshPage.Value)  //要求页面刷新
            {
                btnSearch_Click(null, null);
                ViewState["refreshPage"] = refreshPage.Value;
            }
        }
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            //主办人员
            ViewState["BaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,"
                                   + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,B.F_PLANDAY,b.f_workday,b.f_finishdate "
                                   + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B ";

            //从办人员
            ViewState["OtherBaseSql"] = "SELECT distinct A.F_NO,A.F_PACKNAME,A.F_DESC,A.F_CREATEMAN,"
                                        + "B.F_FLOWNAME,B.f_receiver,B.f_receivedate,B.F_SENDER,B.F_SENDDATE,B.F_FLOWNO,A.F_PACKTYPENO,B.F_NO as F_CurWorkFlowNo,A.F_MSG,c.F_PLANDAY,c.f_workday,b.f_finishdate "
                                        + " FROM DMIS_SYS_PACK A,DMIS_SYS_WORKFLOW B,DMIS_SYS_MEMBERSTATUS C ";

            System.Text.StringBuilder BaseCond  = new System.Text.StringBuilder();
            System.Text.StringBuilder OtherCond = new System.Text.StringBuilder();

            BaseCond.Append(" WHERE A.F_NO=B.F_PACKNO AND (B.F_STATUS='2' or B.F_STATUS='3') AND B.F_RECEIVER='"
                            + Session["MemberName"] + "' and A.F_STATUS='1'");
            OtherCond.Append(" where A.F_NO=B.F_PACKNO and A.F_NO=C.F_PACKNO and b.F_NO=c.f_workflowno and A.F_STATUS='1' and (C.F_STATUS='2' or C.F_STATUS='3') and "
                             + "c.F_RECEIVER='" + Session["MemberName"].ToString()); //处理从办人员

            BaseCond.Append(" order by B.F_SENDDATE desc");
            OtherCond.Append(" order by B.F_SENDDATE desc");

            ViewState["sql"]      = ViewState["BaseSql"].ToString() + BaseCond.ToString();
            ViewState["OtherSql"] = ViewState["OtherBaseSql"] + OtherCond.ToString();   //从办者

            GridViewBind();
        }
    }
Exemple #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tdPageMessage = tdMessage;

        if (!IsPostBack)
        {
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            FillDropDownList.FillByTable(ref ddl对应业务ID, "DMIS_SYS_PACKTYPE", "F_NAME", "F_NO");
            if (Request["TID"] != "")
            {
                FillDropDownList.FillByTable(ref ddl任务启动人, "DMIS_SYS_MEMBER", "NAME", "ID");
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, "DMIS_SYS_WK_CYCLE_TASK_PARA", "TID=" + Request["TID"]);
            }
            else
            {
                ddl对应业务ID_SelectedIndexChanged(null, null);
            }
            ddl周期类型_SelectedIndexChanged(null, null);
        }
    }
Exemple #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();

            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy") + "-01-01"));
            wdlEnd.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")));
            FillDropDownList.FillByTable(ref ddlSTATION, "DMIS_SYS_STATION", "NAME");

            ViewState["BaseSql"] = "select * from DMIS_SYS_PACK A";
            ViewState["sql"]     = ViewState["BaseSql"].ToString() + " WHERE A.F_STATUS='2' order by A.f_archivedate desc";
            GridViewBind();
        }
    }
Exemple #17
0
    //要填充DropDownList的值,无法使用祖先的代码
    protected override void grvRef_RowEditing(object sender, GridViewEditEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;

        grv.EditIndex = e.NewEditIndex;
        grv.EditRowStyle.BackColor = System.Drawing.Color.FromName("#F7CE90");
        GridViewBind();

        int          tableID     = Convert.ToInt16(Session["MainTableId"]);
        DropDownList ddlCATEGORY = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddlCATEGORY");

        FillDropDownList.FillByTable(ref ddlCATEGORY, "T_STATION_RUNNING_LOG_TYPE", "NAME", "TID", "ORDER_ID");

        int tid = Convert.ToInt16(grv.DataKeys[e.NewEditIndex].Value);

        GridViewEdit.GridViewEditing(ref grv, tableID, e.NewEditIndex, tid);
    }
Exemple #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            btnJIAOBAN.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "Common004").ToString() + "');");
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");

            object obj;
            //为了突出哪个变电站,功能名要加变电站名称
            if (Session["Culture"] == null || Session["Culture"].ToString() == "zh-CN")
            {
                _sql = "select NAME from DMIS_SYS_DEPART where ID=" + Session["DepartID"].ToString();
            }
            else
            {
                _sql = "select OTHER_LANGUAGE_DESCR from DMIS_SYS_DEPART where ID=" + Session["DepartID"].ToString();
            }
            obj = DBOpt.dbHelper.ExecuteScalar(_sql);
            if (obj != null)
            {
                lblFuncName.Text += "[" + obj.ToString() + "]";
            }

            FillDropDownList.FillByTable(ref ddlWEATHER, "DMIS_SYS_WEATHER", "NAME", "TID");
            FillDDY();
            FillShift();
            if (ddlQueryShift.Items.Count < 1)
            {
                //JScript.Alert("还没有设置调度值班班次信息,请联系系统管理员!");
                return;
            }

            DateTime st;
            //没有权限修改交接班记录的人只能查看数据,不能执行下面查找或生成当前班次的记录。
            if (!SetRight.IsModify(Session["FuncID"].ToString(), "frmSTATION_SHIFT.aspx", "btnSave", Session["MemberID"].ToString()))
            {
                return;
            }

            if (SetRight.IsAdminitrator(Session["MemberID"].ToString()))
            {
                btnAdd.Visible    = true;
                btnDelete.Visible = true;
            }
            int days = 1;                       //没有设置值班天数,则为1
            if (ddlQueryShift.Items.Count == 1) //值班参数表只有一条记录时,则要判断值班天数,多条记录则为1
            {
                obj = DBOpt.dbHelper.ExecuteScalar("select SHIFT_DAYS from T_STATION_SHIFT_PARA where STATION_ID=" + Session["DepartID"].ToString());
                if (obj != null)  //得到值班天数
                {
                    days = Convert.ToInt16(obj);
                }
            }
            else
            {
                days = 1;
            }


            uint tid = 1;

            /***************************************
             * 判断当前班次的规则如下:
             * 1、首先找flag为1(正在当班)的记录,没有找到则以当前日期和第一个班次新建当前班次
             * 2、如果有flag为1(正在当班)的记录,则再判断此当班日期是否在今天以前的days内之内;如果不是,则把此表内条件flag=1(正值)的记录的列flag的值设置为0(已值),再以当前日期和第一个班次新建当前班次;
             * 3、flag为1(正在当班)的记录的当班日期在今天以前的days天之内,则当前班次就是此班次。
             *
             **************************************/
            _sql = "select TID,DATEM,SHIFT from T_STATION_SHIFT where flag=1 and STATION_ID=" + Session["DepartID"].ToString() + " order by DATEM desc";
            DataTable dt = DBOpt.dbHelper.GetDataTable(_sql);
            if (dt.Rows.Count > 0)                                                                                            //找到了当班的记录
            {
                st = (Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"))).AddDays(-days);                                //值班天数之前的00:00,用于下列比较
                if ((DateTime)dt.Rows[0]["DATEM"] < st)                                                                       //当前班次在值班天数以前,则新建班次
                {
                    _sql = "update T_STATION_SHIFT set flag=0 where flag=1 and STATION_ID=" + Session["DepartID"].ToString(); //先把当班记录状态设置为已交班
                    DBOpt.dbHelper.ExecuteSql(_sql);
                    //查找当日的第一个班次的记录在数据库中是否存在
                    obj = DBOpt.dbHelper.ExecuteScalar("select count(*) from T_STATION_SHIFT where to_char(DATEM,'YYYYMMDD')='" + DateTime.Now.ToString("yyyyMMdd") + "' and SHIFT=" + ddlQueryShift.Items[0].Value + " and STATION_ID=" + Session["DepartID"].ToString());
                    if (obj == null || Convert.ToInt16(obj) == 0)   //数据库中没有当日的第一个班次的记录
                    {
                        tid  = DBOpt.dbHelper.GetMaxNum("T_STATION_SHIFT", "TID");
                        obj  = DBOpt.dbHelper.ExecuteScalar("select SHIFT_STARTTIME,to_char(SHIFT_STARTTIME,'HH24:MI') ss from T_STATION_SHIFT_PARA where STATION_ID=" + Session["DepartID"].ToString() + " order by ss");
                        st   = (DateTime)obj;
                        _sql = "insert into T_STATION_SHIFT(TID,DATEM,SHIFT,FLAG,STATION_ID) values(" + tid + ",TO_DATE('"
                               + DateTime.Now.ToString("yyyy-MM-dd") + st.ToString(" HH:mm") + "','YYYY-MM-DD HH24:MI')," + ddlQueryShift.Items[0].Value + "," + ddlQueryShift.Items[0].Value + "," + Session["DepartID"].ToString() + ")";
                        if (DBOpt.dbHelper.ExecuteSql(_sql) < 0)
                        {
                            JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "Common001"));
                            MultiView1.Visible = false;
                            return;
                        }
                    }
                    else //数据库中有当日的第一个班次的记录,则把状态设置为当班状态(为1)
                    {
                        _sql = "update T_STATION_SHIFT set flag=1 where to_char(DATEM,'YYYYMMDD')='" + DateTime.Now.ToString("yyyyMMdd") + "' and SHIFT=" + ddlQueryShift.Items[0].Value + " and STATION_ID=" + Session["DepartID"].ToString();
                        if (DBOpt.dbHelper.ExecuteSql(_sql) != 1)
                        {
                            JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "Common002"));
                            MultiView1.Visible = false;
                            return;
                        }
                        tid = Convert.ToUInt16(DBOpt.dbHelper.ExecuteScalar("select TID from T_STATION_SHIFT where to_char(DATEM,'YYYYMMDD')='" + DateTime.Now.ToString("yyyyMMdd") + "' and SHIFT=" + ddlQueryShift.Items[0].Value + " and STATION_ID=" + Session["DepartID"].ToString()));
                    }
                    Session["CurrentShiftDate"]   = DateTime.Now.ToString("yyyyMMdd");
                    Session["CurrentShift"]       = 1;
                    ViewState["CurrentShiftDate"] = DateTime.Now.ToString("yyyy-MM-dd");
                }
                else  //当前班次是昨天以后,则以此作为当前班次
                {
                    Session["CurrentShiftDate"] = ((DateTime)dt.Rows[0][1]).ToString("yyyyMMdd");
                    Session["CurrentShift"]     = dt.Rows[0][2];
                    tid = Convert.ToUInt16(dt.Rows[0][0]);
                    ViewState["CurrentShiftDate"] = ((DateTime)dt.Rows[0][1]).ToString("yyyy-MM-dd");
                }
            }
            else   //没有当前班次,则以当日的第一个班次新建当前班次
            {
                obj = DBOpt.dbHelper.ExecuteScalar("select count(*) from T_STATION_SHIFT where to_char(DATEM,'YYYYMMDD')='" + DateTime.Now.ToString("yyyyMMdd") + "' and SHIFT=" + ddlQueryShift.Items[0].Value + " and STATION_ID=" + Session["DepartID"].ToString());
                if (obj == null || Convert.ToInt16(obj) == 0)   //数据库中没有当日的第一个班次的记录
                {
                    tid = DBOpt.dbHelper.GetMaxNum("T_STATION_SHIFT", "TID");

                    obj  = DBOpt.dbHelper.ExecuteScalar("select SHIFT_STARTTIME,to_char(SHIFT_STARTTIME,'HH24:MI') ss from T_STATION_SHIFT_PARA where STATION_ID=" + Session["DepartID"].ToString() + " order by ss");
                    st   = (DateTime)obj;
                    _sql = "insert into T_STATION_SHIFT(TID,DATEM,SHIFT,FLAG,STATION_ID,CURRENT_SHIFT_MAN1) values(" + tid + ",TO_DATE('" + DateTime.Now.ToString("yyyy-MM-dd") + st.ToString(" HH:mm") + "','YYYY-MM-DD HH24:MI')"
                           + "," + ddlQueryShift.Items[0].Value + ",1," + Session["DepartID"].ToString() + ",'" + Session["MemberName"].ToString() + "')";
                    if (DBOpt.dbHelper.ExecuteSql(_sql) < 0)
                    {
                        JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "Common001"));
                        MultiView1.Visible = false;
                        return;
                    }
                }
                else //数据库中有当日的第一个班次的记录,把其状态改为当值(为1)
                {
                    _sql = "update T_STATION_SHIFT set flag=1 where to_char(DATEM,'YYYYMMDD')='" + DateTime.Now.ToString("yyyyMMdd") + "' and SHIFT=" + ddlQueryShift.Items[0].Value + " and STATION_ID=" + Session["DepartID"].ToString();
                    if (DBOpt.dbHelper.ExecuteSql(_sql) != 1)
                    {
                        JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "Common002"));
                        MultiView1.Visible = false;
                        return;
                    }
                    tid = Convert.ToUInt16(DBOpt.dbHelper.ExecuteScalar("select TID from T_STATION_SHIFT where to_char(DATEM,'YYYYMMDD')='" + DateTime.Now.ToString("yyyyMMdd") + "' and SHIFT=" + ddlQueryShift.Items[0].Value + " and STATION_ID=" + Session["DepartID"].ToString()));
                }
                Session["CurrentShiftDate"]   = DateTime.Now.ToString("yyyyMMdd");
                Session["CurrentShift"]       = ddlQueryShift.Items[0].Value;
                ViewState["CurrentShiftDate"] = DateTime.Now.ToString("yyyy-MM-dd");
            }


            CustomControlFill.CustomControlFillByTableAndWhere(this.Page, "T_STATION_SHIFT", "TID=" + tid);
            wdlQueryDate.setTime(Convert.ToDateTime(ViewState["CurrentShiftDate"]));
            ddlQueryShift.SelectedIndex = ddlQueryShift.Items.IndexOf(ddlQueryShift.Items.FindByValue(Session["CurrentShift"].ToString()));
            btnQuery_Click(null, null);
        }
        else
        {
            //btnQuery_Click(null, null);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["sended"] != null)
        {
            if (Session["sended"].ToString() == "1" && ViewState["BackUrl"] != null)
            {
                Response.Redirect(ViewState["BackUrl"].ToString());
            }
        }

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = GetLocalResourceObject("PageResource1.Title").ToString();

            if (Request["BackUrl"] != null)
            {
                ViewState["BackUrl"] = Server.UrlDecode(Request["BackUrl"]);
            }
            else
            {
                ViewState["BackUrl"] = null;
            }

            object obj = null;

            if (Request["PackTypeNo"] != null && Request["CurLinkNo"] != null) //从工作流界面打开,肯定有PackTypeNo和CurLinkNo
            {
                ViewState["PackTypeNo"] = Request["PackTypeNo"];
                ViewState["CurLinkNo"]  = Request["CurLinkNo"];
                if (Request["PackNo"] != null)
                {
                    ViewState["PackNo"] = Request["PackNo"];
                    _sql = "select f_recno from DMIS_SYS_DOC where f_packno=" + Request["PackNo"] + " and f_linkno=" + Request["CurLinkNo"];
                    ViewState["RecNo"] = DBOpt.dbHelper.ExecuteScalar(_sql);
                    if (ViewState["RecNo"] == null)
                    {
                        //JScript.Alert("业务表的记录号,请联系管理员!");
                        return;
                    }
                }
                else
                {
                    ViewState["RecNo"] = -1;
                }

                if (Request["CurWorkFlowNo"] != null)
                {
                    ViewState["CurWorkFlowNo"] = Request["CurWorkFlowNo"];
                }
            }
            else    //从业务表查询界面打开,有PackTypeNo、TableName、RecNo
            {
                ViewState["PackTypeNo"] = Request["PackTypeNo"];
                ViewState["TableName"]  = Request["TableName"];
                ViewState["RecNo"]      = Request["RecNo"];
                _sql = "select F_PACKNO from DMIS_SYS_DOC where f_tablename='" + Request["TableName"].ToString() + "' and f_recno=" + ViewState["RecNo"].ToString();
                ViewState["PackNo"] = DBOpt.dbHelper.ExecuteScalar(_sql);
                if (ViewState["PackNo"] != null)
                {
                    obj = DBOpt.dbHelper.ExecuteScalar("select f_no from DMIS_SYS_WORKFLOW where f_packno=" + ViewState["PackNo"].ToString() + " and f_status='1'");
                    if (obj != null)  //在办的业务
                    {
                        ViewState["CurWorkFlowNo"] = obj;
                    }
                    else
                    {
                        _sql = "select max(f_no) from DMIS_SYS_WORKFLOW where f_packno=" + ViewState["PackNo"].ToString() + " and f_status='2'";   //归档的业务,最后的环节
                        ViewState["CurWorkFlowNo"] = DBOpt.dbHelper.ExecuteScalar(_sql);
                    }
                    ViewState["CurLinkNo"] = DBOpt.dbHelper.ExecuteScalar("select f_flowno from DMIS_SYS_WORKFLOW where f_no=" + ViewState["CurWorkFlowNo"].ToString());
                }
                else    //查看历史数据,不能操作任何
                {
                    btnSave.Enabled      = false;
                    btnSaveClose.Enabled = false;
                    btnSend.Enabled      = false;
                    btnWithdraw.Enabled  = false;
                    btnAccept.Enabled    = false;
                    CustomControlFill.CustomControlFillByTableAndWhere(this.Page, "T_ZDH_DEVICE_FAULT", "TID=" + ViewState["RecNo"].ToString());
                    return;
                }
            }

            //找当前环节对应的文档
            _sql = "select a.f_no,a.f_name,a.f_tablename,a.f_reportfile from dmis_sys_doctype a,DMIS_SYS_WK_LINK_DOCTYPE b where a.f_no=b.F_DOCTYPENO and a.f_packtypedef=1 and b.f_packtypeno="
                   + ViewState["PackTypeNo"].ToString() + " and b.F_LINKNO=" + ViewState["CurLinkNo"].ToString();
            DataTable temp = DBOpt.dbHelper.GetDataTable(_sql);
            if (temp == null || temp.Rows.Count < 1)
            {
                JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkNoDoc").ToString());  //"没有找到对应的文档!"
                return;
            }
            else
            {
                ViewState["DocTypeNo"]   = temp.Rows[0][0]; //文档编号
                ViewState["DocTypeName"] = temp.Rows[0][1]; //文档名称
                ViewState["TableName"]   = temp.Rows[0][2]; //文档对应的数据库表名称
                ViewState["REPORT_ID"]   = temp.Rows[0][3]; //报表编号
            }

            int counts;
            btnSave.Enabled      = false;
            btnSaveClose.Enabled = false;
            btnSend.Enabled      = false;
            btnWithdraw.Enabled  = false;
            btnAccept.Enabled    = false;

            btnWithdraw.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "WkConfirmWithdraw").ToString() + "');"); //确定要退回到上一步?
            btnAccept.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "WkConfirmAccept").ToString() + "');");     //确定要接单?

            if (SetRight.IsAdminitrator(Session["MemberID"].ToString()))                                                                                      //管理员开放本业务类型所涉及的所有业务表修改数据的权限,但不能发送、回退。不参与流转的处理
            {
                btnSave.Enabled      = true;
                btnSaveClose.Enabled = true;
                _sql = "select f_tablename from dmis_sys_doctype where f_packtypeno=" + ViewState["PackTypeNo"].ToString();  //本业务所涉及到的所有业务表
                DataTable AllTables = DBOpt.dbHelper.GetDataTable(_sql);
                for (int i = 0; i < AllTables.Rows.Count; i++)
                {
                    WebWorkFlow.SetAllWebControlEnable(this.Page, Convert.ToInt16(ViewState["PackTypeNo"]), AllTables.Rows[i][0].ToString());
                }
            }
            else
            {
                if (Session["Oper"] != null)
                {
                    if (Convert.ToInt16(Session["Oper"]) > 0)  //有权限修改
                    {
                        WebWorkFlow.SetWebControlRight(this.Page, Session["RoleIDs"].ToString(), Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["CurLinkNo"]), ViewState["TableName"].ToString());
                        btnSave.Enabled      = true;
                        btnSaveClose.Enabled = true;
                        btnSend.Enabled      = true;
                        btnWithdraw.Enabled  = true;

                        //如果是最后一步,则弹出是否要归档的窗口
                        string sMainer = "";
                        if (ViewState["CurWorkFlowNo"] != null)
                        {
                            obj = DBOpt.dbHelper.ExecuteScalar("select F_RECEIVER from DMIS_SYS_WORKFLOW where F_NO=" + ViewState["CurWorkFlowNo"]);
                        }
                        if (obj != null)
                        {
                            sMainer = obj.ToString();
                        }
                        else
                        {
                            btnSend.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "WkConfirmSubmit").ToString() + "');");  //确定要提交到下一步?(新建业务时。)
                        }
                        if (sMainer == Session["MemberName"].ToString())
                        {
                            int iCat = -1;
                            if (ViewState["CurLinkNo"] != null)
                            {
                                obj = DBOpt.dbHelper.ExecuteScalar("SELECT F_FLOWCAT FROM DMIS_SYS_FLOWLINK WHERE F_NO=" + ViewState["CurLinkNo"]);
                                if (obj != null)
                                {
                                    iCat = Convert.ToInt16(obj);
                                }
                            }

                            if (iCat == 2)
                            {
                                btnSend.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "WkConfirmFinish").ToString() + "');");//该项目已办理完成,是否要归档?
                            }
                            else
                            {
                                btnSend.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "WkConfirmSubmit").ToString() + "');");//确定要提交到下一步
                            }
                        }
                    }
                    else  //待办的状态下处理接单按钮
                    {
                        int flag = -1;  //判断是否接单
                        obj = DBOpt.dbHelper.ExecuteScalar("select f_working from DMIS_SYS_WORKFLOW where F_NO=" + ViewState["CurWorkFlowNo"]);
                        if (obj != null)
                        {
                            flag = Convert.ToInt16(obj);
                        }
                        if (flag == 0)   //待办状态
                        {
                            string zbr = "";
                            obj = DBOpt.dbHelper.ExecuteScalar("select f_receiver from DMIS_SYS_WORKFLOW where F_NO=" + ViewState["CurWorkFlowNo"]);
                            if (obj != null)
                            {
                                zbr = obj.ToString().Trim();
                            }
                            if (zbr == "" || zbr == Session["MemberName"].ToString())
                            {
                                btnAccept.Enabled = true;
                            }
                        }
                        else if (flag == 1)    //从办人员点击进入状态,只能提交
                        {
                            if (WebWorkFlow.IsCongBanRen(ViewState["PackNo"].ToString(), ViewState["CurWorkFlowNo"].ToString(), Session["MemberName"].ToString()))
                            {
                                btnSend.Enabled = true;
                            }
                        }
                        else
                        {
                            btnAccept.Enabled = false;
                        }
                    }
                }
            }


            FillDropDownList.FillByTable(ref ddlDD_STATION, "DMIS_SYS_STATION", "NAME", "TID");
            FillDropDownList.FillByTable(ref ddlXT_TYPE, "T_ZDH_DEVICE_XT_TYPE", "TYPE_NAME", "TID", "ORDER_ID ASC");
            FillDropDownList.FillByTable(ref ddlYD_TYPE, "T_ZDH_DEVICE_XT_TYPE", "TYPE_NAME", "TID", "ORDER_ID ASC");

            if (Convert.ToInt32(ViewState["RecNo"]) > -1)
            {
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, "T_ZDH_DEVICE_FAULT", "TID=" + ViewState["RecNo"].ToString());

                if (!SetRight.IsAdminitrator(Session["MemberID"].ToString())) //不是管理员才设置初始人员及日期,否则会把管理员的名称也赋值给相应的控件
                {
                    //设置初始人名,主办人,从办人在后面设置
                    string[] name = { "txtXT_JDR", "txtYD_JDR", "txtYS_YSR" };
                    TextBox  txt;
                    for (int i = 0; i < name.Length; i++)
                    {
                        txt = (TextBox)Page.FindControl(name[i]);
                        if (txt == null)
                        {
                            continue;
                        }
                        if (!txt.ReadOnly && txt.Text == "")
                        {
                            txt.Text = Session["MemberName"].ToString();
                        }
                    }
                    //设置初始日期
                    string[] date = { "wdlXT_XDSJ", "wdlYD_JDSJ", "wdlYS_YSRQ" };
                    WebDate  wdl;
                    for (int i = 0; i < date.Length; i++)
                    {
                        wdl = (WebDate)Page.FindControl(date[i]);
                        if (wdl == null)
                        {
                            continue;
                        }
                        if (wdl.Enabled && wdl.Text == "")
                        {
                            wdl.setTime(DateTime.Now);
                        }
                    }
                }



                //设置从办人员的姓名,这样不用两次输入办理人员的姓名
                DataTable memberStatus = DBOpt.dbHelper.GetDataTable("select f_receiver from dmis_sys_memberstatus where f_packno=" + ViewState["PackNo"].ToString() + " and f_workflowno=" + ViewState["CurWorkFlowNo"].ToString());
                for (int i = 0; i < memberStatus.Rows.Count; i++)
                {
                    if (!txtXT_JDR.ReadOnly)
                    {
                        if (i == 0)
                        {
                            if (txtXT_JDR2.Text == "")
                            {
                                txtXT_JDR2.Text = memberStatus.Rows[i][0].ToString();
                            }
                        }
                        else if (i == 1)
                        {
                            if (txtXT_JDR3.Text == "")
                            {
                                txtXT_JDR3.Text = memberStatus.Rows[i][0].ToString();
                            }
                        }
                        else if (i == 2)
                        {
                            if (txtXT_JDR4.Text == "")
                            {
                                txtXT_JDR4.Text = memberStatus.Rows[i][0].ToString();
                            }
                        }
                    }
                    else if (!txtYD_JDR.ReadOnly)
                    {
                        if (i == 0)
                        {
                            if (txtYD_JDR2.Text == "")
                            {
                                txtYD_JDR2.Text = memberStatus.Rows[i][0].ToString();
                            }
                        }
                        else if (i == 1)
                        {
                            if (txtYD_JDR3.Text == "")
                            {
                                txtYD_JDR3.Text = memberStatus.Rows[i][0].ToString();
                            }
                        }
                        else if (i == 2)
                        {
                            if (txtYD_JDR4.Text == "")
                            {
                                txtYD_JDR4.Text = memberStatus.Rows[i][0].ToString();
                            }
                        }
                    }
                }
            }
            else   //新增时,确定缺陷编号
            {
                _sql              = "select count(*) from T_ZDH_DEVICE_FAULT where to_char(DD_DATEM,'YYYYMM')='" + DateTime.Now.ToString("yyyyMM") + "'";
                counts            = Convert.ToInt16(DBOpt.dbHelper.ExecuteScalar(_sql)) + 1;
                txtDD_PH.Text     = DateTime.Now.ToString("yyyyMM") + counts.ToString("000");
                txtDD_FINDER.Text = Session["MemberName"].ToString();
                wdlDD_DATEM.setTime(DateTime.Now);
            }
        }
    }