Exemplo n.º 1
0
        public static int DeletDetailReceiptNote(TTPhieuNhapDTO chitiet)
        {
            string sqlstr = $"EXEC dbo.DeletDetailReceiptNote '{chitiet.Mapn}', '{chitiet.Mads.Mads}' ";

            MySQL.Open();
            int numrow = MySQL.ExecuteNonSQL(sqlstr);

            MySQL.Close();
            return(numrow);
        }
Exemplo n.º 2
0
        public static int ChangDetailReceiptNote(TTPhieuNhapDTO chitiet)
        {
            string sqlstr = $"EXEC dbo.UpdatDetailReceiptNote '{chitiet.Mapn}', '{chitiet.Mads.Mads}', {chitiet.Dongia}, {chitiet.Soluong}, '{chitiet.Ngaygiao}' ";

            MySQL.Open();
            int numrow = MySQL.ExecuteNonSQL(sqlstr);

            MySQL.Close();
            return(numrow);
        }
Exemplo n.º 3
0
 public PDeliveryNote(TTPhieuNhapDTO chitiet)
 {
     InitPanelDeliveryNote();
     this.Chitiet         = chitiet;
     lblNameTitle.Text    = chitiet.DauSach;
     lblQuantity.Text     = chitiet.Soluong.ToString();
     lblPrice.Text        = chitiet.Dongia.ToString("#,0");
     lblDeliveryDay.Text  = chitiet.Ngaygiao.ToShortDateString();
     lblNameSupplier.Text = chitiet.NXB;
 }
Exemplo n.º 4
0
 /* Phương thức kiểm tra đơn nhập đã được chọn chưa */
 private bool CheckReceNote(TTPhieuNhapDTO chitiet)
 {
     foreach (PDeliveryNote item in pnldeliveryNotes)
     {
         if (item.Chitiet == chitiet)
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 5
0
 public PReceiptNote(TTPhieuNhapDTO chiTiet, bool Deli)
 {
     InitPanelReceiptNote(false);
     this.Enabled         = Deli;
     dauSach              = chiTiet.Mads;
     lblNameTitle.Text    = dauSach.Ten;
     nudQuantity.Value    = chiTiet.Soluong;
     nudPrice.Value       = chiTiet.Dongia;
     dtpDeliveryDay.Value = chiTiet.Ngaygiao;
     lblNameSupplier.Text = chiTiet.NXB;
     nhaCungCap           = chiTiet.Manxb;
 }
Exemplo n.º 6
0
        /* Sự kiện thêm một đơn chưa giao bằng việc tạo một panel sách giao */
        private void dgvReceNote_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            TTPhieuNhapDTO chitiet = (dgvReceNote.DataSource as List <TTPhieuNhapDTO>)[e.RowIndex];

            if (CheckReceNote(chitiet))
            {
                pnldeliveryNotes.Add(new PDeliveryNote(chitiet));
                flpDetail.Controls.Add(pnldeliveryNotes[pnldeliveryNotes.Count - 1]);
                lblSumPrice.Text = SumPrice().ToString("#,0");
            }
        }