예제 #1
0
 public MainForm()
 {
     InitializeComponent();
     _supplierBusinessLogic    = new SupplierBusinessLogic();
     _productBusinessLogic     = new ProductBusinessLogic();
     _userBusinessLogic        = new UserBusinessLogic();
     _billBusinessLogic        = new BillBusinessLogic();
     _shipperBusinessLogic     = new ShipperBussinessLogic();
     _productTypeBusinessLogic = new ProductTypeBusinessLogic();
     _importBusinessLogic      = new ImportBusinessLogic();
 }
        public BillDetailForm(int?BillId = null, int?CusId = null, int?ShipperId = null)
        {
            InitializeComponent();
            _billBusinessLogic            = new BillBusinessLogic();
            _billDetailBusinessLogicLayer = new BillDetailBusinessLogicLayer();
            _shipperBussinessLogic        = new ShipperBussinessLogic();
            _userBusinessLogic            = new UserBusinessLogic();
            _productBusinessLogic         = new ProductBusinessLogic();

            if (BillId == null || CusId == null || ShipperId == null)
            {
                return;
            }
            _BillId    = (int)BillId;
            _CusId     = (int)CusId;
            _ShipperId = (int)ShipperId;

            btn_UpdateNote.Enabled           = false;
            btn_UpdateShipperForBill.Enabled = false;
            rTxtB_Note.Enabled = false;

            bill                 = _billBusinessLogic.GetBillById(_BillId);
            txtB_BillId.Text     = bill.Id.ToString();
            txtB_BillStatus.Text = bill.Status;
            txtB_DateOrder.Text  = bill.DateOrder.ToString();
            txtB_TotalMoney.Text = bill.Total.ToString();
            txtB_Addr.Text       = bill.Addr;
            txtB_Dis.Text        = bill.Dis;
            txtB_city.Text       = bill.City;
            rTxtB_Note.Text      = bill.Note;

            customer          = _userBusinessLogic.GetDetailUser(_CusId);
            txtB_NameCus.Text = customer.Name;

            GridView_BillDetails.DataSource = _billDetailBusinessLogicLayer.GetBillDetailsByBillId(_BillId);


            if (_ShipperId == 0)
            {
                return;
            }

            shipper = _shipperBussinessLogic.GetDetailShipper(_ShipperId);
            txtB_ShiperName.Text   = shipper.Name;
            txtB_ShipperEmail.Text = shipper.Email;
            txtB_ShipperPhone.Text = shipper.Phone;
        }
예제 #3
0
        public NewShipperForm(int?rowId = null)
        {
            InitializeComponent();
            _shipperBussinessLogic = new ShipperBussinessLogic();
            if (rowId == null)
            {
                return;
            }
            btn_InsertShipper.Text = @"Cập nhật";
            _isUpdate = true;
            _rowId    = (int)rowId;

            var shipper = _shipperBussinessLogic.GetDetailShipper(_rowId);

            txtB_NameShipper.Text  = shipper.Name;
            txtB_EmailShipper.Text = shipper.Email;
            txtB_PhoneShipper.Text = shipper.Phone;
        }