Пример #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (ddlCuaKhau.SelectedValue.ToString() == "")
                {
                    MessageBox.Show("Chưa chọn đơn vị hải quan");
                    return;
                }
                var report = new ReportListFeedback();

                var txtReceiver = (TextObject)report.Section1.ReportObjects["txtReceiver"];
                txtReceiver.Text = txtReceiver.Text + CustomsFacory.FindByCode(ddlCuaKhau.SelectedValue.ToString()).CustomsName;

                List <tblHandover> listHandover = TrainFactory.SearchBBBG(txtNumberBBBG.Text.Trim(), cbNgayXNC.Checked, dtpFrom.Value, dtpTo.Value, ddlCuaKhau.SelectedValue.ToString());

                if (listHandover == null || listHandover.Count == 0)
                {
                    MessageBox.Show("Không có dữ liệu thỏa mãn điều kiện tìm kiếm này");
                    return;
                }
                DataSet1  dataset = new DataSet1();
                DataTable dt      = dataset.tblHandover;

                foreach (tblHandover obj in listHandover)
                {
                    dt.Rows.Add(obj.ID,
                                obj.NumberHandover,
                                obj.DateHandover,
                                obj.CodeStation,
                                obj.CodeStationFromTo,
                                obj.StatusGoods,
                                obj.StatusVehicle,
                                obj.CreatedDate,
                                obj.CreatedBy,
                                obj.ModifiedDate,
                                obj.ModifiedBy,
                                obj.NumberReply,
                                obj.DateReply,
                                obj.NoteReply,
                                obj.IsDeleted,
                                obj.IsReplied,
                                obj.Note,
                                obj.Type,
                                obj.ReplyStatusGoods);
                }

                report.SetDataSource(dataset);

                FrmPreviewReport frmReport = new FrmPreviewReport(report);
                frmReport.MdiParent = this.MdiParent;
                frmReport.Show();
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        private void search()
        {
            try
            {
                String             replyType   = ((ComboBoxItem)cbType.SelectedItem).Value.ToString();
                Nullable <Boolean> replyStatus = null;
                if (((ComboBoxItem)cbReplyStatus.SelectedItem).Value != null)
                {
                    replyStatus = (Boolean)(((ComboBoxItem)cbReplyStatus.SelectedItem).Value);
                }
                List <tblHandover> listHandOver = TrainFactory.SearchBBBG(txtNumberBBBG.Text.Trim(),
                                                                          cbNgayXNC.Checked, dtpFrom.Value, dtpTo.Value, replyStatus, replyType, cbChuaTaoBangKe.Checked);
                foreach (tblHandover handover in listHandOver)
                {
                    if (handover.Type == "0")
                    {
                        handover.Type = "BBBG Đến";
                    }
                    else
                    {
                        handover.Type = "BBBG Đi";
                    }
                }

                grdHandover.AutoGenerateColumns = false;
                grdHandover.DataSource          = listHandOver;

                for (var i = 0; i < grdHandover.Rows.Count; i++)
                {
                    // Add to count Column
                    grdHandover.Rows[i].Cells["Count"].Value = i + 1;
                }
            }
            catch (Exception ex)
            {
                if (GlobalInfo.IsDebug)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            String             replyType   = ((ComboBoxItem)cbType.SelectedItem).Value.ToString();
            Nullable <Boolean> replyStatus = null;

            if (((ComboBoxItem)cbReplyStatus.SelectedItem).Value != null)
            {
                replyStatus = (Boolean)(((ComboBoxItem)cbReplyStatus.SelectedItem).Value);
            }
            List <tblHandover> listHandover = TrainFactory.SearchBBBG("", true, dtpFrom.Value, dtpTo.Value, replyStatus, replyType, false);

            DataSet1  dataset = new DataSet1();
            DataTable dt      = dataset.BBBG;

            foreach (tblHandover handover in listHandover)
            {
                string tenHaiQuanChuyenDen = "";
                string tenHaiQuanChuyenDi  = "";
                if (replyType == "0") //BBBG den
                {
                    tenHaiQuanChuyenDen = CustomsFacory.FindByCode(handover.CodeStation).CustomsName;
                    tenHaiQuanChuyenDi  = CustomsFacory.FindByCode(handover.CodeStationFromTo).CustomsName;
                }
                else if (replyType == "1") //BBBG di
                {
                    tenHaiQuanChuyenDen = CustomsFacory.FindByCode(handover.CodeStationFromTo).CustomsName;
                    tenHaiQuanChuyenDi  = CustomsFacory.FindByCode(handover.CodeStation).CustomsName;
                }

                dt.Rows.Add(handover.ID, handover.NumberHandover, handover.DateHandover, tenHaiQuanChuyenDi, tenHaiQuanChuyenDen, handover.StatusVehicle, handover.StatusGoods, handover.DateReply, handover.Note);
            }

            if (replyType == "0") //BBBG den
            {
                var report  = new ReportHandoverComeIn();
                var txtType = (TextObject)report.Section1.ReportObjects["txtType"];
                var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"];
                var txtTo   = (TextObject)report.Section1.ReportObjects["txtTo"];
                txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text;
                txtTo.Text   = txtTo.Text + " " + dtpTo.Text;
                txtType.Text = ("SỔ THEO DÕI BBBG HÀNG CHUYỂN CẢNG ĐẾN").ToUpper();
                report.SetDataSource(dataset);
                FrmPreviewReport frmReport = new FrmPreviewReport(report);
                frmReport.MdiParent = this.MdiParent;
                frmReport.Show();
            }
            else if (replyType == "1") //BBBG di
            {
                var report  = new ReportHandoverOut();
                var txtType = (TextObject)report.Section1.ReportObjects["txtType"];
                var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"];
                var txtTo   = (TextObject)report.Section1.ReportObjects["txtTo"];
                txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text;
                txtTo.Text   = txtTo.Text + " " + dtpTo.Text;
                txtType.Text = ("SỔ THEO DÕI BBBG HÀNG CHUYỂN CẢNG ĐI").ToUpper();

                report.SetDataSource(dataset);
                FrmPreviewReport frmReport = new FrmPreviewReport(report);
                frmReport.MdiParent = this.MdiParent;
                frmReport.Show();
            }
        }