Example #1
0
 internal static List <SPP_GetShopById_Result> FindALLShop()
 {
     using (IDalShop dal = new DalShop())
     {
         List <SPP_GetShopById_Result> shops = new List <SPP_GetShopById_Result>();
         dal.GetALLShop();
         return(shops);
     }
 }
Example #2
0
 internal static SPP_GetShopById_Result FindShopById(int id, int language)
 {
     using (IDalShop dal = new DalShop())
     {
         List <SPP_GetShopById_Result> result    = dal.GetShopById(id);
         SPP_GetShopById_Result        newResult = result.Where(r => r.languageId == language).Single();
         return(newResult);
     }
 }
Example #3
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="shopManagerId"></param>
        /// <param name="shopName"></param>
        public BlShop(string shopManagerId, string shopName)
        {
            try
            {
                Id       = DalShop.AddShop(shopManagerId, shopName);
                Location = this.GetPosition();
            }
            catch
            {
                Id = -1;
            }
            ShopManagerId = shopManagerId;

            ShopName = shopName;
        }
Example #4
0
        /// <summary>
        /// a new shop by shop id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static BlShop GetShopById(int id)
        {
            DataRow row = null;

            try
            {
                row = DalShop.GetShop(id);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);

                return(null);
            }
            return(new BlShop(row));
        }
Example #5
0
 public int InsertShopBanner(ShopAppBanner banner)
 {
     return(dbManager.Execute(connection => DalShop.InsertShopBanner(connection, banner)));
 }
Example #6
0
 public int UpdateShopBanner(ShopAppBanner banner)
 {
     return(dbManager.Execute(connection => DalShop.UpdateShopBanner(connection, banner)));
 }
Example #7
0
 public int DeleteShopBannerByPKID(int PKID)
 {
     return(dbManager.Execute(connection => DalShop.DeleteShopBannerByPKID(connection, PKID)));
 }
Example #8
0
 public ShopAppBanner GetAppShopBannerByPKID(int _PKID)
 {
     return(dbManager.Execute(connection => DalShop.GetAppShopBannerByPKID(connection, _PKID)));
 }
Example #9
0
 public List <ShopAppBanner> GetShopAppBannerList()
 {
     return(dbManager.Execute(connection => DalShop.GetShopAppBannerList(connection)));
 }
Example #10
0
 public string GetSimpleNameByShopID(int ShopID)
 {
     return(dbManager.Execute(connection => DalShop.GetSimpleNameByShopID(connection, ShopID)));
 }
Example #11
0
        /// <summary>
        /// get the shop location
        /// </summary>
        /// <returns>point object that represent the shop location</returns>
        public Point GetPosition()
        {
            DataRow row = DalShop.GetLocation(this.Id);

            return(new Point(double.Parse(row["Lat"].ToString()), double.Parse(row["Lng"].ToString())));
        }
Example #12
0
        /// <summary>
        /// get all the shop in DB
        /// </summary>
        /// <returns> shop list</returns>
        public static List <BlShop> GetShops()
        {
            DataTable shops = DalShop.GetShopTable();

            return((from DataRow row in shops.Rows select new BlShop(row)).ToList());
        }