private int ShowDuplicateProducts() { int? CatCode = treProductCatCode.Code; BOLProducts ProductsBOL = new BOLProducts(); rptDuplicateProducts.DataSource = ProductsBOL.GetDuplicateProducts(txtFaTitle.Text, CatCode); rptDuplicateProducts.DataBind(); return(rptDuplicateProducts.Items.Count); }
protected void DoSave(object sender, EventArgs e) { try { if (NewMode) { if (!DuplicateHasBeenChecked) { msgBox.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Warning; msgBox.Text = "محصولات زیر شبیه نام این محصول در این گروه قبلا وارد شده اند"; int DuplicateCount = ShowDuplicateProducts(); if (DuplicateCount > 0) { pnlDuplicateProducts.Visible = true; return; } } } int ReturnCode = SaveControls("~/Main/Default.aspx?BaseID=" + BaseID); Products CurProduct; BOLProducts ProductsBOL = new BOLProducts(); if (NewMode && ReturnCode != -1) { NewMode = false; Code = ReturnCode; ShowDetails(); } if (ReturnCode != -1) { CurProduct = ((IBaseBOL <Products>)ProductsBOL).GetDetails(ReturnCode); if (uplLargePicFile.UploadedFiles.Count > 0 || string.IsNullOrEmpty(CurProduct.SmallPicFile)) { Guid newGd = Guid.NewGuid(); string RandSmallPic = newGd.ToString().Replace("-", "") + ".jpg"; SavePic(CurProduct.LargePicFile, RandSmallPic, HttpContext.Current.Request.MapPath("~/Files/Products/Small/"), 125); ProductsBOL.ChangeSmallPic(ReturnCode, "/Files/Products/Small/" + RandSmallPic); } //Response.Redirect("~/Admin/Main/Default.aspx?BaseID=Products"); GoToList(null, null); } } catch (Exception err) { msgBox.Text = "بروز خطا " + err.Message; } }
protected void ddlItemCount_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; int NewItemCount = Convert.ToInt32(ddl.SelectedValue); int ProductCode = Convert.ToInt32(ddl.Attributes["ProductCode"]); BOLProducts ProductsBOL = new BOLProducts(); Products CurProduct = ((IBaseBOL <Products>)ProductsBOL).GetDetails(ProductCode); ModifyBasketItemCount(ProductCode, NewItemCount, (int)CurProduct.Price); DataTable dt = (DataTable)Session["dtOrders"]; if (dt.Rows.Count > 0) { CalcTotalAmount(dt); } }
protected void HandleRepeaterCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "RemoveFromBasket") { ImageButton btnRemove = (ImageButton)e.Item.FindControl("btnRemove"); int ProductCode = Convert.ToInt32(btnRemove.Attributes["ProductCode"]); BOLProducts ProductsBOL = new BOLProducts(); if (ProductCode != 0) { msgMessage.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Info; RemoveOrders(ProductCode); if (Session["dtOrders"] != null) { DataTable dt = (DataTable)Session["dtOrders"]; CalcTotalAmount(dt); } string JSCommand = ""; if (!msgMessage.Visible) { msgMessage.Visible = true; } else { JSCommand += " $(\"#" + msgMessage.ClientID + "\").fadeTo(\"fast\",0.1);"; } msgMessage.Text = "این محصول از سبد خرید حذف شد."; JSCommand += " $(\"#" + msgMessage.ClientID + "\").fadeTo(\"slow\",0.9);"; ScriptManager.RegisterStartupScript(this.Page, typeof(string), "SelectMediaRow", JSCommand, true); if (rptBasket.Items.Count == 0) { btnNext1.Visible = false; pnlTotal.Visible = false; } } } }
public string GetStatus(Object obj) { try { string Result = "موجود"; if (obj != null) { int Code = Convert.ToInt32(obj); BOLProducts ProductsBOL = new BOLProducts(); Result = ProductsBOL.GetProductavailStatus(Code); } return(Result); } catch (Exception err) { Tools tools = new Tools(); string errMailBody = err.Message; bool SenderrResult = tools.SendEmail(errMailBody, " خطا در سایت اثبات ", "*****@*****.**", "*****@*****.**", "", ""); return(""); } }
protected void Page_Load(object sender, EventArgs e) { #region Tab Pages //if (!NewMode) // ShowDetails(); //else //{ // RadMultiPage1.SelectedIndex = 0; // tsProducts.Tabs[0].Selected = true; //} #endregion BOLClass = new BOLProducts(); if ((Code == null) && (!NewMode)) { return; } if (!Page.IsPostBack) { if (!NewMode) { ShowDetails(); } else { chkActive.Checked = true; } #region Fill Combo cboHCProductAvailabilityCode.DataSource = new BOLHardCode().GetHCDataTable("HCProductAvailabilities"); #endregion if (!NewMode) { LoadData((int)Code); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserCode"] == null) { } else { } if (!Page.IsPostBack) { if (Request["RefUserCode"] != null) { Session["RefUserCode"] = Request["RefUserCode"]; } strCode = Request["Code"]; int Code; Int32.TryParse(strCode, out Code); if (Code != 0) { BOLProducts ProductsBOL = new BOLProducts(); Products CurProduct = ((IBaseBOL <Products>)ProductsBOL).GetDetails(Code); if (CurProduct != null) { ViewState["Code"] = Code.ToString(); if (Request.UserAgent == "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" || Request.UserAgent == "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" || Request.UserAgent == "msnbot/2.0b (+http://search.msn.com/msnbot.htm)._" || Request.UserAgent == "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" || Request.UserAgent == "Mozilla/5.0 (en-us) AppleWebKit/525.13 (KHTML, like Gecko; Google Web Preview) Version/3.1 Safari/525.13" || Request.UserAgent == "Mozilla/5.0 (compatible; MJ12bot/v1.3.3; http://www.majestic12.co.uk/bot.php?+)" ) { int ff = 1; } else { ProductsBOL.IncrementView(CurProduct.Code); ProductsBOL.IncProVisits(CurProduct.Code); } hplBuy.NavigateUrl = "~/Cart.aspx?ProductCode=" + Code; lblEnTitle.Text = CurProduct.EnTitle; lblFaTitle.Text = CurProduct.FaTitle; strEnTitle = CurProduct.EnTitle; lblDescription.Text = Tools.FormatString(CurProduct.Description); lblPrice.Text = Tools.ChangeEnc(Tools.FormatCurrency((Convert.ToInt32(CurProduct.Price) / 10).ToString())) + " تومان"; int?MarketPrice = CurProduct.MarketPrice; if (MarketPrice != null) { if (MarketPrice > CurProduct.Price) { lblMarketPrice.Text = Tools.ChangeEnc(Tools.FormatCurrency((Convert.ToInt32(CurProduct.MarketPrice) / 10).ToString())) + " تومان"; pnlMarketPrice.Visible = true; } } ProTitle = CurProduct.FaTitle; if (string.IsNullOrEmpty(CurProduct.FaTitle)) { ProTitle = CurProduct.EnTitle; } ReqUtils Utils = new ReqUtils(); string FullDesc = CurProduct.Description; string BriefDesc = Tools.ShowBriefText(Utils.RemoveTags(FullDesc), 300); Page.Title = ProTitle; //if (CurProduct.ProductCatCode != null) //{ // SelectedProducts1.CatCode = (int)CurProduct.ProductCatCode; // RelatedProducts1.ProductCode = CurProduct.Code; // RelatedProducts1.ShowSelectedProducts(); //} //else // SelectedProducts1.Visible = false; BOLHardCode HardCodeBOL = new BOLHardCode(); ltrHirarchy.Text = strHirarchy; #region Fill Fields #endregion #region Visibility #endregion #region Box Visibility #endregion //string[] ProTitleArray = ProTitle.Split(' '); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["UserCode"] == null) { pnlLoggedUser.Visible = true; } else { pnlLoggedUser.Visible = false; } int ProductCode; string strProductCode = Request["ProductCode"]; Int32.TryParse(strProductCode, out ProductCode); if (ProductCode != 0) { BOLProducts ProductsBOL = new BOLProducts(); Products CurProduct = ((IBaseBOL <Products>)ProductsBOL).GetDetails(ProductCode); if (CurProduct != null) { int ItemCount = 1; int FinalCount = AddToOrders(ProductCode, ItemCount, CurProduct.FaTitle, (int)CurProduct.Price, CurProduct.Weight, CurProduct.EnTitle, (int)CurProduct.SendPishtazPrice, (int)CurProduct.SendSefareshiPrice); } } } //Security.Check(); if (!Page.IsPostBack) { if (Session["dtOrders"] != null) { DataTable dt = (DataTable)Session["dtOrders"]; if (dt.Rows.Count > 0) { CalcTotalAmount(dt); rptBasket.DataSource = dt; rptBasket.DataBind(); pnlTotal.Visible = true; if (Session["UserCode"] != null) { int UserCode = Convert.ToInt32(Session["UserCode"]); BOLUsers UsersBOL = new BOLUsers(); Users CurUser = ((IBaseBOL <Users>)UsersBOL).GetDetails(UserCode); int AccountBalance = 0; } } else { } } else { pnlTotal.Visible = false; } } if (rptBasket.Items.Count == 0) { btnNext1.Visible = false; ltrBasketHeader.Text = "سبد خرید خالی است."; ltrBasketHeader.Visible = true; pnlTotal.Visible = false; } }