예제 #1
0
 public bool insertShopCollectTime(ShopCollectTime obj)
 {
     if (SqlDbmanager.ExecuteNonQry(SqlExtension.GetInsertSqlCmd("ShopCollectTime", obj)))
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
 public bool deleteShopCollectTime(ShopCollectTime obj)
 {
     if (SqlDbmanager.ExecuteNonQry(SqlExtension.GetDeleteSqlCmd("ShopCollectTime", obj, new List <string> {
         "SCT02=@SCT02", "SCT03=@SCT03", "SCT04=@SCT04"
     })))
     {
         return(true);
     }
     return(false);
 }
예제 #3
0
        private static List <ShopCollectTime> MapShopCollectTime(List <PrescoShopCollect> shopCollectionResponses)
        {
            var result = new List <ShopCollectTime>();

            foreach (var shopcollect in shopCollectionResponses)
            {
                foreach (var item in shopcollect.data)
                {
                    foreach (var time in item.OpeningHours)
                    {
                        var shopcollectdaily = new ShopCollectTime();
                        shopcollectdaily.SCT02 = item.Name;
                        shopcollectdaily.SCT03 = item.ShortName;
                        shopcollectdaily.SCT04 = time.DayofWeek + 1;
                        shopcollectdaily.SCT05 = time.StartTime;
                        shopcollectdaily.SCT06 = time.EndTime;
                        result.Add(shopcollectdaily);
                    }
                }
            }
            return(result);
        }
예제 #4
0
 private static bool IsNewShopCollectTime(ShopCollectTime shopCollectTime, DataTable existingShopCollectTime)
 {
     return(!existingShopCollectTime.AsEnumerable().Any(x => x.Field <string>("SCT02") == shopCollectTime.SCT02 &&
                                                        x.Field <string>("SCT03") == shopCollectTime.SCT03 &&
                                                        x.Field <int>("SCT04") == shopCollectTime.SCT04));
 }