Esempio n. 1
0
 protected void GridBrands_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         MpEditBran.Show();
         if (e.CommandName == "BrandId")
         {
             GetProducts1();
             string BrandId = e.CommandArgument.ToString();
             Session["BrandId"] = BrandId.ToString();
             DataSet BrandData = objHotLeadBL.BrandListWithBrand(Convert.ToInt32(BrandId));
             txtBrandUp.Text         = BrandData.Tables[0].Rows[0]["Brands"].ToString();
             txtBrandNsupdate.Text   = BrandData.Tables[0].Rows[0]["BName"].ToString();
             ddlProdUp.SelectedIndex = Convert.ToInt32(BrandData.Tables[0].Rows[0]["vid"].ToString());
             string activeM = BrandData.Tables[0].Rows[0]["Stat"].ToString();
             if (activeM == "active")
             {
                 RadioButtonList1.Items[0].Selected = true;
             }
             else if (activeM == "Inactive")
             {
                 RadioButtonList1.Items[1].Selected = true;
             }
         }
     }
     catch { }
 }
Esempio n. 2
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        bool Isactive = false;

        if (RadioButtonList1.Items[0].Selected == true)
        {
            Isactive = true;
        }
        else
        {
            Isactive = false;
        }
        DataSet BrandData = objHotLeadBL.UpdateBrandsDetails(Convert.ToInt32(Session["BrandId"].ToString()), txtBrandUp.Text, txtBrandNsupdate.Text,
                                                             ddlProdUp.SelectedIndex, Isactive);

        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('Brand is Updated successfuly.');", true);

        GetBrands();
        MpEditBran.Hide();
    }