/// <summary> /// Loads Lowest Priced Book detail record. /// Uses ProductID, CountryID, CategoryID, SubcategoryID and Minimum Price to load List. /// USP: USP_Common_ItemDetailBook_LoadBook_LowestPriced /// </summary> private void LoadBook_LowestPriced(int intProductID, int intCountryID, int intCategoryID, int intSubcategoryID) { //string strDiscountPrice = null; dtBookRecord = new DataTable(); try { using (BC_Book bcBook = new BC_Book()) { dtBookRecord = bcBook.LoadBook_LowestPriced(intProductID, intCountryID, intCategoryID, intSubcategoryID, intSecondSubcatID); if (dtBookRecord.Rows.Count > 0) { success = true; string str = dtBookRecord.Rows[0]["ProductImage"].ToString(); hfProductTitle.Value = dtBookRecord.Rows[0]["ProductTitle"].ToString(); fvBookDetail.DataSource = dtBookRecord; fvBookDetail.DataBind(); } } } catch (Exception ex) { lblSystemMessage.Text = ex.Message; } }
/// <summary> /// Loads Only one Book record based on ProductSellerDetailID. /// </summary> /// <param name="intProductSellerDetailID"></param> /// <param name="intProductID"></param> /// <param name="intCountryID"></param> /// <param name="intCategoryID"></param> /// <param name="intSubcategoryID"></param> private void LoadRecord_SpecificBook(int intProductSellerDetailID, int intProductID, int intCountryID, int intCategoryID, int intSubcategoryID) { dtBookRecord = new DataTable(); try { using (BC_Book bcBook = new BC_Book()) { dtBookRecord = bcBook.LoadRecord_SpecificBook(intProductSellerDetailID, intProductID, intCountryID, intCategoryID, intSubcategoryID, intSecondSubcatID); if (dtBookRecord.Rows.Count > 0) { success = true; hfProductTitle.Value = dtBookRecord.Rows[0]["ProductTitle"].ToString(); fvBookDetail.DataSource = dtBookRecord; fvBookDetail.DataBind(); } } } catch (Exception ex) { lblSystemMessage.Text = ex.Message; } }
/// <summary> /// Loads all Used Book list for a specific ProductID. /// </summary> /// <param name="intProductID"></param> /// <param name="intCountryID"></param> /// <param name="intCategoryID"></param> /// <param name="intSubcategoryID"></param> /// <param name="intSecondSubcatID"></param> private void Load_BookList_UsedSeller(int intProductID, int intCountryID, int intCategoryID, int intSubcategoryID, int intSecondSubcatID) { dtUsedBookList = new DataTable(); AjaxControlToolkit.TabPanel tp = (AjaxControlToolkit.TabPanel)TabContainer.FindControl("tpUsedItems"); try { using (BC_Book bcBook = new BC_Book()) { dtUsedBookList = bcBook.Load_BookList_UsedSeller(intProductID, intCountryID, intCategoryID, intSubcategoryID, intSecondSubcatID); if (dtUsedBookList.Rows.Count > 0) { this.grvUsedBookList.DataSource = dtUsedBookList; this.grvUsedBookList.DataBind(); tp.HeaderText = "<span style=\"font-family:verdana; font-weight:bold;font-size:14px\">Used </span>("; tp.HeaderText += dtUsedBookList.Rows.Count + " from " + dtUsedBookList.Rows[0]["Price"].ToString(); tp.HeaderText += " " + dtUsedBookList.Rows[0]["Currency"].ToString() + ")"; } else { this.grvUsedBookList.DataSource = null; this.grvUsedBookList.DataBind(); tp.HeaderText = "<span style=\"font-family:verdana; font-weight:bold;font-size:14px\">Used </span>(0 item)"; } } } catch (Exception ex) { lblSystemMessage.Text = ex.Message; } }
/// <summary> /// Loads Book Name, Author Highest and Lowest Price. /// </summary> private void LoadRecord_BookHeader() { DataTable dtBookHeader = new DataTable(); bool success = false; try { using (BC_Book book = new BC_Book()) { dtBookHeader = book.LoadRecord_BookHeader(intProductID, intCountryID, intCategoryID, intSubcategoryID, intSecondSubcatID); if (dtBookHeader.Rows.Count > 0) { txtAuthor.Value = dtBookHeader.Rows[0]["Author"].ToString(); txtProductTitle.Value = dtBookHeader.Rows[0]["ProductTitle"].ToString(); txtNewMinPrice.Value = dtBookHeader.Rows[0]["NewMinPrice"].ToString(); txtUsedMinPrice.Value = dtBookHeader.Rows[0]["UsedMinPrice"].ToString(); txtCurrency.Value = dtBookHeader.Rows[0]["Currency"].ToString(); txtImagePath.Value = dtBookHeader.Rows[0]["ProductImage"].ToString(); txtDiscountPrice.Value = dtBookHeader.Rows[0]["DiscountPrice"].ToString(); success = true; } else { lblSystemMessage.Text = "Book title not found."; } } } catch (Exception ex) { lblSystemMessage.Text = "Error: " + ex.Message; } if (success) { lblProductTitle.Text = "<div class=\"productTitle\"><span class=\"title\">"; lblProductTitle.Text += txtProductTitle.Value + "</span><br/>"; lblAuthor.Text = txtAuthor.Value + " (Author)</div>"; lblNewMinPrice.Text = "<span class=\"price\">" + txtNewMinPrice.Value; lblNewMinPrice.Text += " " + txtCurrency.Value + "</span>"; lblUsedMinPrice.Text = "<span class=\"price\">" + txtUsedMinPrice.Value; lblUsedMinPrice.Text += " " + txtCurrency.Value + "</span>"; lblDiscountPrice.Text = "<span class=\"price\">"; lblDiscountPrice.Text += txtDiscountPrice.Value + " " + txtCurrency.Value + "</span>"; bookImage.ImageUrl = txtImagePath.Value; } }
/// <summary> /// Loads all Latest posted Book by Subcategory. /// Uses Country to load Country specific list. /// USP: USP_Common_ItemListBook_ShowLatestPostedBookList /// </summary> private void LoadList_LatestPosted_BookProduct_BySubCategory(int intCountryID, int intSubcategoryID) { dtBookList = new DataTable(); try { using (BC_Book bcBook = new BC_Book()) { dtBookList = bcBook.LoadList_BookProduct_ByCategory(intCountryID, intSubcategoryID); if (dtBookList.Rows.Count > 0) { grvItemList.DataSource = dtBookList; grvItemList.DataBind(); } } } catch (Exception ex) { lblSystemMessage.Text = ex.Message; } }
/// <summary> /// Gets the last SKU(Profile specific) from Product_Seller_Detail table. /// USP: USP_CP_Public_GetLastSKU /// </summary> /// <param name="intProfileID"></param> /// <returns></returns> private string Get_Last_ProfileSpecificSKU(int intProfileID, bool sellerType) { string strLastSku = null; DataTable dt = new DataTable(); try { using (BC_Book bc_Book = new BC_Book()) { dt = bc_Book.Get_Last_ProfileSpecificSKU(intProfileID, _Business_Seller); if (dt.Rows.Count > 0) { strLastSku = dt.Rows[0]["SKU"].ToString(); strLastSku = (string.IsNullOrEmpty(strLastSku)) ? "0" : strLastSku; } } } catch (Exception ex) { lblSystemMessage.Text = ex.Message; } return(strLastSku); }
/// <summary> /// Takes last SKU as parameter and generates new SKU for current product. /// USP: USP_CP_Public_GetNew_SKU. /// </summary> /// <param name="strSku"></param> private void Generate_ProfileSpecific_UniqueSKU(string strSku) { DataTable dt = new DataTable(); try { using (BC_Book bc_Book = new BC_Book()) { dt = bc_Book.Generate_ProfileSpecific_UniqueSKU(strSku); if (dt.Rows.Count > 0) { lblSku.Text = dt.Rows[0]["SKU"].ToString(); } else { lblSystemMessage.Text = "Error in SKU generation."; } } } catch (Exception ex) { lblSystemMessage.Text = ex.Message; } }