public FormWarehouses(IWarehouseServices warehouseServices)
 {
     InitializeComponent();
     mWarehouseServices = warehouseServices;
     LoadAllWarehouseToListBox();
     this.Text = "Kho Hàng - " + FormUltils.getInstance().GetVersionInfo();
 }
 public FormLogin(IEmployeeServices employeeServices, IWarehouseServices warehouseService)
 {
     InitializeComponent();
     mEmployeeService  = employeeServices;
     mWarehouseService = warehouseService;
     if (mEmployeeService.isConnection())
     {
         LoadAllWarehouses();
         lblError.Text      = "Đã có kết nối, mời bạn đăng nhập!";
         lblError.ForeColor = System.Drawing.Color.Green;
     }
     else
     {
         lblError.ForeColor = System.Drawing.Color.Red;
         lblError.Text      = "Không có kết nối đến cơ sở dữ liệu, hãy cấu hình CSDL!";
         //try
         //{
         //    RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\RapidSolution");
         //    if (key != null)
         //    {
         //        Ultilities.Security.buildNewConnection(key.GetValue("DataSource").ToString(), key.GetValue("InitialCatalog").ToString(),
         //            key.GetValue("UserID").ToString(), key.GetValue("Password").ToString());
         //        if (mEmployeeService.isConnection())
         //        {
         //            LoadAllWarehouses();
         //            lblError.Text = "Đã có kết nối, mời bạn đăng nhập!";
         //            lblError.ForeColor = System.Drawing.Color.Green;
         //        }
         //    }
         //}catch{}
     }
     this.Text       = "Đăng Nhập - " + FormUltils.getInstance().GetVersionInfo();
     lblVersion.Text = FormUltils.getInstance().GetVersionInfo();
 }
Example #3
0
 public FormHome()
 {
     InitializeComponent();
     timerMinute.Start();
     lblTime.Text = DateTime.Now.ToString("HH:mm");
     this.Text    = FormUltils.getInstance().GetFormText();
 }
 public FormCreateEditEmployee(IEmployeeServices employeeServices)
 {
     InitializeComponent();
     mEmployeeService = employeeServices;
     LoadAllEmployeeToListBox();
     this.Text = "Quản lý người dùng - " + FormUltils.getInstance().GetVersionInfo();
 }
 public static FormUltils getInstance()
 {
     if (utils == null)
     {
         utils = new FormUltils();
     }
     return(utils);
 }
        public FormConfigDB(IEmployeeServices employeeServices)
        {
            InitializeComponent();
            this._employeeServices = employeeServices;
            lblMessage.Text        = "";
            FillInfo();

            this.Text = "Cấu Hình - " + FormUltils.getInstance().GetVersionInfo();
        }
        public FormXnDenMawb(IMasterBillServices masterBillServices, IShipmentServices shipmentServices
                             , IBoxInforServices boxInforServices, IShipmentOutServices shipmentOutServices
                             , IManifestServices manifestServices)
        {
            InitializeComponent();
            _masterBillServices  = masterBillServices;
            _shipmentServices    = shipmentServices;
            _shipmentOutServices = shipmentOutServices;
            _boxInforServices    = boxInforServices;
            _manifestServices    = manifestServices;
            currentEmployee      = FormLogin.mEmployee;

            txtMAWB.Text = "";
            txtMAWB.Focus();
            CloseBox();
            ResetFormInfoNhap();
            btnXNĐ.Enabled = false;
            this.Text      = "Xác nhận đến theo MAWB- " + FormUltils.getInstance().GetVersionInfo();
        }
