Beispiel #1
0
        protected void btnQuery_Click(object sender, System.EventArgs e)
        {
            strBeginDate = Request.Form["txtBegin"].ToString();
            strEndDate   = Request.Form["txtEnd"].ToString();
            if (strBeginDate == "" || strEndDate == "" || strBeginDate == null || strEndDate == null)
            {
                this.SetErrorMsgPageBydir("时间不能为空,请重新选择时间!");
                return;
            }
            string strLoseDept    = this.ddlLoseDept.SelectedValue;
            string strLoseType    = this.ddlLoseType.SelectedValue;
            string strConfirmFlag = this.ddlDestroyFlag.SelectedValue;

            Hashtable htPara = new Hashtable();

            htPara.Add("strLoseDept", strLoseDept);
            htPara.Add("strLoseType", strLoseType);
            htPara.Add("strConfirmFlag", strConfirmFlag);
            htPara.Add("strBeginDate", strBeginDate);
            htPara.Add("strEndDate", strEndDate);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetLoseInfo(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dtout, "cnvcDeptID", "NewDept");
                    if (strConfirmFlag == "1")
                    {
                        this.DataGrid1.Columns[0].Visible = false;
                        this.btnAllSelect.Enabled         = false;
                        this.btnBatchConfirm.Enabled      = false;
                    }
                    else
                    {
                        CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
                        if (ls1.strDeptID != "FYZX1" && ls1.strDeptID != "CEN00")
                        {
                            this.DataGrid1.Columns[0].Visible = false;
                            this.btnAllSelect.Enabled         = false;
                            this.btnBatchConfirm.Enabled      = false;
                        }
                        else
                        {
                            this.DataGrid1.Columns[0].Visible = true;
                            this.btnAllSelect.Enabled         = true;
                            this.btnBatchConfirm.Enabled      = true;
                        }
                    }
                    dtout.TableName = "验收信息表";
                    DataTable dtexcel = dtout.Copy();
                    Session["QUERY"] = dtout;
                }

                this.DataGrid1.CurrentPageIndex = 0;
                this.DataGrid1.PageSize         = 20;
                this.DataGrid1.DataSource       = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }