Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            DateTime dt = dateTimePicker1.Value;

            rptServiceMonth rpt = (rptServiceMonth)frmMain.Main.GetReport <rptServiceMonth>("Service", "DATEDIFF(MONTH, '" + dt + "', 受理时间) = 0");
            //设置月份
            TextObject obj = (TextObject)rpt.Section1.ReportObjects["Text1"];

            obj.Text = dt.ToString("yyyy年MM月");
            crystalReportViewer1.ReportSource = rpt;
        }
Exemple #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void Init()
        {
            //加载
            _customerGroup.Show(this.dockPanel1);
            dockCustomer customer = new dockCustomer();

            customer.Show(this.dockPanel1);


            //菜单栏
            tsmiAddCustomerGroup.Click += (sender, e) =>
                                          (new frmCustomerGroup()).ShowDialog(this);
            tsmiAddCustomer.Click += (sender, e) =>
                                     (new frmCustomer()).ShowDialog(this);
            tsmiAddService.Click += (sender, e) =>
                                    (new frmService()).ShowDialog(this);

            //报表菜单
            tsmiReportCustomerInfo.Click += (sender, e) =>
                                            (new frmPrint(GetReport <rptCustomerInfo>("Customer", ""))).ShowDialog(this);
            tsmiReportCustomerPie.Click += (sender, e) =>
                                           (new frmPrint(GetReport <rptCustomerPie>("Customer", ""))).ShowDialog(this);
            tsmiReportServiceInfo.Click += (sender, e) =>
                                           (new frmPrint(GetReport <rptServiceInfo>("Service", ""))).ShowDialog(this);
            tsmiReportServiceMonth.Click += (sender, e) =>
            {
                rptServiceMonth rpt = (rptServiceMonth)GetReport <rptServiceMonth>("Service", "DATEDIFF(MONTH, '" + DateTime.Now + "', 受理时间) = 0");
                //设置月份
                TextObject obj = (TextObject)rpt.Section1.ReportObjects["Text1"];
                obj.Text = DateTime.Now.ToString("yyyy年MM月");
                frmPrint frm = new frmPrint(rpt);
                frm.ShowDialog(this);
            };
            tsmiReportServiceTotal.Click += (sender, e) =>
                                            (new frmPrint(GetReport <rptServiceTotal>("Service", ""))).ShowDialog(this);

            tsmiOption.Click += (sender, e) =>
                                (new frmOption()).ShowDialog(this);


            //状态栏时间
            tmr.Tick += (sender, e) => tsslblTime.Text =
                DateTime.Now.ToString("当前时间:yyyy-MM-dd HH:mm:ss");
            tmr.Start();

            //工具栏、客户组、状态栏隐藏和现实
            tsmiTools.Click += (sender, e) =>
                               toolStrip1.Visible = tsmiTools.Checked;

            tsmiCustomerGroup.Click += (sender, e) =>
                                       _customerGroup.IsHidden = !tsmiCustomerGroup.Checked;

            _customerGroup.VisibleChanged += (sender, e) =>
                                             tsmiCustomerGroup.Checked = !_customerGroup.IsHidden;

            tsmiStatus.Click += (sender, e) =>
                                statusStrip1.Visible = tsmiStatus.Checked;
            //搜索故障解决方案效果
            tstSulotion.Enter += (sender, e) =>
            {
                if (tstSulotion.ForeColor == Color.Gray)
                {
                    tstSulotion.Text      = string.Empty;
                    tstSulotion.ForeColor = Color.Black;
                }
            };
            tstSulotion.Leave += (sender, e) =>
            {
                if (tstSulotion.Text.Trim().Length == 0)
                {
                    tstSulotion.Text      = "在此输入故障现象";
                    tstSulotion.ForeColor = Color.Gray;
                }
            };

            //加载布局
            //string path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), @"xml\DockPanel.xml ");

            //if (File.Exists(path))
            //{
            //    dockPanel1.LoadFromXml(path, persistString =>
            //    {
            //        if (persistString ==
            //            typeof(dockCustomerGroup).ToString())
            //        {
            //            return _customerGroup;
            //        }
            //        else
            //        {
            //            return null;
            //        }
            //    });
            //}
        }