public static List <AllItemList> allhistory(string customer_id) { Debug.WriteLine(customer_id); List <AllItemList> Listall = new List <AllItemList>(); Debug.WriteLine(customer_id); using (SqlConnection conn = new SqlConnection(("Server=.; Database=ShoppingCartT4; Integrated Security=true"))) { Debug.WriteLine("came her"); conn.Open(); string sql = @"select * from Purchaseitem p join Customer c on c.customer_id = p.customer_id join Product po on po.pro_id = p.pro_id where c.customer_id = '" + customer_id + "'"; SqlCommand cmd = new SqlCommand(sql, conn); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Debug.WriteLine("Looping"); AllItemList all = new AllItemList(); all.pro_id = (int)reader["pro_id"]; all.pro_name = (string)reader["pro_name"]; all.pro_desc = (string)reader["pro_desc"]; all.pro_price = (int)reader["pro_price"]; all.pro_image = (string)reader["pro_image"]; all.activation_code = (string)reader["activation_code"]; all.purchase_time = (DateTime)reader["purchase_time"]; Listall.Add(all); Debug.WriteLine(all.pro_id); } } return(Listall); }
private async void InitData() { var isSuccess = await LoadRemoteDataAsync(); if (isSuccess == false) { await LoadLocalDataAsync(); } InitItems(AllItemList, ALL); CategoryList = AllItemList.Select(_ => _.Category).Distinct().ToList(); CategoryList.Insert(0, ALL); }
private void ProcessCategory(string companyCode) { foreach (AdminEntity category in AllCategoryList) { category.EmailAddress = TopItemDA.GetEmailAddressByCategorySysNo(category.CategorySysNo, companyCode); List <TopItemEntity> itemList = AllItemList.Where(p => p.CategorySysNo == category.CategorySysNo).ToList(); if (itemList == null || itemList.Count == 0) { continue; } JobHelper.SendMail(new MailEntity() { To = category.EmailAddress, Body = GetEmailHtmlBody(itemList), Subject = string.Format("置顶商品无货通知【{0}】", category.CategoryName), IsBodyHtml = true }); } }
private async Task <bool> LoadRemoteDataAsync() { var rssContent = await rssReader.DownloadRssString(); var rssNode = rssReader.GetRssNode(rssContent); if (rssReader.HasNewItems(rssNode) == false) { return(false); } var isSuccess = await fileStoreHelper.SaveRssFileAsync(rssContent); if (isSuccess) { foreach (var item in rssReader.ParseRss(rssNode)) { AllItemList.Add(item); } return(true); } return(false); }