Beispiel #1
0
        public Entities.ChiTietHDBanHang[] LayChiTiet_HDBanHang_TheoMaPhieu(string maHD)
        {
            int count = 0;

            for (int i = 0; i < ctHDBanHang.Length; i++)
            {
                if (ctHDBanHang[i].MaHDBanHang == maHD)
                {
                    count++;
                }
            }
            Entities.ChiTietHDBanHang[] ctHDBanHang_TheoMaHD = new Entities.ChiTietHDBanHang[count];
            count = 0;
            for (int i = 0; i < ctHDBanHang.Length; i++)
            {
                if (ctHDBanHang[i].MaHDBanHang == maHD)
                {
                    ctHDBanHang_TheoMaHD[count] = ctHDBanHang[i];
                    count++;
                }
            }
            if (ctHDBanHang_TheoMaHD == null)
            {
                ctHDBanHang_TheoMaHD = new Entities.ChiTietHDBanHang[0];
                return(ctHDBanHang_TheoMaHD);
            }
            else
            {
                return(ctHDBanHang_TheoMaHD);
            }
        }
Beispiel #2
0
 public Entities.ChiTietHDBanHang[] ChiTietHDBanHang()
 {
     Entities.ChiTietHDBanHang[] chitiethdbanhang = new BizLogic.CheckRefer().ChiTietHDBanHang();
     if (chitiethdbanhang == null)
     {
         chitiethdbanhang = new Entities.ChiTietHDBanHang[0];
     }
     return(chitiethdbanhang);
 }
Beispiel #3
0
 public void LayChiTiet_HDBanHang()
 {
     Entities.ChiTietHDBanHang[] ctHDBanHang1 = new Entities.ChiTietHDBanHang[0];
     ctHDBanHang1 = new BizLogic.ChiTietHDBanHang().Select();
     if (ctHDBanHang1 == null)
     {
         ctHDBanHang = new Entities.ChiTietHDBanHang[0];
         return;
     }
     ctHDBanHang = ctHDBanHang1;
 }
 public void LayChiTiet_HDBanHang()
 {
     cl          = new Server_Client.Client();
     this.client = cl.Connect(Luu.IP, Luu.Ports);
     Entities.ChiTietHDBanHang ctxh = new Entities.ChiTietHDBanHang("SelectSon");
     clientstrem = cl.SerializeObj(this.client, "ChiTietHDBanHang", ctxh);
     Entities.ChiTietHDBanHang[] ctHDBanHang1 = new Entities.ChiTietHDBanHang[0];
     ctHDBanHang1 = (Entities.ChiTietHDBanHang[])cl.DeserializeHepper1(clientstrem, ctHDBanHang1);
     if (ctHDBanHang1 == null)
     {
         ctHDBanHang = new Entities.ChiTietHDBanHang[0];
         return;
     }
     ctHDBanHang = ctHDBanHang1;
 }
Beispiel #5
0
        /// <summary>
        /// Lay gia von cu goi hang = sl * ginhap.
        /// </summary>
        /// <param name="ct"></param>
        /// <param name="gh"></param>
        /// <returns></returns>
        public double LayGiaVonGoiHang(Entities.ChiTietHDBanHang ct, Entities.GoiHang[] gh)
        {
            double retVal = 0;

            try
            {
                foreach (Entities.GoiHang item in gh)
                {
                    if (ct.MaHangHoa.Equals(item.MaGoiHang))
                    {
                        retVal = ct.SoLuong * double.Parse(item.GiaNhap);
                        break;
                    }
                }
            }
            catch
            {
                retVal = 0;
            }
            return(retVal);
        }
Beispiel #6
0
        /// <summary>
        /// Lay gia von cua hang hoa = sl * giaNhap.
        /// </summary>
        /// <param name="ct"></param>
        /// <param name="hh"></param>
        /// <returns></returns>
        public double LayGiaVonHangHoa(Entities.ChiTietHDBanHang ct)
        {
            double retVal = 0;

            try
            {
                var query = from gv in giaVon
                            where gv.MaHoaDon.Equals(ct.MaHDBanHang) &&
                            gv.MaHangHoa.Equals(ct.MaHangHoa)
                            select gv;

                Entities.GiaVonBanHang[] gvArr = query.ToArray();
                if (gvArr != null && gvArr.Length > 0)
                {
                    retVal = ct.SoLuong * double.Parse(gvArr[0].GiaVon.ToString());
                }
            }
            catch
            {
                retVal = 0;
            }

            return(retVal);
        }
 public Entities.ChiTietHDBanHang[] LayChiTiet_HDBanHang_TheoMaPhieu(string maHD)
 {
     int count = 0;
     for (int i = 0; i < ctHDBanHang.Length; i++)
     {
         if (ctHDBanHang[i].MaHDBanHang == maHD)
         {
             count++;
         }
     }
     Entities.ChiTietHDBanHang[] ctHDBanHang_TheoMaHD = new Entities.ChiTietHDBanHang[count];
     count = 0;
     for (int i = 0; i < ctHDBanHang.Length; i++)
     {
         if (ctHDBanHang[i].MaHDBanHang == maHD)
         {
             ctHDBanHang_TheoMaHD[count] = ctHDBanHang[i];
             count++;
         }
     }
     if (ctHDBanHang_TheoMaHD == null)
     {
         ctHDBanHang_TheoMaHD = new Entities.ChiTietHDBanHang[0];
         return ctHDBanHang_TheoMaHD;
     }
     else
     {
         return ctHDBanHang_TheoMaHD;
     }
 }
 public void LayChiTiet_HDBanHang()
 {
     Entities.ChiTietHDBanHang[] ctHDBanHang1 = new Entities.ChiTietHDBanHang[0];
     ctHDBanHang1 = new BizLogic.ChiTietHDBanHang().Select();
     if (ctHDBanHang1 == null)
     {
         ctHDBanHang = new Entities.ChiTietHDBanHang[0];
         return;
     }
     ctHDBanHang = ctHDBanHang1;
 }
 public void LayChiTiet_HDBanHang()
 {
     cl = new Server_Client.Client();
     this.client = cl.Connect(Luu.IP, Luu.Ports);
     Entities.ChiTietHDBanHang ctxh = new Entities.ChiTietHDBanHang("SelectSon");
     clientstrem = cl.SerializeObj(this.client, "ChiTietHDBanHang", ctxh);
     Entities.ChiTietHDBanHang[] ctHDBanHang1 = new Entities.ChiTietHDBanHang[0];
     ctHDBanHang1 = (Entities.ChiTietHDBanHang[])cl.DeserializeHepper1(clientstrem, ctHDBanHang1);
     if (ctHDBanHang1 == null)
     {
         ctHDBanHang = new Entities.ChiTietHDBanHang[0];
         return;
     }
     ctHDBanHang = ctHDBanHang1;
 }
Beispiel #10
0
 public Entities.ChiTietHDBanHang[] ChiTietHDBanHang()
 {
     Entities.ChiTietHDBanHang[] chitiethdbanhang = new BizLogic.CheckRefer().ChiTietHDBanHang();
     if (chitiethdbanhang == null)
         chitiethdbanhang = new Entities.ChiTietHDBanHang[0];
     return chitiethdbanhang;
 }