예제 #1
0
        protected void btnQuery_Click(object sender, System.EventArgs e)
        {
            string strDeptID = this.ddlDept.SelectedValue;
            string strMonth  = this.ddlMonth.SelectedItem.Text;

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strMonth", strMonth);

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

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetPlanDeptDetail(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                this.TableConvert(dtout, "cnvcPlanDeptName", "NewDept", "vcCommSign='SalesRoom'");
                Session.Remove("PalnDetail");
                Session["PalnDetail"]     = dtout;
                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
                for (int i = 0; i < dtout.Rows.Count; i++)
                {
                    if (dtout.Rows[i]["DelFlag"].ToString() == "1")
                    {
                        ((LinkButton)this.DataGrid1.Items[i].Cells[7].Controls[0]).Visible = false;
                    }
                }

                this.btnQuery.Enabled = false;
                this.btnAdd.Enabled   = true;
                this.ddlDept.Enabled  = false;
                this.ddlMonth.Enabled = false;
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }