Beispiel #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            this.btnExcel.Attributes.Add("onclick", "javascript:window.open('../DataGridToExcel.aspx', 'Sample', 'toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,copyhistory=yes,width=790,height=520,left=0,top=0')");
            if (Session["Login"] != null)
            {
                CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
//				if(ls1.strLimit!="CL001")
//				{
//					this.SetErrorMsgPageBydir("对不起,你没有权限使用此功能!");
//					return;
//				}
                if (!IsPostBack)
                {
                    this.FillDropDownList("tbCommCode", ddlAssType, "vcCommSign ='AT'", "全部");
                    this.FillDropDownList("tbCommCode", ddlDept, "vcCommSign ='MD'", "全部");
                    if (ls1.strLimit != "CL001")
                    {
                        ddlDept.Items.FindByValue(ls1.strDeptID).Selected = true;
                        ddlDept.Enabled = false;
                    }
                    strBeginDate = DateTime.Now.ToShortDateString();
                    strEndDate   = DateTime.Now.ToShortDateString();
                    string    strDept = ddlDept.SelectedValue;
                    Hashtable htapp   = (Hashtable)Application["appconf"];
                    string    strcons = (string)htapp["cons"];
                    busiq = new BusiComm.BusiQuery(strcons);
                    DataTable dtoper = busiq.GetConsOperList(strDept, strBeginDate, strEndDate);
                    this.FillDropDownList(dtoper, ddlOper, "全部");
                    Session.Remove("QUERY");
                    Session.Remove("toExcel");
                    Session.Remove("page_view");
                }
                else
                {
                    strBeginDate = Request.Form["txtBegin"].ToString();
                    strEndDate   = Request.Form["txtEnd"].ToString();
                }
                if (this.UcPageView1.MyDataGrid.DataSource != null)
                {
                    if (((DataView)this.UcPageView1.MyDataGrid.DataSource).Count > 0)
                    {
                        UcPageView1.FootBar.Visible = true;
                        btnExcel.Enabled            = true;
                    }
                    else
                    {
                        btnExcel.Enabled = false;
                    }
                }
                else
                {
                    btnExcel.Enabled = false;
                }
            }
            else
            {
                Response.Redirect("../Exit.aspx");
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
            if (Session["Login"] != null)
            {
                CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
                if (!IsPostBack)
                {
                    this.FillDropDownList("tbCommCode", ddlDept, "vcCommSign ='MD' and vcCommCode<>'FYZX1'", "全部");
                    this.FillDropDownList("AllREGION", ddlRegion, "", "全部");
                    if (ls1.strLimit != "CL001")
                    {
                        ddlDept.Items.FindByValue(ls1.strDeptID).Selected = true;
                        ddlDept.Enabled   = false;
                        ddlRegion.Enabled = false;
                    }
                    strBeginDate = DateTime.Now.ToShortDateString();
                    strEndDate   = DateTime.Now.ToShortDateString();
                    string    strDept = ddlDept.SelectedValue;
                    Hashtable htapp   = (Hashtable)Application["appconf"];
                    string    strcons = (string)htapp["cons"];
                    busiq = new BusiComm.BusiQuery(strcons);
                    DataTable dtoper = busiq.GetConsOperList(strDept, strBeginDate, strEndDate);
                    this.FillDropDownList(dtoper, ddlOper, "全部");
//					Session.Remove("QUERY");
//					Session.Remove("toExcel");
//					Session.Remove("page_view");
                }
                else
                {
                    strBeginDate = Request.Form["txtBegin"].ToString();
                    strEndDate   = Request.Form["txtEnd"].ToString();
                }
//				if(this.UcPageView1.MyDataGrid.DataSource!=null)
//				{
//					if(((DataView)this.UcPageView1.MyDataGrid.DataSource).Count>0)
//					{
//						UcPageView1.FootBar.Visible = true;
////						btnExcel.Enabled=true;
//					}
//					else
//					{
////						btnExcel.Enabled=false;
//					}
//				}
//				else
//				{
////					btnExcel.Enabled=false;
//				}
            }
            else
            {
                Response.Redirect("../Exit.aspx");
            }
        }
