public static StorePage QuerySearchResultPage(int sellerSysNo) { var filter = new StorePageFilter(); filter.PageType = "SearchResult"; return(StoreDA.QueryStorePage(filter)); }
/// <summary> /// 一周排行 /// </summary> /// <param name="MerchantSysNo"></param> /// <param name="CategoryCode"></param> /// <param name="languageCode"></param> /// <param name="companyCode"></param> /// <returns></returns> public static List <RecommendProduct> QueryWeekRankingForCategoryCode( int MerchantSysNo, string CategoryCode, int count, string languageCode = "zh-CN", string companyCode = "8601") { string cacheKey = CommonFacade.GenerateKey("QueryWeekRankingForCategoryCode", CategoryCode, languageCode, companyCode, MerchantSysNo.ToString()); if (HttpRuntime.Cache[cacheKey] != null) { return((List <RecommendProduct>)HttpRuntime.Cache[cacheKey]); } var p1 = StoreDA.QueryWeekRankingForCategoryCode(MerchantSysNo, CategoryCode); if (p1.Count < count) { var p2 = StoreDA.QuerySuperSpecialProductForCategoryCode(MerchantSysNo, CategoryCode, languageCode, companyCode); p2.ForEach(p => { if (p1.All(f => f.SysNo != p.SysNo)) { p1.Add(p); } }); } List <RecommendProduct> result = p1.Take(count).ToList(); HttpRuntime.Cache.Insert(cacheKey, result, null, DateTime.Now.AddSeconds(CacheTime.Long), Cache.NoSlidingExpiration); return(result); }
public static int SaveStoreAttachment(List <StoreAttachment> attas) { if (attas.Count <= 0) { return(0); } using (var trans = TransactionManager.Create()) { //StoreDA.DeleteAttachmentBySellerSysNo(attas[0].SellerSysNo.Value); foreach (var item in attas) { if (item.SysNo.HasValue) { //TODO update StoreDA.UpdateStoreAttachment(item); } else { StoreDA.InsertStoreAttachment(item); } } trans.Complete(); } return(1); }
/// <summary> /// 根据PageTypeKey获取页面元素 /// </summary> /// <param name="pageTypeKey"></param> public static Dictionary <string, List <StorePageElement> > GetPageElementByPageTypeKey(string pageTypeKey) { List <StorePageElement> list = StoreDA.GetPageElementByPageTypeKey(pageTypeKey); Dictionary <string, List <StorePageElement> > dic = new Dictionary <string, List <StorePageElement> >(); if (list != null && list.Count > 0) { foreach (var item in list) { if (!string.IsNullOrEmpty(item.ElementGroupName)) { if (dic.ContainsKey(item.ElementGroupName)) { dic[item.ElementGroupName].Add(item); } else { List <StorePageElement> elements = new List <StorePageElement>(); elements.Add(item); dic.Add(item.ElementGroupName, elements); } } } } return(dic); }
public static StorePage QueryProductListPage(int sellerSysNo) { var filter = new StorePageFilter(); filter.PageType = "ProductList"; return(StoreDA.QueryStorePage(filter)); }
public static StorePage QueryHomePage(int sellerSysNo) { var filter = new StorePageFilter(); filter.PageType = "Home"; filter.SellerSysNo = sellerSysNo; return(StoreDA.QueryStorePage(filter)); }
public static void SavePageHeader(StorePageHeader header) { if (header.SysNo.HasValue) { StoreDA.UpdateStorePageHeader(header); } else { StoreDA.InsertStorePageHeader(header); } }
/// <summary> /// save drafts /// </summary> /// <param name="page"></param> /// <returns></returns> public static int SaveStorePage(StorePage page) { var result = StoreDA.QueryStorePageByPageName(page.PageName, page.SellerSysNo.Value); if (result != null) { page.SysNo = result.SysNo; return(StoreDA.UpdateStorePage(page)); } else { return(StoreDA.SaveStorePage(page)); } }
public static int SaveCertification(CertificationInfo certificaiton) { if (certificaiton == null) { return(0); } using (var trans = TransactionManager.Create()) { StoreDA.InsertApplication(certificaiton); StoreDA.InsertCertificationAttachment(certificaiton); trans.Complete(); } return(1); }
/// <summary> /// publish store page /// </summary> /// <param name="page"></param> /// <returns></returns> public static int PublishStorePage(StorePage page) { using (var trans = TransactionManager.Create()) { //step 1 save drafts var sysNo = SaveStorePage(page); page.SysNo = sysNo; //StoreDA.SaveStorePageDraft(page); //step 2 publish StoreDA.PublishStorePage(page); trans.Complete(); } return(1); }
public Store Get(int nID, int nStoreID) { Connection.Open(); Command.CommandText = StoreDA.Get(nID, nStoreID); SqlDataReader reader = Command.ExecuteReader(); Store _oStore = new Store(); if (reader.HasRows) { _oStore = MakeObject(reader); } reader.Close(); Connection.Close(); return(_oStore); }
/// <summary> /// 所有的有效的二级域名商家 /// </summary> /// <returns></returns> public static List <StoreDomainPage> GetAllStoreDomainHomePageList() { string cacheKey = CommonFacade.GenerateKey("GetAllStoreDomainHomePageList"); if (HttpRuntime.Cache[cacheKey] != null) { return((List <StoreDomainPage>)HttpRuntime.Cache[cacheKey]); } List <StoreDomainPage> result = StoreDA.GetAllStoreDomainHomePageList(); if (result != null) { HttpRuntime.Cache.Insert(cacheKey, result, null, DateTime.Now.AddSeconds(CacheTime.Middle), Cache.NoSlidingExpiration); } return(result); }
public static StorePage QueryStorePageByPageName(string pageName, int sellerSysNo) { var page = StoreDA.QueryStorePageByPageName(pageName, sellerSysNo); if (page != null) { var value = page.DataValue; if (!string.IsNullOrEmpty(value)) { var result = SerializationUtility.JsonDeserialize2 <StorePage>(value); result.SysNo = page.SysNo; return(result); } } return(null); }
public string Delete(Store oStore, int nStoreID) { string sReturnMessage = ""; Connection.Open(); Command.CommandText = StoreDA.IUD(oStore, EnumDBOperation.Delete, nStoreID); try { Command.ExecuteNonQuery(); } catch (Exception e) { sReturnMessage = e.Message.Split('~')[0]; } Connection.Close(); return(sReturnMessage); }
public List <Store> Gets(int nBUID, int nUserID) { Connection.Open(); Command.CommandText = StoreDA.Gets(nBUID, nUserID); SqlDataReader reader = Command.ExecuteReader(); Store _oStore = new Store(); List <Store> _oStores = new List <Store>(); if (reader.HasRows) { _oStores = MakeObjects(reader); } reader.Close(); Connection.Close(); return(_oStores); }
public static QueryResult <StoreNavigation> QueryStoreNavigationList(StorePageListQueryFilter filter, int SellSysno) { var result = StoreDA.QueryStoreNavigationList(filter, SellSysno); //insert home to first var home = QueryHomePage(SellSysno); if (home != null) { var navHome = new StoreNavigation(); navHome.LinkUrl = string.Format("/Store/{0}/{1}", SellSysno, home.SysNo.Value); navHome.Content = "首页"; result.ResultList.Insert(0, navHome); } return(result); }
/// <summary> /// 新品上市 /// </summary> /// <param name="MerchantSysNo"></param> /// <param name="C1SysNo"></param> /// <param name="count"></param> /// <param name="languageCode"></param> /// <param name="companyCode"></param> /// <returns></returns> public static List <RecommendProduct> QueryStoreNewRecommendProduct( int MerchantSysNo, string CategoryCode, int count, string languageCode = "zh-CN", string companyCode = "8601") { string cacheKey = CommonFacade.GenerateKey("QueryStoreNewRecommendProduct", languageCode, companyCode, MerchantSysNo.ToString()); if (HttpRuntime.Cache[cacheKey] != null) { return((List <RecommendProduct>)HttpRuntime.Cache[cacheKey]); } List <RecommendProduct> result = StoreDA.QueryStoreNewRecommendProduct(MerchantSysNo, CategoryCode, count, languageCode, companyCode); HttpRuntime.Cache.Insert(cacheKey, result, null, DateTime.Now.AddSeconds(CacheTime.Long), Cache.NoSlidingExpiration); return(result); }
/// <summary> /// 保存商家的基本信息 /// 1.信息保存到ECStore.dbo.StoreBasicInfo /// 2.信息同步到IPP3.dbo.Vendor /// </summary> /// <param name="info"></param> /// <returns></returns> public static int SaveStoreBasicInfo(StoreBasicInfo info) { using (var trans = TransactionManager.Create()) { if (info.SysNo.HasValue) { StoreDA.UpdateStoreBasicInfo(info); } else { StoreDA.InsertStoreBasicInfo(info); } var basicInfo = StoreDA.QueryStoreBasicInfoBySellerSysNo(info.SellerSysNo.Value); StoreDA.SaveStoreBasicInfoToIPP3Vendor(ConvertStoreBasicToIPP3Vendor(basicInfo), info.InUserSysNo.Value); trans.Complete(); } return(1); }
public Store IUD(Store oStore, int nStoreID) { Connection.Open(); if (oStore.StoreID == 0) { Command.CommandText = StoreDA.IUD(oStore, EnumDBOperation.Insert, nStoreID); } else { Command.CommandText = StoreDA.IUD(oStore, EnumDBOperation.Update, nStoreID); } SqlDataReader reader = Command.ExecuteReader(); Store _oStore = new Store(); if (reader.HasRows) { _oStore = MakeObject(reader); } reader.Close(); Connection.Close(); return(_oStore); }
public static StorePageTemplate QueryStorePageTemplateByTemplateKey(string TemplateKey) { return(StoreDA.QueryStorePageTemplateByTemplateKey(TemplateKey)); }
/// <summary> /// 分页查询商家代理 /// </summary> /// <param name="filter"></param> /// <param name="SellSysno"></param> /// <returns></returns> public static QueryResult <VendorAgentInfo> QueryStoreAgentInfosByPage(StorePageListQueryFilter filter, int SellSysno) { return(StoreDA.QueryStoreAgentInfosByPage(filter, SellSysno)); }
public static VendorBasicInfo LoadVendorInfo(int SellerSysNo) { return(StoreDA.LoadVendorInfo(SellerSysNo)); }
public static int RestoreDefaultStorePage(int sysno, int SellerSysNo) { return(StoreDA.RestoreDefaultStorePage(sysno, SellerSysNo)); }
public static List <StorePageTemplate> QueryStorePageTemplate(string pageTypeKey) { return(StoreDA.QueryStorePageTemplate(pageTypeKey)); }
public static void DelStoreAgentProduct(int agentSysNo) { StoreDA.DelStoreAgentProduct(agentSysNo); }
public static List <StoreAttachment> QueryStoreAttachment(int sellerSysNo) { return(StoreDA.QueryStoreAttachment(sellerSysNo)); }
public static StorePageHeader QueryPageHeaderBySellerSysNo(int sellerSysNo) { return(StoreDA.QueryPageHeaderBySellerSysNo(sellerSysNo)); }
public static List <StorePageLayout> QueryAllPageLayout() { return(StoreDA.QueryAllPageLayout()); }
public static void DelStoreAttachment(int sysNo) { StoreDA.DelStoreAttachment(sysNo); }
public static List <StorePageTheme> QueryAllStorePageTheme() { return(StoreDA.QueryAllStorePageTheme()); }