private void DgvShow() { DgvMain.DataSource = null; string startDate = DtpStartDate.Value.ToString("yyyyMMdd"); string endDate = DtpEndDate.Value.ToString("yyyyMMdd"); DataTable dtBasic = GetBasicData(startDate, endDate); if (dtBasic != null) { int basicColCount = dtBasic.Columns.Count; DataTable dtShow = dtBasic.Copy(); DataTable dtData = CheckBoxMonth.Checked ? GetCgData_Month(startDate, endDate) : GetCgData_Day(startDate, endDate); Normal.ConvertDate(dtData, "开单日期"); DataConvert(dtShow, dtData); DgvMain.DataSource = dtShow; DgvOpt.SetColMiddleCenter(DgvMain, "-"); DgvOpt.SetColMiddleCenter(DgvMain, "号"); DgvOpt.SetColMiddleCenter(DgvMain, "单位"); DgvOpt.SetColMiddleCenter(DgvMain, "供应商"); DgvOpt.SetColMiddleCenter(DgvMain, "量"); DgvOpt.SetColMiddleCenter(DgvMain, "安全库存"); } else { Msg.Show("没有查询到数据"); } UI(); }