Ejemplo n.º 1
0
 public Entities.HangHoaGoiHang Select(Entities.HangHoaGoiHang values)
 {
     Entities.HangHoaGoiHang data = null;
     try
     {
         Entities.QuyDoiDonViTinh[] quydoi = new BizLogic.QuyDoiDonViTinh().Select();
         if (quydoi!=null)
         {
             for (int k = 0; k < quydoi.Length; k++)
             {
                 if (quydoi[k].MaHangQuyDoi.ToUpper() == values.MaHang.ToUpper())
                 {
                     this.HangHoa(quydoi[k].MaHangDuocQuyDoi);
                     data = new Entities.HangHoaGoiHang();
                     data.TenHang = quydoi[k].TenHangDuocQuyDoi;
                     data.MaHang = quydoi[k].MaHangDuocQuyDoi;
                     data.SoLuong = quydoi[k].SoLuongDuocQuyDoi.ToString();
                     data.GiaNhap = this.gianhap;
                     data.GiaBanBuon = this.giabanbuon;
                     data.GiaBanLe = this.giabanle;
                     data.Thue = this.thue;
                     break;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message.ToString();
         data = null;
     }
     return data;
 }
Ejemplo n.º 2
0
 public Entities.HangHoaGoiHang Select(Entities.HangHoaGoiHang values)
 {
     Entities.HangHoaGoiHang data = null;
     try
     {
         Entities.QuyDoiDonViTinh[] quydoi = new BizLogic.QuyDoiDonViTinh().Select();
         if (quydoi != null)
         {
             for (int k = 0; k < quydoi.Length; k++)
             {
                 if (quydoi[k].MaHangQuyDoi.ToUpper() == values.MaHang.ToUpper())
                 {
                     this.HangHoa(quydoi[k].MaHangDuocQuyDoi);
                     data            = new Entities.HangHoaGoiHang();
                     data.TenHang    = quydoi[k].TenHangDuocQuyDoi;
                     data.MaHang     = quydoi[k].MaHangDuocQuyDoi;
                     data.SoLuong    = quydoi[k].SoLuongDuocQuyDoi.ToString();
                     data.GiaNhap    = this.gianhap;
                     data.GiaBanBuon = this.giabanbuon;
                     data.GiaBanLe   = this.giabanle;
                     data.Thue       = this.thue;
                     break;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message.ToString();
         data = null;
     }
     return(data);
 }
Ejemplo n.º 3
0
 public Entities.HangHoaGoiHang[] Select()
 {
     Entities.HangHoaGoiHang[] data = null;
     try
     {
         ArrayList          list    = new ArrayList();
         Entities.GoiHang[] goi     = new BizLogic.GoiHang().Select();
         Entities.HangHoa[] hanghoa = new BizLogic.HangHoa().Select();
         if (goi != null)
         {
             for (int k = 0; k < goi.Length; k++)
             {
                 Entities.HangHoaGoiHang row = new Entities.HangHoaGoiHang();
                 row.TenHang    = goi[k].TenGoiHang;
                 row.MaHang     = goi[k].MaGoiHang;
                 row.GiaNhap    = goi[k].GiaNhap;
                 row.GiaBanBuon = goi[k].GiaBanBuon;
                 row.GiaBanLe   = goi[k].GiaBanLe;
                 row.Thue       = "0";
                 list.Add(row);
             }
         }
         if (hanghoa != null)
         {
             for (int k = 0; k < hanghoa.Length; k++)
             {
                 Entities.HangHoaGoiHang row = new Entities.HangHoaGoiHang();
                 row.TenHang    = hanghoa[k].TenHangHoa;
                 row.MaHang     = hanghoa[k].MaHangHoa;
                 row.GiaNhap    = hanghoa[k].GiaNhap;
                 row.GiaBanBuon = hanghoa[k].GiaBanBuon;
                 row.GiaBanLe   = hanghoa[k].GiaBanLe;
                 row.Thue       = Thue(hanghoa[k].MaThueGiaTriGiaTang);
                 list.Add(row);
             }
         }
         int n = list.Count;
         if (n == 0)
         {
             data = null;
         }
         data = new Entities.HangHoaGoiHang[n];
         for (int i = 0; i < n; i++)
         {
             data[i] = (Entities.HangHoaGoiHang)list[i];
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message.ToString();
         data = null;
     }
     return(data);
 }
Ejemplo n.º 4
0
 public Entities.HangHoaGoiHang[] Select()
 {
     Entities.HangHoaGoiHang[] data = null;
     try
     {
         ArrayList list = new ArrayList();
         Entities.GoiHang[] goi = new BizLogic.GoiHang().Select();
         Entities.HangHoa[] hanghoa = new BizLogic.HangHoa().Select();
         if (goi!= null)
         {
             for (int k = 0; k < goi.Length; k++)
             {
                 Entities.HangHoaGoiHang row = new Entities.HangHoaGoiHang();
                 row.TenHang = goi[k].TenGoiHang;
                 row.MaHang = goi[k].MaGoiHang;
                 row.GiaNhap = goi[k].GiaNhap;
                 row.GiaBanBuon = goi[k].GiaBanBuon;
                 row.GiaBanLe = goi[k].GiaBanLe;
                 row.Thue = "0";
                 list.Add(row);
             }
         }
         if (hanghoa!=null)
         {
             for (int k = 0; k < hanghoa.Length; k++)
             {
                 Entities.HangHoaGoiHang row = new Entities.HangHoaGoiHang();
                 row.TenHang = hanghoa[k].TenHangHoa;
                 row.MaHang = hanghoa[k].MaHangHoa;
                 row.GiaNhap = hanghoa[k].GiaNhap;
                 row.GiaBanBuon = hanghoa[k].GiaBanBuon;
                 row.GiaBanLe = hanghoa[k].GiaBanLe;
                 row.Thue =Thue(hanghoa[k].MaThueGiaTriGiaTang);
                 list.Add(row);
             }
         }
         int n = list.Count;
         if (n == 0) { data = null; }
         data = new Entities.HangHoaGoiHang[n];
         for (int i = 0; i < n; i++)
         {
             data[i] = (Entities.HangHoaGoiHang)list[i];
         }
     }
     catch (Exception ex)
     {
         string s = ex.Message.ToString();
         data = null;
     }
     return data;
 }
Ejemplo n.º 5
0
 private void QuyDoi(string mahang)
 {
     try
     {
         Entities.HangHoaGoiHang dat = new Entities.HangHoaGoiHang();
         dat.Hanhdong = "Select";
         dat.MaHang = mahang;
         cl = new Server_Client.Client();
         this.client = cl.Connect(Luu.IP, Luu.Ports);
         clientstrem = cl.SerializeObj(this.client, "QuyDoi", dat);
         quydoiDonViTinh = new Entities.HangHoaGoiHang();
         quydoiDonViTinh = (Entities.HangHoaGoiHang)cl.DeserializeHepper(clientstrem, quydoiDonViTinh);
         client.Close();
         clientstrem.Close();
         if (quydoiDonViTinh.MaHang != null)
         {
             toolStrip_txtTracuu.Text = quydoiDonViTinh.MaHang;
             toolStrip_txtTenhang.Text = quydoiDonViTinh.TenHang;
             toolStrip_txtGiagoc.Text = quydoiDonViTinh.GiaNhap;
             toolStrip_txtSoluong.Text = (float.Parse(toolStrip_txtSoluong.Text) * float.Parse(quydoiDonViTinh.SoLuong)).ToString();
             toolStrip_txtGianhap.Text = quydoiDonViTinh.GiaNhap;
             toolStrip_txtThuegiatrigiatang.Text = quydoiDonViTinh.Thue;
             banbuon = quydoiDonViTinh.GiaBanBuon;
             banle = quydoiDonViTinh.GiaBanLe;
             giatrigiatang = quydoiDonViTinh.Thue;
         }
     }
     catch (Exception ex)
     { string s = ex.Message; }
 }