示例#1
0
 public BillDetails()
 {
     InitializeComponent();
     billBLL      = new BillBLL();
     computersBLL = new ComputersBLL();
     clientsBLL   = new ClientsBLL();
 }
示例#2
0
        // thanh toán
        protected void btnThanhToan_Click(object sender, EventArgs e)
        {
            CustomerBLL b1 = new CustomerBLL();

            b1.Insert(txtNameCus.Text, txtAddressCus.Text, txtPhoneCus.Text);
            string id_cus = b1.getByIdJustCreated()[0].Id;

            BillBLL b2 = new BillBLL();

            b2.Insert(id_cus, DateTime.Parse(txtDateDelivery.Text), Int32.Parse("1"));
            string id_bill = b2.getByIdJustCreated()[0].Id;


            BillDetailsBLL b3   = new BillDetailsBLL();
            DataTable      cart = (DataTable)Session["cart"];

            foreach (DataRow r in cart.Rows)
            {
                string     id_pro   = r[0].ToString();
                int        price    = Int32.Parse(r[2].ToString());
                int        qty      = Int32.Parse(r[3].ToString());
                int        discount = Int32.Parse(txtDiscount.Text);
                int        amount   = price * qty - price * discount / 100;
                ProductBLL b4       = new ProductBLL();
                int        qty_pro  = b4.getById(id_pro)[0].Qty; // lấy giá trị số lượng tồn
                b3.Insert(id_bill, id_pro, qty_pro, qty, price, discount, amount);
            }
            for (int i = 0; i < gv_Cart.Rows.Count; i++)
            {
                gv_Cart.DeleteRow(i);
            }
            Session.Contents.Remove("cart");
        }
示例#3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            BillBLL billBLL = new BillBLL();
            BusBLL  bus     = new BusBLL();

            initDataforbus();
            dgvbus.DataSource    = bus.GetALl();
            dgvbileta.DataSource = billBLL.GetALl();
        }
示例#4
0
        private void initDataforbus()
        {
            BillBLL billBLL = new BillBLL();

            cbbiletaa.DataSource    = billBLL.GetALl();
            cbbiletaa.DisplayMember = "Cmimi";
            cbbiletaa.ValueMember   = "billid";
            cbbiletaa.SelectedIndex = -1;
        }
示例#5
0
        public FormSellBook()
        {
            InitializeComponent();
            CustomerController = new CustomerBLL();
            BookController     = new BookBLL();
            //bookSelected = new Book();
            BillController = new BillBLL();
            RuleController = new MyRuleBLL();

            ClearAndReload();
            rules = RuleController.GetRules();
        }
 public FormCustomerData()
 {
     InitializeComponent();
     BillController     = new BillBLL();
     CustomerController = new CustomerBLL();
     customers          = new List <Customer>();
     bills            = new List <Bill>();
     this.customers   = CustomerController.GetCustomers();
     this.cuschosen   = new Customer();
     this.billDetails = new List <Bill>();
     ClearAndReload();
 }
        private void BtnRegisterReturn_Click(object sender, EventArgs e)
        {
            try
            {
                if (borrBO != null)
                {
                    brBO    = new BorrowReturn();
                    brBLL   = new BorrowReturnBLL();
                    bill    = new Bill();
                    billBLL = new BillBLL();



                    brBO.BorrowId   = borrBO.BorrowId;
                    brBO.ReturnDate = DateTime.Now;
                    brBO.Comment    = "ska tash";
                    brBO.InsBy      = FormLoggedUser.Id;



                    if (PayBill)
                    {
                        bill.BillingDate  = DateTime.Now;
                        bill.BillTypeId   = 2;
                        bill.MaterialId   = borrBO.materialId;
                        bill.SubscriberId = borrBO.SubscriberId;
                        bill.Price        = delayfee;
                        bill.InsBy        = FormLoggedUser.Id;

                        brBO.BillId = billBLL.Add(bill);

                        if (brBO.BillId < 1)
                        {
                            throw new Exception();
                        }
                    }

                    brBLL.Add(brBO);
                }
                else
                {
                    MessageBox.Show("Material wasn't provided");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Material is not returned, contact your administrator");
            }
        }
示例#8
0
        public ApiResult <List <BillResModel> > GetBill(BillReqModel req)
        {
            //查询开始时间和结束时间必须30天内
            if (req == null || req.StartTime >= req.EndTime || (req.EndTime - req.StartTime).TotalDays > 30)
            {
                return(Error <List <BillResModel> >(ApiResultCode.BadRequest));
            }
            var data   = BillBLL.GetBill(req.Member, req.Type, req.StartTime, req.EndTime);
            var result = data.Select(s =>
            {
                var temp    = new BillResModel();
                temp.Id     = s.Id;
                temp.Member = s.member;
                return(temp);
            }).ToList();

            return(Success(result));
        }
示例#9
0
        //QUẢN LÝ HÓA ĐƠN
        public void DuaDSHoaDonLenDataGridView()
        {
            DataTable _dshd = BillBLL.LayDSHoaDon();

            dgvDSHD.DataSource = _dshd;
        }
示例#10
0
 public MainForm()
 {
     InitializeComponent();
     computers = new ComputersBLL();
     billBLL   = new BillBLL();
 }
 public ComputerStart()
 {
     InitializeComponent();
     billBll     = new BillBLL();
     computerBll = new ComputersBLL();
 }