Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            FillDropDownList.FillHtmlCombxByTable(ref hcbWeather, "DMIS_SYS_WEATHER", "NAME", "TID", "ORDER_ID asc");
            if (hcbWeather.Items.Count > 0)
            {
                hcbWeather.SelectedIndex = 0;
            }

            if (Request["date"] != null)
            {
                wdlDate.Text = Request["date"];
            }
            else
            {
                wdlDate.setTime(DateTime.Now);
            }

            btnSave_Click(null, null);
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        info = detail_info;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            object res = GetLocalResourceObject("PageResource1.Title");
            if (res != null)
            {
                lblFuncName.Text = res.ToString();
            }

            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            if (Request["TID"] != "")
            {
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, Session["TableName"].ToString(), "TID=" + Request["TID"]);
            }
            else
            {
                wdlDATEM.setTime(DateTime.Now);
                txtDEPART_ID.Text = Session["DepartID"].ToString();
            }
        }
    }
Exemplo n.º 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();
            lblFuncName.Text = Session["FuncName"].ToString();
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM") + "-01"));
            wdlEnd.setTime(DateTime.Now);
            initStation();
            ViewState["BaseSql"]   = "select * from " + Session["TableName"] + "";
            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();
            }
        }
    }
Exemplo n.º 4
0
    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());
            FillDropDownList.FillHtmlCombxByTable(ref hcbWEATHER, "DMIS_SYS_WEATHER", "NAME", "TID", "ORDER_ID");
            FillDropDownList.FillHtmlCombxByTable(ref hcbSTATION, "DMIS_SYS_STATION", "NAME", "TID", "ORDER_ID");

            if (Request["TID"] != "")
            {
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, Session["TableName"].ToString(), "TID=" + Request["TID"]);
            }
            else
            {
                txtDISPATCHER.Text = Session["MemberName"].ToString();
                wdlSTARTTIME.setTime(DateTime.Now);
                wdlENDTIME.setTime(DateTime.Now);
            }
        }
    }
Exemplo n.º 5
0
    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;
            }
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        info = detail_info;
        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            if (Request["TID"] == null || Request["TID"] == "")
            {
                txtMODULE_ID.Text = Session["FuncId"].ToString();
                wdlNEW_DATE.setTime(DateTime.Now);
                txtMEMBER.Text = Session["MemberName"].ToString();
            }
            else
            {
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, "T_FILE_INFO", "TID=" + Request["TID"]);
                _sql = "select * from T_FILE_ACCESSORIES where FILE_ID=" + Request["TID"];
                _dt  = DBOpt.dbHelper.GetDataTable(_sql);
                grvUpFileList.DataSource = _dt;
                grvUpFileList.DataBind();
            }
        }
    }
Exemplo n.º 7
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());
         hcbYear.Text         = DateTime.Now.Year.ToString();
         ViewState["BaseSql"] = "select * from " + Session["TableName"];
         //模块的查询条件,一般是按年、月、日查询;此变量在“检索”按钮中修改,在此初始化。
         btnQuery_Click(null, null);
         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();
         }
     }
 }
Exemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        info = detail_info;

        if (!IsPostBack)
        {
            Session["URL"] = Request["URL"];

            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            if (Request["TID"] == null || Request["TID"] == "")
            {
                txtMODULE_ID.Text = Session["FuncId"].ToString();
                wdlDATEM.setTime(DateTime.Now);
                txtSCR.Text       = Session["MemberName"].ToString();
                txtFILE_PATH.Text = Session["FilePath"].ToString();
            }
            else
            {
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, "T_FILE_SINGLE", "TID=" + Request["TID"]);
                if (txtFILE_NAME.Text.Trim() != "")
                {
                    btnUpload.Enabled = false;                                  //已经有文件的不允许再上传
                }
            }
        }
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ColumnStyle"] != null)
        {
            if (Session["ColumnStyle"].ToString() == "0")  //二列
            {
                generateControlByTwoColumn();
            }
            else  //一列
            {
                generateControlByOneColumn();
            }
        }

        if (!IsPostBack)
        {
            if (Request["FuncId"] == null)
            {
                return;
            }
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            _sql = "select * from DMIS_SYS_TREEMENU where ID=" + Request["FuncId"];
            DataTable treeMenu = DBOpt.dbHelper.GetDataTable(_sql);
            if (treeMenu.Rows.Count < 1)
            {
                return;
            }
            if (Session["Culture"] == null || Session["Culture"].ToString() == "zh-CN")
            {
                lblFuncName.Text = treeMenu.Rows[0]["NAME"] == Convert.DBNull ? "" : treeMenu.Rows[0]["NAME"].ToString();
            }
            else
            {
                lblFuncName.Text = treeMenu.Rows[0]["OTHER_LANGUAGE_DESCR"] == Convert.DBNull ? "" : treeMenu.Rows[0]["OTHER_LANGUAGE_DESCR"].ToString();
            }

            //_sql = "select DISPLAY_STYLE from DMIS_SYS_TABLES where ID=" + Session["MainTableId"].ToString();
            //obj = DBOpt.dbHelper.ExecuteScalar(_sql);
            //if (Session["ColumnStyle"] == null || Session["ColumnStyle"].ToString() == "0")  //二列
            //{
            //    Session["ColumnStyle"] = 0;
            //    generateControlByTwoColumn();
            //}
            //else  //一列
            //{
            //    Session["ColumnStyle"] = 1;
            //    generateControlByOneColumn();
            //}

            SetRight.SetPageRight(this.Page, Request["FuncId"].ToString(), Session["RoleIDs"].ToString());

            if (Request["TID"] != "")
            {
                CustomControlFill.CustomControlFillByTableAndWhere(this.Page, Session["TableName"].ToString(), "TID=" + Request["TID"]);
            }
        }
    }
Exemplo n.º 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());

            ViewState["BaseSql"] = "select * from " + Session["TableName"] + "";
            //模块的查询条件,一般是按年、月、日查询;此变量在“检索”按钮中修改,在此初始化。
            ViewState["BaseQuery"] = "to_char(STARTTIME,'YYYYMM')='" + DateTime.Now.ToString("yyyyMM") + "'";
            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();
                return;
            }
            //新增时,关闭新增窗口,控制刷新此页面
            //if (Session["NeedRefesh"] != null && Session["NeedRefesh"].ToString() == "是")
            //{
            //    GridViewBind();
            //    Session["NeedRefesh"] = "否";
            //    return;
            //}
        }
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef = grvList;

        if (!IsPostBack)
        {
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");

            initShift();
            ViewState["BaseSql"]   = "select * from T_DD_RUNNING_LOG";
            Session["CustomOrder"] = null;
            //找最新的当值记录
            _sql = "select DATEM,SHIFT from T_DD_SHIFT where FLAG=1 order by DATEM desc,SHIFT desc";
            _dt  = DBOpt.dbHelper.GetDataTable(_sql);
            if (_dt.Rows.Count > 0)
            {
                ViewState["CurrentShiftDatem"] = _dt.Rows[0][0];
                ViewState["CurrentShift"]      = _dt.Rows[0][1];
                wdlDate.setTime(Convert.ToDateTime(_dt.Rows[0][0]));
                ddlShift.SelectedIndex = ddlShift.Items.IndexOf(ddlShift.Items.FindByValue(_dt.Rows[0][1].ToString()));
                btnQuery_Click(null, null);
            }
            else
            {
                ViewState["CurrentShiftDatem"] = null;
                ViewState["CurrentShift"]      = null;
                btnAdd.Enabled    = false;
                btnDelete.Enabled = false;
                //JScript.Alert("还不存在当前值班记录,请联系管理员!");
                return;
            }
        }
        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();
            }
        }
    }
