Beispiel #1
0
        private void button1_MouseClick(object sender, MouseEventArgs e)
        {
            if (WorkStatus.Endworkcheck == 1 || WorkStatus.startworkcheck == 0)
            {
                if (comboBox1.Text.Trim() != "")
                {
                    List <UserTable> asd = new List <UserTable>();
                    asd = obj.Get_SelectedCashiername((comboBox1.Text));
                    if (asd.Count > 0 && asd[0].IsAdmin == 0)
                    {
                        CrystalReportSelectiveCashierSale ob = new CrystalReportSelectiveCashierSale();


                        ByPass(ob);

                        ob.SetParameterValue("start", dateTimePicker1.Value);
                        ob.SetParameterValue("end", dateTimePicker2.Value);
                        ob.SetParameterValue("CID", asd[0].UserId);
                        ob.SetParameterValue("CNAME", (asd[0].UserName.ToString()));
                        ob.SetParameterValue("name", (asd[0].FullName.ToString()));
                        crystalReportViewer1.ReportSource = ob;
                        crystalReportViewer1.Refresh();
                        crystalReportViewer1.Show();
                    }
                    else
                    {
                        MessageBox.Show("Cashier ID Incorect");
                    }
                }
                else
                {
                    MessageBox.Show("Text Field Empty!");
                }
            }
            else
            {
                MessageBox.Show("First End the Work To Logout");
            }
        }
        private void button1_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                if (comboBox1.Text.Trim() != "")
                {
                    List <UserTable> asd = new List <UserTable>();
                    asd = obj.Get_SelectedCashiername((comboBox1.Text));
                    if (asd.Count > 0 && asd[0].IsAdmin == 0)
                    {
                        CrystalReportCashier ob = new CrystalReportCashier();

                        ByPass(ob);

                        ob.SetParameterValue("start", dateTimePicker1.Value);
                        ob.SetParameterValue("end", dateTimePicker2.Value);
                        ob.SetParameterValue("CID", asd[0].UserId);
                        ob.SetParameterValue("CNAME", asd[0].FullName);
                        crystalReportViewer1.ReportSource = ob;
                        crystalReportViewer1.Refresh();
                        crystalReportViewer1.Show();
                    }
                    else
                    {
                        MessageBox.Show("Cashier ID Incorect");
                    }
                }
                else
                {
                    MessageBox.Show("Text Field Empty!");
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "Exception Error");
            }
        }