Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime date           = reportDatePicker.Value;
            Object   tmpDeptNameObj = DeptCmbMonthly.SelectedItem;
            string   qry            = "";

            if (tmpDeptNameObj == null)
            {
                qry = "select b.bag_id, d.deptName, b.date, b.bagNo, b.issued, i.place " +
                      "from bag b left join issuedto i on b.place_id=i.place_id " +
                      "inner join department d on b.deptNo=d.deptNo where MONTH(b.date)=" + date.Month;
            }
            else
            {
                string deptName = tmpDeptNameObj.ToString();

                if (deptName.Equals("All"))
                {
                    qry = "select b.bag_id, d.deptName, b.date, b.bagNo, b.issued, i.place " +
                          "from bag b left join issuedto i on b.place_id=i.place_id " +
                          "inner join department d on b.deptNo=d.deptNo where MONTH(b.date)=" + date.Month;
                }
                else
                {
                    qry = "select b.bag_id, d.deptName, b.date, b.bagNo, b.issued, i.place " +
                          "from bag b left join issuedto i on b.place_id=i.place_id " +
                          "inner join department d on b.deptNo=d.deptNo " +
                          "where d.deptName='" + deptName + "' and MONTH(b.date)=" + date.Month;
                }
            }

            testReport frm = new testReport(qry);

            frm.Show();
        }
Ejemplo n.º 2
0
        private void issuedSelectedDay_Click(object sender, EventArgs e)
        {
            DateTime date = dateTimePickerIssuedDaily.Value;

            string qry = "select b.bag_id, d.deptName, b.issuedDate as date, b.bagNo, b.issued, i.place " +
                         "from bag b inner join department d on b.deptNo=d.deptNo " +
                         "inner join issuedto i on i.place_id=b.place_id " +
                         "where b.issued=1 and b.issuedDate<='" + date.ToString("yyyy/M/d") + "'";

            testReport frm = new testReport(qry);

            frm.Show();
        }
Ejemplo n.º 3
0
        private void IssuedSelectedMonth_Click_1(object sender, EventArgs e)
        {
            DateTime date = dateTimePickerIssued.Value;
            Object   tmpIssuedPlaceObj = IssuedPlaceCmbMonthly.SelectedItem;
            string   qry = "";

            if (tmpIssuedPlaceObj == null)
            {
                qry = "select b.bag_id, d.deptName, b.issuedDate as date, b.bagNo, b.issued, i.place " +
                      "from bag b inner join department d on b.deptNo=d.deptNo " +
                      "inner join issuedto i on i.place_id=b.place_id " +
                      "where b.issued=1 and MONTH(b.issuedDate)=" + date.Month;
            }
            else
            {
                string place = tmpIssuedPlaceObj.ToString();

                if (place.Equals("All"))
                {
                    qry = "select b.bag_id, d.deptName, b.issuedDate as date, b.bagNo, b.issued, i.place " +
                          "from bag b inner join department d on b.deptNo=d.deptNo " +
                          "inner join issuedto i on i.place_id=b.place_id " +
                          "where b.issued=1 and MONTH(b.issuedDate)=" + date.Month;
                }
                else
                {
                    qry = "select b.bag_id, d.deptName, b.issuedDate as date, b.bagNo, b.issued, i.place " +
                          "from bag b inner join department d on b.deptNo=d.deptNo " +
                          "inner join issuedto i on i.place_id=b.place_id " +
                          "where b.issued=1 and i.place='" + place + "' and MONTH(b.issuedDate)=" + date.Month;
                }
            }

            testReport frm = new testReport(qry);

            frm.Show();
        }
Ejemplo n.º 4
0
        private void balanceSelectedDay_Click(object sender, EventArgs e)
        {
            DateTime date           = dailyReportDateTimePicker.Value;
            Object   tmpDeptNameObj = DeptCmbMonthly.SelectedItem;
            string   qry            = "";

            if (tmpDeptNameObj == null)
            {
                qry = "select b.bag_id, d.deptName, b.date, b.bagNo, b.issued, i.place " +
                      "from bag b inner join department d on b.deptNo=d.deptNo " +
                      "left join issuedto i on b.place_id=i.place_id " +
                      "where b.issued=0 and b.date<='" + date.ToString("yyyy/M/d") + "'";
            }
            else
            {
                string deptName = tmpDeptNameObj.ToString();

                if (deptName.Equals("All"))
                {
                    qry = "select b.bag_id, d.deptName, b.date, b.bagNo, b.issued, i.place " +
                          "from bag b inner join department d on b.deptNo=d.deptNo " +
                          "left join issuedto i on b.place_id=i.place_id " +
                          "where b.issued=0 and b.date='" + date.ToString("yyyy/M/d") + "'";
                }
                else
                {
                    qry = "select b.bag_id, d.deptName, b.date, b.bagNo, b.issued, i.place " +
                          "from bag b inner join department d on b.deptNo=d.deptNo " +
                          "left join issuedto i on b.place_id=i.place_id " +
                          "where b.issued=0 and d.deptName='" + deptName + "' and b.date='" + date.ToString("yyyy/M/d") + "'";
                }
            }

            testReport frm = new testReport(qry);

            frm.Show();
        }