protected void grd_catagory_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "btn_Edit") { Session["update_cat_id"] = e.CommandArgument.ToString(); Response.Redirect("Catagory_Master.aspx"); } if (e.CommandName == "btn_Delete") { int delete = BAL_Catagory.delete_status(Convert.ToInt32(e.CommandArgument), 1); if (delete > 0) { Response.Write("<script> alert('Delete Sucess..') </script>"); Bind_Data(); } } if (e.CommandName == "btn_Status") { int status = BAL_Catagory.delete_status(Convert.ToInt32(e.CommandArgument), 2); if (status > 0) { Bind_Data(); } } }
public void Bind_Data() { DataTable data = BAL_Catagory.get_Youtube_Link(); grd_links.DataSource = data; grd_links.DataBind(); bind_ddl_number(); }
public void get_menue() { Int32 id = Convert.ToInt32(Session["update_cat_id"]); DataTable dt = BAL_Catagory.get_data(id, 1); if (dt.Rows.Count > 0) { grd_menue.DataSource = dt; grd_menue.DataBind(); } }
public void Bind_Data() { Int32 id = Convert.ToInt32(Session["update_cat_id"]); DataTable dt = BAL_Catagory.get_data(id, 1); if (dt.Rows.Count > 0) { grd_catagory.DataSource = dt; grd_catagory.DataBind(); this.bind_ddl_number(); } }
public void statustic() { DataSet ds = BAL_Catagory.statustic(); if (ds.Tables.Count > 0) { lbl_news.Text = ds.Tables[0].Rows[0]["Total_News"].ToString(); lbl_catagory.Text = ds.Tables[1].Rows[0]["Total_Catagory"].ToString(); lbl_links.Text = ds.Tables[2].Rows[0]["Total_Youtube"].ToString(); lbl_add.Text = ds.Tables[3].Rows[0]["Total_Add"].ToString(); } }
protected void btn_save_Click(object sender, EventArgs e) { int save = BAL_Catagory.insert(txt_catagory.Text, Convert.ToInt32(Session["update_cat_id"])); if (save > 0) { txt_catagory.Text = ""; Session.Remove("update_cat_id"); Response.Redirect("List_catagory.aspx"); } else { Response.Write("<script> alert('Duplicat Data Found !!') </script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["update_cat_id"] != "" || Session["update_cat_id"] != null) { DataTable data = BAL_Catagory.get_data(Convert.ToInt32(Session["update_cat_id"]), 2); if (data.Rows.Count > 0) { txt_catagory.Text = data.Rows[0]["cat_name"].ToString(); } } this.check_session(); } }
protected void btn_add_Click(object sender, EventArgs e) { if (txt_link.Text == "") { Lbl_Error.Text = "Enter Link"; } else { int link = BAL_Catagory.insert_youtube_link(txt_link.Text); if (link > 0) { Response.Write("<script> alert('Link Save Sucess..') </script>"); this.Bind_Data(); txt_link.Text = ""; Lbl_Error.Text = ""; } } }
protected void btn_save_Click(object sender, EventArgs e) { int count = 0; foreach (GridViewRow grd in grd_menue.Rows) { TextBox index = (TextBox)grd.FindControl("txt_index"); HiddenField hid = (HiddenField)grd.FindControl("hid_id"); int update = BAL_Catagory.Update_menue_index(Convert.ToInt32(hid.Value), Convert.ToInt32(index.Text)); if (update > 0) { count = count + 1; } } Response.Write("<script>alert('Total " + count.ToString() + " Menue Updated')</script>"); this.get_menue(); }
protected void grd_links_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "btn_Delete") { int delete = BAL_Catagory.delete_status_youtube_link(Convert.ToInt32(e.CommandArgument), 1); if (delete > 0) { Response.Write("<script> alert('Delete Sucess..') </script>"); Bind_Data(); } } if (e.CommandName == "btn_Status") { int status = BAL_Catagory.delete_status_youtube_link(Convert.ToInt32(e.CommandArgument), 2); if (status > 0) { Bind_Data(); } } }