Example #8
0
 public FormXuat(IMasterBillServices masterBillServices, IShipmentServices shipmentServices
                 , IBoxInforServices boxInforServices, IShipmentOutServices shipmentOutServices, IBoxOutServices boxOutServices
                 )
 {
     InitializeComponent();
     _masterBillServices  = masterBillServices;
     _shipmentServices    = shipmentServices;
     _shipmentOutServices = shipmentOutServices;
     _boxInforServices    = boxInforServices;
     _boxOutServices      = boxOutServices;
     currentEmployee      = FormLogin.mEmployee;
     BuildingGridviewRow();
     AddDeleteButtonToGridView(grvShipmentListOut);
     dtpNgayXuat.CustomFormat = "dd/MM/yyyy";
     txtShipmentNo.Text       = "";
     ComboBoxBindData(cbbMasterBillOut);
     CloseBoxOut();
     cbbMasterBillOut.Focus();
     this.Text = "Xuất kho - " + FormUltils.getInstance().GetVersionInfo();
 }
 //private readonly string DECLARATIONNO = "Số TK";
 //private readonly string DATEOFCOMPLETION = "Ngày thông quan";
 public FormNhap(IMasterBillServices masterBillServices, IShipmentServices shipmentServices
                 , IBoxInforServices boxInforServices, IShipmentOutServices shipmentOutServices
                 , IManifestServices manifestServices, IShipmentOutTempServices shipmentOutTempServices)
 {
     InitializeComponent();
     _masterBillServices      = masterBillServices;
     _shipmentServices        = shipmentServices;
     _shipmentOutServices     = shipmentOutServices;
     _boxInforServices        = boxInforServices;
     _manifestServices        = manifestServices;
     _shipmentOutTempServices = shipmentOutTempServices;
     currentEmployee          = FormLogin.mEmployee;
     BuildingTheGridviewRowStrure();
     AddDeleteButtonToGridView(grvShipments);
     dtpNgayDen.CustomFormat = "dd/MM/yyyy";
     ResetHardCodeText();
     LoadAllMasterBillByDateToCombobox(cbbMasterBill);
     cbbMasterBill.SelectedText = "";
     FillInforXacNhanDen();
     CloseBox();
     ResetFormInfoNhap();
     dtpNgayDen.Focus();
     this.Text = "Xác nhận đến - " + FormUltils.getInstance().GetVersionInfo();
 }
Example #10
0
 public FormChangePassword(IEmployeeServices employeeServices)
 {
     InitializeComponent();
     mEmployeeService = employeeServices;
     this.Text        = "Đổi mật khẩu - " + FormUltils.getInstance().GetVersionInfo();
 }
