private void BindData() { if (Request.QueryString["CompanyId"] != null) { int CompanyId = Convert.ToInt32(Request.QueryString["CompanyId"]); dtProduct = taProduct.SelectProductsCompanyWise(CompanyId); ddlCompany.Items.FindByValue(CompanyId.ToString()).Selected = true; } else dtProduct = taProduct.GetData(); if (dtProduct.Rows.Count > 0) { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); } else { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); return; } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; LoadColors(); if (Request.QueryString["ID"] != null) { if (Request.QueryString["ID"] == "True") { lblMsg.Text = "Successfully Added"; } } if (Request.QueryString["ProductId"] != null) { int productId = Convert.ToInt32(Request.QueryString["ProductId"]); dtProduct = taProduct.SelectProductNamebyProductId(productId); if (dtProduct.Rows.Count > 0) { lblProductTitle.Text = dtProduct[0].ProductTitle.ToString(); lblProductId.Text = productId.ToString(); } else { lblMsg.Text = "No product found against the provide productid"; tblColor.Visible = false; } } else { lblMsg.Text = "No record found"; tblColor.Visible = false; } }
protected void Repeater1_ItemDataBound(object source, RepeaterItemEventArgs e) { Label lblCategoryId = (Label)e.Item.FindControl("lblCategoryId"); Repeater Repeater2 = (Repeater)e.Item.FindControl("Repeater2"); dtProducts = taProducts.SelectProductbyCategoryId(Convert.ToInt32(lblCategoryId.Text)); Repeater2.DataSource = dtProducts; Repeater2.DataBind(); }
private void ItemsGet() { int ProductId = Convert.ToInt16(Request.QueryString["ProductId"]); dtSimilarProduct = taProduct.SelectSimilarProductbyProductId(ProductId); if (dtProduct.Rows.Count > 0) { Repeater1.DataSource = dtSimilarProduct; Repeater1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; LoadColors(); if (Request.QueryString["ID"] != null) { if (Request.QueryString["ID"] == "True") { lblMsg.Text = "Successfully Edited"; } } if (Request.QueryString["ProductColorId"] != null) { int productColorId = Convert.ToInt32(Request.QueryString["ProductColorId"]); dtProductColors = taProductColors.SelectProductColorByProductColorId(productColorId); if (dtProductColors.Rows.Count > 0) { int productId = Convert.ToInt32(dtProductColors[0].ProductId); dtProduct = taProduct.SelectProductNamebyProductId(productId); if (dtProduct.Rows.Count > 0) { lblProductTitle.Text = dtProduct[0].ProductTitle.ToString(); ddlColors.Items.FindByValue(dtProductColors[0].ColorId.ToString()).Selected = true; txtSortOrder.Text = dtProductColors[0].Sort.ToString(); lblImage.Text = dtProductColors[0].Image.ToString(); if (lblImage.Text != "") { Image1.ImageUrl = "~/thumbnail.aspx?image=Images/ProductColorImages/" + lblImage.Text + "&size=150"; } } else { lblMsg.Text = "No product found against the provide productcolorid"; tblColor.Visible = false; } } else { lblMsg.Text = "No record found"; tblColor.Visible = false; } } else { lblMsg.Text = "No record found"; tblColor.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { string visitorid = Session["NewGuid"].ToString(); dtProduct = taProduct.SelectProductbyVisitorId(visitorid); if (dtProduct.Rows.Count > 0) { Repeater1.DataSource = dtProduct; Repeater1.DataBind(); setCompAddress(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["NewGuid"] ==null) Response.Redirect("productviewgallery.aspx?dispid=idPrdDipCategoryWise&pv=productviewgallery"); string visitorid = Session["NewGuid"].ToString(); dtProduct = taProduct.SelectProductbyVisitorId(visitorid); if (dtProduct.Rows.Count > 0) { Repeater1.DataSource = dtProduct; Repeater1.DataBind(); } SetProductQuantity(); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton btnDel = (LinkButton)e.Row.FindControl("delbutton"); btnDel.Attributes.Add("OnClick", "return confirm('Are you sure to delete this record?');"); Label lblColorId = (Label)e.Row.FindControl("lblColorId"); Label lblProductId = (Label)e.Row.FindControl("lblProductId"); dtProduct = taProduct.SelectProductNamebyProductId(Convert.ToInt32(lblProductId.Text)); if (dtProduct.Rows.Count > 0) { lblProductId.Text = dtProduct[0].ProductTitle.ToString(); } dtColors = taColors.SelectColorTitlebyColorId(Convert.ToInt32(lblColorId.Text)); if (dtColors.Rows.Count > 0) lblColorId.Text = dtColors[0].ColorTitle.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { int ProductId =Convert.ToInt16( Request.QueryString["ProductId"]); dtProduct = taProduct.SelectProductbyProductId(ProductId); if (dtProduct.Rows.Count > 0) { DataRow row = dtProduct.Rows[0]; lblProductName.Text = row["ProductTitle"].ToString(); lblCompName.Text = "DYL";// taProduct.SelectCompanyNameUsingProductId(ProductId); lblModel.Text = row["Model"].ToString(); lblPartNumber.Text = row["ProductId"].ToString(); txtProductDescription.Text = row["description"].ToString(); ProductImage.ImageUrl = "~/thumbnail.aspx?Image=Images/ProductMainImages/" + row["MainImage"].ToString(); //+ "&size=200"; ItemsGet(); // IsThisProductExistInCart(); } }
private void BindData() { int SectionCode = 0; FillWebControlClass FCC = new FillWebControlClass(); ylib = new ClassP.ylibWebClass(constr.connect()); lblGroupLevel.Text = Request.QueryString["lblGroupLevel"]; int CompanyId ; int SubCategoryId ; int CategoryId; int ProductGroupCode ; #region SetListVariables SectionCode = StringOperation.QueryStringInt16Value(Request.QueryString["SectionCode"]); CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]); CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]); SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]); ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]); #region Write Cookies if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0) { Response.Cookies["ProductGroupCode"].Value=ProductGroupCode.ToString(); Response.Cookies["ProductGroupCode"].Expires=DateTime.Now.AddDays(1); } else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0) { Response.Cookies["SubCategoryId"].Value=SubCategoryId.ToString(); Response.Cookies["SubCategoryId"].Expires=DateTime.Now.AddDays(1); } else if (CompanyId != 0 && CategoryId != 0) { Response.Cookies["CategoryId"].Value = CategoryId.ToString(); Response.Cookies["CategoryId"].Expires = DateTime.Now.AddDays(1); } else if (CompanyId != 0) { Response.Cookies["CompanyId"].Value = CompanyId.ToString(); Response.Cookies["CompanyId"].Expires = DateTime.Now.AddDays(1); } #endregion #endregion lblSectionName.Text = ylib.giveValue("select SectionName from MainPageSection where SectionCode=" + SectionCode); #region FillDropDownLists dtCompany = taCompany.GetData(); FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId",true,true,CompanyId.ToString()); dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId); FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString()); dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId); FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString()); dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId); FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString()); #endregion if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode!=0) dtProduct = taProduct.GetDataByProductGroupCode(ProductGroupCode); else dtProduct = taProduct.GetDataByProductGroupCode(0); if (dtProduct.Rows.Count > 0) { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); } else { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); lblMsg.Text = "No record found"; return; } }
private void BindData() { FillWebControlClass FCC = new FillWebControlClass(); int CompanyId ; int SubCategoryId ; int CategoryId; int ProductGroupCode ; #region SetListVariables CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]); CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]); SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]); ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]); #region Write Cookies if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0) { Response.Cookies["ProductGroupCode"].Value = ProductGroupCode.ToString(); Response.Cookies["ProductGroupCode"].Expires = DateTime.Now.AddDays(1); } else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0) { Response.Cookies["SubCategoryId"].Value = SubCategoryId.ToString(); Response.Cookies["SubCategoryId"].Expires = DateTime.Now.AddDays(1); } else if (CompanyId != 0 && CategoryId != 0) { Response.Cookies["CategoryId"].Value = CategoryId.ToString(); Response.Cookies["CategoryId"].Expires = DateTime.Now.AddDays(1); } else if (CompanyId != 0) { Response.Cookies["CompanyId"].Value = CompanyId.ToString(); Response.Cookies["CompanyId"].Expires = DateTime.Now.AddDays(1); } #region GetCookies if (Request.Cookies["CompanyId"] != null && CompanyId==0) CompanyId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["CompanyId"].Value)); if (Request.Cookies["CompanyId"] != null && Request.Cookies["CategoryId"] != null && CategoryId == 0) CategoryId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["CategoryId"].Value)); if (Request.Cookies["CompanyId"] != null && Request.Cookies["CategoryId"] != null && Request.Cookies["SubCategoryId"] != null && SubCategoryId == 0) SubCategoryId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["SubCategoryId"].Value)); //if (Request.Cookies["ProductGroupCode"] != null && ProductGroupCode == 0) // ProductGroupCode = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["ProductGroupCode"].Value)); #endregion #endregion #endregion #region FillDropDownLists dtCompany = taCompany.GetData(); FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId",true,true,CompanyId.ToString()); dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId); FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString()); dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId); FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString()); dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId); FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString()); #endregion if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode!=0) dtProduct = taProduct.GetDataByProductGroupCode(ProductGroupCode); else dtProduct = taProduct.GetDataByProductGroupCode(0); if (dtProduct.Rows.Count > 0) { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); } else { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); lblMsg.Text = "No record found"; return; } }
private void LoadProductInformationToEdit() { if (Request.QueryString["ProductId"] != null && Convert.ToInt16( Request.QueryString["ProductId"]) != 0) { lblPageFunction.Text = "Edit Product"; btnAdd.Text = "Update"; ddlCompany.Enabled = false; ddlCategory.Enabled = false; ddlSubCategory.Enabled = false; ddlProductGroup.Enabled = false; dtProduct = taProduct.SelectProductbyProductId(Convert.ToInt32(Request.QueryString["ProductId"])); if (dtProduct.Rows.Count > 0) { DataRow row = dtProduct.Rows[0]; Image1.ImageUrl = "~/thumbnail.aspx?Image=Images/ProductMainImages/" + row["MainImage"].ToString() + "&size=100"; ImageTN.ImageUrl = "~/thumbnail.aspx?Image=Images/ProductThumbNail/" + row["ThumbNail"].ToString() + "&size=100"; txtSortOrder.Text = row["Sort"].ToString(); txtTitle.Text = row["ProductTitle"].ToString(); txtDescription.Text = row["Description"].ToString(); txtModel.Text = row["Model"].ToString(); txtTechnicalSpecs.Text = row["TechnicalSpecs"].ToString(); txtDownloadInformation.Text = row["DownloadInformation"].ToString(); txtVideoLink.Text = row["VideoLink"].ToString(); lblVideoImage.Text = row["VideoLinkImage"].ToString(); lblLargeImage.Text = row["MainImage"].ToString(); lblLargeImageTN.Text = row["ThumbNail"].ToString(); txtPartNumber.Text = row["PartNumber"].ToString(); ddlBas_Brands.Items.FindByValue(row["Br_Code"].ToString()).Selected = true; ddlBas_Warranties.Items.FindByValue(row["WarCode"].ToString()).Selected = true; if (lblVideoImage.Text != "") VideoImage.ImageUrl = "~/thumbnail.aspx?Image=Images/ProductVideoImages/" + lblVideoImage.Text + "&size=100"; else VideoImage.Visible = false; } } }
private void BindData() { int SetCode=Convert.ToInt16(Request.QueryString["SetCode"]); int CompanyId =Convert.ToInt16( taSimilarSet.SelectCompanyIdUsingSetCode(SetCode)); dtProduct = taProduct.SelectUnSetProduct(CompanyId, SetCode); if (dtProduct.Rows.Count > 0) { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); } else { GridView1.DataSourceID = null; GridView1.DataSource = dtProduct; GridView1.DataBind(); lblMsg.Text = "No record found"; return; } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; if (Request.QueryString["ProductId"] != null) { BindData(); dtProduct = taProduct.SelectProductNamebyProductId(Convert.ToInt32(Request.QueryString["ProductId"])); if (dtProduct.Rows.Count > 0) { lblProductTitle.Text = "against " + dtProduct[0].ProductTitle.ToString(); } else { btnAddImages.Visible = false; btnUpdateSortOrder.Visible = false; lblMsg.Text = "No record found"; return; } } else { Response.Redirect("Product.aspx"); } }
private void BindData() { if (Request.QueryString["ProductId"] != null) { int productId = Convert.ToInt32(Request.QueryString["ProductId"]); dtProduct = taProduct.SelectProductNamebyProductId(Convert.ToInt32(Request.QueryString["ProductId"])); if (dtProduct.Rows.Count > 0) { lblProductTitle.Text = "against " + dtProduct[0].ProductTitle.ToString(); } else { btnAdd.Visible = false; lblMsg.Text = "No record found."; return; } dtProductColors = taProductColors.SelectProductColorsByProductId(productId); if (dtProductColors.Rows.Count > 0) { GridView1.DataSource = dtProductColors; GridView1.DataBind(); } else { GridView1.Visible = false; lblMsg.Text = "No record found."; } } }