Exemplo n.º 12
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 = Session["FuncName"].ToString();
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            if (Session["DateQueryCol"] == null)
            {
                JScript.Alert("Date Query!");  //要翻译
                return;
            }

            //获取每页显示的行数
            object obj = DBOpt.dbHelper.ExecuteScalar("select PAGE_ROWS from DMIS_SYS_TABLES where ID=" + Session["MainTableId"].ToString());
            if (obj == null)
            {
                grvList.PageSize = 20;
            }
            else
            {
                grvList.PageSize = Convert.ToInt16(obj);
            }

            ViewState["BaseSql"] = "select * from " + Session["TableName"] + "";
            uwcMonth.Month       = DateTime.Now.ToString("dd-MM-yyyy");
            btnQuery_Click(null, null);
            Session["CustomOrder"] = null;
        }
        else
        {
            //自定义排序页面关闭后,刷新GridView
            if (Session["CustomOrder"] != null && ViewState["sql"].ToString().IndexOf(Session["CustomOrder"].ToString()) < 0)
            {
                LoadHeader();
                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();
            }
        }
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!Page.IsPostBack)
        {
            ViewState["CurPageIndex"] = 0;
            ViewState["PageCount"]    = 0;
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            ViewState["BaseSql"] = "select * from DMIS_SYS_LOG";
            //模块的查询条件,一般是按年、月、日查询;此变量在“检索”按钮中修改,在此初始化。
            ViewState["BaseQuery"] = "to_char(OPT_TIME,'YYYYMM')='" + DateTime.Now.ToString("yyyyMM") + "'";
            if (Session["Orders"] == null)   //平台中没有设置排序条件
            {
                ViewState["sql"] = ViewState["BaseSql"] + " where " + ViewState["BaseQuery"] + " order by OPT_TIME desc";
            }
            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 (Session["BaseQuery"] != null)  //页面自带查询条件
                {
                    ViewState["sql"] = ViewState["BaseSql"] + " where " + ViewState["BaseQuery"] + " order by " + Session["CustomOrder"];
                }
                else   //无查询条件
                {
                    ViewState["sql"] = ViewState["BaseSql"] + " order by " + Session["CustomOrder"];
                }
                GridViewBind();
                return;
            }
            //新增时,关闭新增窗口,控制刷新此页面
            if (Session["NeedRefesh"] != null && Session["NeedRefesh"].ToString() == "是")
            {
                GridViewBind();
                Session["NeedRefesh"] = "否";
                return;
            }
        }
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!Page.IsPostBack)
        {
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            iniTree();
            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(DateTime.Now);
        }
    }
Exemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;
        if (!Page.IsPostBack)
        {
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();


            ViewState["BaseSql"]   = "select * from T_DD_SHIFT";
            ViewState["BaseQuery"] = "to_char(DATEM,'YYYYMM')='" + DateTime.Now.ToString("yyyyMM") + "'";
            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;

            //只有管理员可以修改状态
            if (!SetRight.IsAdminitrator(Session["MemberID"].ToString()))
            {
                grvList.Columns[9].Visible = false;
            }
        }
        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();
            }
        }
    }
Exemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef = grvList;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");

            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            initStation();
            btnQuery_Click(null, null);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetListPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            ViewState["BaseSql"]   = "select distinct DATEM,INSPECTOR from " + Session["TableName"] + "";
            ViewState["BaseQuery"] = "to_char(DATEM,'YYYYMM')='" + DateTime.Now.ToString("yyyyMM") + "'";
            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();
                return;
            }
        }
    }
Exemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!Page.IsPostBack)
        {
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());


            //开始查询
            ViewState["BaseSql"]   = "select * from DMIS_SYS_WK_CYCLE_TASK_PARA";
            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();
                return;
            }
        }
    }
Exemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
        grvRef        = grvList;
        tdPageMessage = tdMessage;
        txtPageNumber = txtPage;

        if (!IsPostBack)
        {
            _sql = "select id,name from dmis_sys_depart order by order_id";
            DataTable depart = DBOpt.dbHelper.GetDataTable(_sql);
            ddlDepart.DataTextField  = "name";
            ddlDepart.DataValueField = "id";
            ddlDepart.DataSource     = depart;
            ddlDepart.DataBind();
            wdlStart.setTime(Convert.ToDateTime(DateTime.Now.Year.ToString() + "-01-01"));
            wdlEnd.setTime(DateTime.Now);
        }
    }
Exemplo n.º 20
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);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            PageControlLocalizationText pl = new PageControlLocalizationText(this);
            pl.SetDetailPageControlLocalizationText();
            lblFuncName.Text = Session["FuncName"].ToString();
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            if (Request["date"] != null)
            {
                wdlDate.Text = Request["date"];
            }
            else
            {
                wdlDate.setTime(DateTime.Now);
            }

            btnSave_Click(null, null);
        }
    }
Exemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        grvRef        = grvList;
        tdPageMessage = tdMessage;

        if (!IsPostBack)
        {
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());
            //if (!btnAdd.Enabled)  //没有权限的,只能浏览
            //{
            //    return;
            //}

            _sql = "select TID,日期,系统值班人 from T_ZDH_自动化值班记录 where 状态='当值' order by 日期 desc";
            DataTable dt = DBOpt.dbHelper.GetDataTable(_sql);
            if (dt.Rows.Count > 0)
            {
                ViewState["系统值班人"] = dt.Rows[0][2];
                ViewState["当值日期"]  = dt.Rows[0][1];
                wdlDate.setTime(Convert.ToDateTime(dt.Rows[0][1]));
                btnQuery_Click(null, null);
            }
            else
            {
                ViewState["系统值班人"] = "";
                ViewState["当值日期"]  = "1900-01-01";
                btnAdd.Enabled     = false;
                btnDelete.Enabled  = false;
                JScript.Alert("还不存在当前自动化值班记录,请联系管理员!");
                return;
            }
        }
        else
        {
            //双击时用
            SetGridViewEditRow();
        }
    }
Exemplo n.º 23
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 = Session["FuncName"].ToString();
            btnDelete.Attributes.Add("onClick", "return confirm('" + GetGlobalResourceObject("WebGlobalResource", "DeleteBeforeConfirm").ToString() + "');");
            SetRight.SetPageRight(this.Page, Session["FuncId"].ToString(), Session["RoleIDs"].ToString());

            //文档路径
            if (Session["OtherPara"] != null)
            {
                if (Session["OtherPara"].ToString().IndexOf("path") > -1)
                {
                    int startPos = Session["OtherPara"].ToString().IndexOf("path=");
                    int endPos   = Session["OtherPara"].ToString().IndexOf(';');
                    if (endPos > 0)
                    {
                        Session["FilePath"] = Session["OtherPara"].ToString().Substring(startPos + 5, endPos - startPos - 5);
                    }
                    else
                    {
                        Session["FilePath"] = Session["OtherPara"].ToString().Substring(startPos + 5);
                    }
                }
                else
                {
                    JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "FileNoPath").ToString());//"此功能没有设置文件存放路径,请联系管理员设置!"
                    btnAdd.Enabled    = false;
                    btnDelete.Enabled = false;
                    btnModify.Enabled = false;
                    return;
                }
            }
            else
            {
                JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "FileNoPath").ToString());//"此功能没有设置文件存放路径,请联系管理员设置!"
                btnAdd.Enabled    = false;
                btnDelete.Enabled = false;
                btnModify.Enabled = false;
                return;
            }

            //开始查询
            ViewState["BaseSql"]   = "select * from T_FILE_INFO";
            ViewState["BaseQuery"] = "MODULE_ID=" + Session["FuncId"].ToString();

            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();
                return;
            }
        }
    }
Exemplo n.º 24
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);
        }
    }