Example #11
0
        private void ChiTietSanLuongXuatKho()
        {
            BoxOutEntity box = _boxOutServices.GetByBoxCode(cbbBoxIdOut.Text);

            if (box == null)
            {
                MessageBox.Show("Chọn mã thùng để in báo cáo!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            List <ShipmentExport> listDetail = _repositoryShipment.GetListShipmentByBoxId(box.Id);
            DataTable             table      = new DataTable();

            table.Columns.Add(StringHeaderReports.STT);
            table.Columns.Add(StringHeaderReports.MAWB);
            table.Columns.Add(StringHeaderReports.BOXID);
            table.Columns.Add(StringHeaderReports.SHIPMENTNO);
            //table.Columns.Add(StringHeaderReports.DECLARATION_NO, typeof(string));
            table.Columns.Add(StringHeaderReports.CONTENT);
            //table.Columns.Add(StringHeaderReports.NUMBER_PACKAGE);
            table.Columns.Add(StringHeaderReports.WEIGHT);

            int totalThung = 0, index = 1;
            int totalShipment;

            if (listDetail != null && listDetail.Count > 0)
            {
                totalShipment = listDetail.Count;
                totalThung    = 1;
                int boxId = listDetail[0].BoxIdRef;
                for (int i = 0; i < totalShipment; i++)
                {
                    // var shipment = listShipDetail.Find(t => t.ShipmentId == listDetail[i].ShipmentId);
                    DataRow row = table.NewRow();
                    row[StringHeaderReports.STT]        = index;
                    row[StringHeaderReports.MAWB]       = listDetail[i].MasterBillIdString;
                    row[StringHeaderReports.SHIPMENTNO] = "'" + listDetail[i].ShipmentId;
                    row[StringHeaderReports.BOXID]      = listDetail[i].BoxIdString;
                    row[StringHeaderReports.WEIGHT]     = listDetail[i].Weight;
                    row[StringHeaderReports.CONTENT]    = listDetail[i].Content;
                    table.Rows.Add(row);
                    index++;

                    if (boxId != listDetail[i].BoxIdRef)
                    {
                        totalThung++;
                        boxId = listDetail[i].BoxIdRef;
                    }
                }
            }
            else
            {
                MessageBox.Show("Chưa có hàng hóa nào được xuất kho!");
                return;
            }
            string infoHeader = "MÃ THÙNG: ";
            string value      = box.BoxId;

            Dictionary <string, string> first = new Dictionary <string, string>();

            first.Add("NGÀY XUẤT : ", dtpNgayXuat.Value.ToString("dd/MM/yyyy"));
            Dictionary <string, string> second = new Dictionary <string, string>();

            second.Add(infoHeader, value);
            second.Add("TỔNG SỐ ĐƠN HÀNG: ", "" + totalShipment);
            FormUltils.getInstance().ExportToExcel(table, "CT_Xuat_Kho_Theo_Thung", StringHeaderReports.REPORTS_NAME_CHI_TIET_XUAT_KHO, StringHeaderReports.REPORT_CODE_01, first, second);

            #region word report
            //int totalShipment;
            //if (listDetail != null && listDetail.Count > 0)
            //{
            //    totalShipment = listDetail.Count;
            //}
            //else
            //{
            //    MessageBox.Show("Chưa có đơn hàng của mã thùng này nào được xuất kho!", "Không có dữ liệu", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}

            //string fileName = Environment.CurrentDirectory + @"\ChiTietSanLuongXuatKho" + DateTime.Now.ToString("ddMMyyyHHmmss") + ".doc";
            //string companyName = "CÔNG TY CP CÔNG NGHỆ THẦN TỐC\t\t\t\t\t\tEMW01";
            //string headlineText = "BẢNG KÊ CHI TIẾT SẢN LƯỢNG XUẤT KHO";
            //string ngayDen = "NGÀY ĐẾN : " + dtpNgayXuat.Value.ToString("dd/MM/yyyy") + "\n"

            //                + "MÃ SỐ THÙNG: " + box.BoxId
            //                + "\t\t\tTỔNG ĐƠN HÀNG: " + totalShipment;
            //string boPhanGiaoNhan = "BỘ PHẬN KHO\t\t\t\t\t\tBỘ PHẬN GIAO NHẬN";

            //// A formatting object for our headline:
            //var headLineFormat = new Formatting();
            //headLineFormat.FontFamily = new System.Drawing.FontFamily("Times New Roman");
            //headLineFormat.Size = 18D;
            //headLineFormat.Position = 12;
            //headLineFormat.Bold = true;

            //// A formatting object for our normal paragraph text:
            //var paraFormat = new Formatting();
            //paraFormat.FontFamily = new System.Drawing.FontFamily("Times New Roman");
            //paraFormat.Size = 12D;
            //paraFormat.Position = 10;
            //paraFormat.Bold = false;


            //var paraRightFormat = new Formatting();
            //paraRightFormat.FontFamily = new System.Drawing.FontFamily("Times New Roman");
            //paraRightFormat.Size = 12D;
            //paraRightFormat.Position = 12;
            //paraRightFormat.Bold = true;

            //// Create the document in memory:
            //var doc = DocX.Create(fileName);

            //Table table = doc.AddTable(listDetail.Count + 1, 7);

            ////table.ColumnWidths.Add(100); table.ColumnWidths.Add(500); table.ColumnWidths.Add(100);

            //table.Rows[0].Cells[0].Paragraphs.First().Append("STT").Font(new FontFamily("Times New Roman"));
            ////table.Rows[0].Cells[0].Width = 50;
            //table.Rows[0].Cells[1].Paragraphs.First().Append("Vận đơn chủ (MAWB)").Font(new FontFamily("Times New Roman")).Alignment = Alignment.center;
            ////table.Rows[0].Cells[1].Width = 800;
            //table.Rows[0].Cells[2].Paragraphs.First().Append("Mã đơn hàng (ShipmentNo)").Font(new FontFamily("Times New Roman")).Alignment = Alignment.center;
            //table.Rows[0].Cells[3].Paragraphs.First().Append("Mã thùng (BoxId)").Font(new FontFamily("Times New Roman")).Alignment = Alignment.center;
            //table.Rows[0].Cells[4].Paragraphs.First().Append("Nội dung (Content)").Font(new FontFamily("Times New Roman")).Alignment = Alignment.center;
            //table.Rows[0].Cells[5].Paragraphs.First().Append("Số lượng (Quantity)").Font(new FontFamily("Times New Roman")).Alignment = Alignment.center;
            //table.Rows[0].Cells[6].Paragraphs.First().Append("Trọng lượng (Weight)").Font(new FontFamily("Times New Roman")).Alignment = Alignment.center;
            ////table.Rows[0].Cells[2].Width = 100;
            //table.Rows[0].Cells[0].FillColor = Color.FromName("DarkGray");
            //table.Rows[0].Cells[1].FillColor = Color.FromName("DarkGray");
            //table.Rows[0].Cells[2].FillColor = Color.FromName("DarkGray");
            //table.Rows[0].Cells[3].FillColor = Color.FromName("DarkGray");
            //table.Rows[0].Cells[4].FillColor = Color.FromName("DarkGray");
            //table.Rows[0].Cells[5].FillColor = Color.FromName("DarkGray");
            //table.Rows[0].Cells[6].FillColor = Color.FromName("DarkGray");


            //for (int i = 0; i < totalShipment; i++)
            //{
            //    table.Rows[i + 1].Cells[0].Paragraphs.First().Append((i + 1) + "").Font(new FontFamily("Times New Roman"));
            //    table.Rows[i + 1].Cells[1].Paragraphs.First().Append(listDetail[i].MasterBillIdString).Font(new FontFamily("Times New Roman"));
            //    table.Rows[i + 1].Cells[2].Paragraphs.First().Append(listDetail[i].ShipmentId).Font(new FontFamily("Times New Roman"));
            //    table.Rows[i + 1].Cells[3].Paragraphs.First().Append(listDetail[i].BoxIdString).Font(new FontFamily("Times New Roman"));
            //    table.Rows[i + 1].Cells[4].Paragraphs.First().Append("").Font(new FontFamily("Times New Roman"));
            //    table.Rows[i + 1].Cells[5].Paragraphs.First().Append("").Font(new FontFamily("Times New Roman"));
            //    table.Rows[i + 1].Cells[6].Paragraphs.First().Append("").Font(new FontFamily("Times New Roman"));
            //}

            //doc.InsertParagraph(companyName, false, paraFormat);
            //doc.InsertParagraph(Environment.NewLine);
            //// Insert the now text obejcts;
            //Paragraph title = doc.InsertParagraph(headlineText, false, headLineFormat);
            //title.Alignment = Alignment.center;
            //doc.InsertParagraph(ngayDen, false, paraFormat);
            //doc.InsertTable(table);
            //doc.InsertParagraph(Environment.NewLine);
            //Paragraph giaoNhan = doc.InsertParagraph(boPhanGiaoNhan, false, paraRightFormat);
            //giaoNhan.Alignment = Alignment.center;
            //// Save to the output directory:

            //doc.SaveAs(fileName);
            //// Open in Word:
            //Process.Start("WINWORD.EXE", "\"" + fileName + "\"");
            #endregion
        }