private void btnQry_Click(object sender, EventArgs e) { if (txtStorage.Text.Trim() == "") { this.ShowAlertMessage("请选择仓库!"); return; } if (dtpEndDate.Text.Trim() == "") { this.ShowAlertMessage("请选择截止日期!"); return; } string strMaterialGuid = ""; if (txtMaterialGuid.Tag != null) { strMaterialGuid = txtMaterialGuid.Tag.ToString(); } string strMaterialType = ""; if (txtMaterialType.Tag != null) { strMaterialType = txtMaterialType.Tag.ToString(); } StatReportManage StatReportManage = new StatReportManage(); gridControl1.DataSource = StatReportManage.StockReport(strMaterialGuid, txtStorage.Tag.ToString(), strMaterialType, dtpEndDate.Text.Trim() + " 23:59:59"); //用于打印 DataTable dtl3 = base.GetDataTable((DataView)gridView1.DataSource); ds.Tables.Clear(); ds.Tables.Add(dtl3.Copy()); ds.Tables[0].TableName = "StockReport"; //权限判断 if (rightgroupManage.IsOperateRightByUserID(SysParams.UserID, "IsDisplayPrice", "IsDisplayPrice") == false) { gridView1.Columns["Price"].Visible = false; gridView1.Columns["MaterialMoney"].Visible = false; gridView1.Columns["Price2"].Visible = false; gridView1.Columns["MaterialMoney2"].Visible = false; } }