Beispiel #3
0
        protected void ddlDept_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            string    strDept = ddlDept.SelectedValue;
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            busiq = new BusiComm.BusiQuery(strcons);
            DataTable dtoper = busiq.GetConsOperList(strDept, strBeginDate, strEndDate);

            this.FillDropDownList(dtoper, ddlOper, "全部");
            this.UcPageView1.MyDataGrid.DataSource = null;
            this.UcPageView1.MyDataGrid.DataBind();
            this.UcPageView1.FootBar.Visible = false;
        }
Beispiel #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            this.btnExcel.Attributes.Add("onclick", "javascript:window.open('../DataGridToExcel.aspx', 'Sample', 'toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,copyhistory=yes,width=790,height=520,left=0,top=0')");
            if (Session["Login"] != null)
            {
                CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
//				if(ls1.strLimit!="CL001")
//				{
//					this.SetErrorMsgPageBydir("对不起,你没有权限使用此功能!");
//					return;
//				}
                if (!IsPostBack)
                {
                    this.FillDropDownList("tbCommCode", ddlAssType, "vcCommSign ='AT'", "全部");
                    this.FillDropDownList("tbCommCode", ddlDept, "vcCommSign ='MD' and vcCommCode<>'FYZX1'", "全部");
                    this.FillDropDownList("tbCommCode", ddlBillType, "vcCommSign ='PT'", "全部");
                    this.FillDropDownList("tbCommCode", ddlAssState, "vcCommSign ='AS'", "所有");
                    this.FillDropDownList("AllREGION", ddlRegion, "", "全部");
                    this.ddlConsFlag.Items.Add(new ListItem("正常消费", "0"));
                    this.ddlConsFlag.Items.Add(new ListItem("已撤消", "9"));
                    this.ddlConsFlag.SelectedIndex = 0;
                    if (ls1.strLimit != "CL001")
                    {
                        ddlDept.Items.FindByValue(ls1.strDeptID).Selected = true;
                        ddlDept.Enabled   = false;
                        ddlRegion.Enabled = false;
                    }
                    strBeginDate = DateTime.Now.ToShortDateString();
                    strEndDate   = DateTime.Now.ToShortDateString();
                    string    strDept = ddlDept.SelectedValue;
                    Hashtable htapp   = (Hashtable)Application["appconf"];
                    string    strcons = (string)htapp["cons"];
                    busiq = new BusiComm.BusiQuery(strcons);
                    DataTable dtoper = busiq.GetConsOperList(strDept, strBeginDate, strEndDate);
                    this.FillDropDownList(dtoper, ddlOper, "全部");
                    Session.Remove("QUERY");
                    Session.Remove("toExcel");
                    Session.Remove("page_view");


                    #region 控制按钮显示
                    this.Button1.Visible = false;
                    this.Button2.Visible = false;
                    Hashtable htOperFunc = (Hashtable)Application["OperFunc"];
                    ArrayList almenu     = (ArrayList)htOperFunc[ls1.strLoginID];
                    if (almenu != null)
                    {
                        for (int i = 0; i < almenu.Count; i++)
                        {
                            CMSMStruct.MenuStruct            ms1        = (CMSMStruct.MenuStruct)almenu[i];
                            System.Web.UI.WebControls.Button btnCurrent = this.FindControl(ms1.strFuncAddress.Replace("wfmConsItem_", String.Empty)) as System.Web.UI.WebControls.Button;
                            if (btnCurrent != null)
                            {
                                btnCurrent.Visible   = true;
                                this.Button2.Visible = true;
                            }
                        }
                    }
                    #endregion
                }
                else
                {
                    strBeginDate = Request.Form["txtBegin"].ToString();
                    strEndDate   = Request.Form["txtEnd"].ToString();
                }
            }
            else
            {
                Response.Redirect("../Exit.aspx");
            }
        }