コード例 #1
0
        /// <summary>
        /// 导出表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDcExcel_Click(object sender, EventArgs e)
        {
            SaveFileDialog sDialog = new SaveFileDialog();

            sDialog.FileName = "死亡人数统计" + CommonInfo.CObjectToStr(this.dateEdit1.EditValue).Trim() + "至" + CommonInfo.CObjectToStr(this.dateEdit2.EditValue).Trim() + ".xls";
            if (sDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
                grd.ExportToXls(sDialog.FileName, options);
                DevExpress.XtraEditors.XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
ファイル: FrmXiangMu.cs プロジェクト: Cuuuup/WinJIaoJing
        private void btnSel_Click(object sender, EventArgs e)
        {
            string sError = "";
            string sCon   = "";

            if (this.textEdit1.Text.Trim() != "")
            {
                sCon += "  and (XiangMuNo like '%" + this.textEdit1.Text.Trim() + "%' or  XiangMuName like '%" + this.textEdit1.Text.Trim() + "%')";
            }
            if (CommonInfo.CObjectToStr(this.cmbDeptID.EditValue) != "" && CommonInfo.CObjectToStr(this.cmbDeptID.EditValue) != "0")
            {
                sCon += " and BaoTypeId like '" + CommonInfo.CObjectToStr(this.cmbDeptID.EditValue) + "' ";
            }
            string    strSql = "select * from T_XiangMu where 1=1  " + sCon + " order by XiangMuID";
            DataTable dt     = SqlHelper.RunQuery(CommandType.Text, strSql, null, out sError);

            this.grd.DataSource = dt;
        }
コード例 #3
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                XtraReport report = new XtraReport();
                report.LoadLayout(Application.StartupPath + "/Print/DieCount.repx");
                report.DataSource = (DataTable)grd.DataSource;

                //添加参数
                report.Parameters.Clear();


                DevExpress.XtraReports.Parameters.Parameter p2 = new DevExpress.XtraReports.Parameters.Parameter();
                p2.Name        = "标题";
                p2.Description = "标题"; //死亡人数统计2018 - 03 - 01至2018 - 03 - 31
                p2.Value       = CommonInfo.CObjectToStr(this.dateEdit1.EditValue).Trim() + "至" + CommonInfo.CObjectToStr(this.dateEdit2.EditValue).Trim() + "死亡人数统计";
                report.Parameters.Add(p2);

                DevExpress.XtraReports.Parameters.Parameter p3_5 = new DevExpress.XtraReports.Parameters.Parameter();
                p3_5.Name        = "死亡人数";
                p3_5.Description = "死亡人数";
                p3_5.Value       = gridColumn3.SummaryText;
                report.Parameters.Add(p3_5);



                if (Program.sOperID != "admin")
                {
                    report.Print();
                }
                else
                {
                    report.ShowDesignerDialog();
                }
            }
            catch { }
        }
コード例 #4
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSel_Click(object sender, EventArgs e)
        {
            string sError = "";
            string sCon   = "";

            if (ckd.Checked == true)
            {
                sCon += $" and AnQingDiZhi='{this.comDidIan.Text}'  ";
            }
            if (ckt.Checked == true)
            {
                if (this.txtDateSS.Text.Trim() == "")
                {
                    MessageBox.Show("时间段不允许为空");
                    return;
                }

                if (this.txtT3.Text.Trim() == "")
                {
                    MessageBox.Show("时间段不允许为空");
                    return;
                }

                sCon += $"  and AnQingDateSS>='{this.txtDateSS.Text.Trim()}' and AnQingDateSS<='{this.txtT3.Text.Trim()}'  ";
            }

            if (CommonInfo.CObjectToStr(this.dateEdit1.EditValue).Trim() != "")
            {
                sCon += " and AnQingDate>='" + CommonInfo.CDate(this.dateEdit1.EditValue).ToString("yyyy-MM-dd") + " 00:00:00' ";
            }
            if (CommonInfo.CObjectToStr(this.dateEdit2.EditValue).Trim() != "")
            {
                sCon += " and AnQingDate<='" + CommonInfo.CDate(this.dateEdit2.EditValue).ToString("yyyy-MM-dd") + " 23:59:59' ";
            }
            DataBind(sCon);
        }
コード例 #5
0
        //查询
        private void btnSel_Click(object sender, EventArgs e)
        {
            string sError = "";
            string sCon   = "";

            if (this.ckhdy.Checked == true)
            {
                sCon += " and StateMo ='已核对'";
            }
            if (this.ckhdn.Checked == true)
            {
                sCon += " and StateMo ='未核对'";
            }

            if (this.ck1.Checked == true)
            {
                sCon += "  and State ='已结算' ";
            }
            if (this.ck2.Checked == true)
            {
                sCon += "  and State ='进行中' ";
            }
            if (this.ck3.Checked == true)
            {
                sCon += "  and State ='(二次)已结算' ";
            }
            if (this.ck4.Checked == true)
            {
                sCon += "  and State ='(二次)进行中' ";
            }


            if (this.textEdit1.Text.Trim() != "")
            {
                sCon += "  and AnQingNo like '%" + this.textEdit1.Text.Trim() + "%'";
            }

            if (CommonInfo.CObjectToStr(this.cmbDeptID.Text) != "")
            {
                if (this.cmbDeptID.Text == "全部")
                {
                    sCon += " ";
                }
                else
                {
                    sCon += " and DeftName like '" + CommonInfo.CObjectToStr(this.cmbDeptID.Text) + "' ";
                }
            }

            if (CommonInfo.CObjectToStr(this.cmbgs.Text) != "")
            {
                if (this.cmbgs.Text == "全部")
                {
                    sCon += " ";
                }
                else
                {
                    if (Convert.ToInt32(this.cmbgs.EditValue) <= 3)
                    {
                        sCon += " and GongSiA = '" + Convert.ToInt32(this.cmbgs.EditValue) + "' ";
                    }
                    if (Convert.ToInt32(this.cmbgs.EditValue) > 3 && Convert.ToInt32(this.cmbgs.EditValue) <= 6)
                    {
                        sCon += " and GongSiB = '" + Convert.ToInt32(this.cmbgs.EditValue) + "' ";
                    }
                    if (Convert.ToInt32(this.cmbgs.EditValue) > 6 && Convert.ToInt32(this.cmbgs.EditValue) <= 9)
                    {
                        sCon += " and GongSiD = '" + Convert.ToInt32(this.cmbgs.EditValue) + "' ";
                    }
                }
            }

            if (CommonInfo.CObjectToStr(this.dateEdit1.EditValue).Trim() != "")
            {
                sCon += " and AnQingDate>='" + CommonInfo.CDate(this.dateEdit1.EditValue).ToString("yyyy-MM-dd") + " 00:00:00' ";
            }
            if (CommonInfo.CObjectToStr(this.dateEdit2.EditValue).Trim() != "")
            {
                sCon += " and AnQingDate<='" + CommonInfo.CDate(this.dateEdit2.EditValue).ToString("yyyy-MM-dd") + " 23:59:59' ";
            }
            DataBind(sCon);
        }