protected void Page_Load(object sender, EventArgs e) { if (Session["id"] == null) { Response.Redirect("AdminPanel.aspx"); } else { For_Admin AdCat = new For_Admin(); txtadminID.Text = Session["id"].ToString(); if (!IsPostBack) { ddlCategory.DataSource = AdCat.bindDDL(); //ddlCategory.DataValueField = "Id"; ddlCategory.DataTextField = "Name"; ddlCategory.DataValueField = "Id"; ddlCategory.DataBind(); ddlCategory.Items.Insert(0, "-Select-"); } grid_SubCategory.DataSource = AdCat.Get_Subcategory(); grid_SubCategory.DataBind(); grid_Category.DataSource = AdCat.Get_category(); grid_Category.DataBind(); } }
protected void btnAddCategroy_Click(object sender, EventArgs e) { For_Admin AdCat = new For_Admin(); AdCat.Category_Id = Convert.ToInt32(ddlCategory.SelectedValue.ToString()); AdCat.Name = txtadsubCate.Text; AdCat.Created_By = Convert.ToInt32(Session["id"]); AdCat.SubCategory(); }
protected void btnaddCategory_Click(object sender, EventArgs e) { For_Admin AdCat = new For_Admin(); AdCat.Name = catType.SelectedItem.Value.ToString(); AdCat.Created_By = Convert.ToInt32(Session["id"]); AdCat.AddCategory(); Response.Redirect("ManageCategory.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["id"] == null) { Response.Redirect("AdminPanel.aspx"); } For_Admin Mall = new For_Admin(); //Get_Malls Gm = new Get_Malls(); GridView1.DataSource = Mall.Malls(); GridView1.DataBind(); }
protected void btnEdit_Click1(object sender, EventArgs e) { For_Admin Alt_Shps = new For_Admin(); Alt_Shps.Id = Convert.ToInt32(txtadmin_id.Text); Alt_Shps.MallId = Convert.ToInt32(ddlmalls.Text); Alt_Shps.ShopName = txtshopname.Text; //Alt_Shps.Email = txtemail.Text; Alt_Shps.IsDeleted = txtStatus.Text; Alt_Shps.Modified_By = Convert.ToInt32(txtadmin_id.Text); // Alt_Shps.Address = txtaddress.Text; Alt_Shps.IsActive = txtIsactive.Text; Alt_Shps.Editt_Shops(); }
protected void btnAdminLogin_Click(object sender, EventArgs e) { For_Admin Ad = new For_Admin(); Ad.UserName = txtaAdmin.Text; Ad.Password = txtAdminPass.Text; if (Ad.LoginAdmin() == true) { Session["id"] = Ad.UserName; Response.Redirect("Default.aspx"); } else { lbinvalidLogin.Visible = true; } }
protected void btnAdminLogin_Click(object sender, EventArgs e) { For_Admin Ad = new For_Admin(); Ad.UserName = txtaAdmin.Value; Ad.Password = txtAdminPass.Value; if (Ad.LoginAdmin() == true) { Session["id"] = Convert.ToInt32(Ad.id); Session["Name"] = Ad.UserName; Response.Redirect("AdminHome.aspx"); } else { lbinvalidLogin.Visible = true; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { For_Admin Mall = new For_Admin(); Mall.Delete_Op(); GridView1.DataBind(); //string connection = System.Configuration.ConfigurationManager.ConnectionStrings["Connect_DB"].ConnectionString; //using (var con = new SqlConnection(connection)) //{ // con.Open(); // string query = " update [dbo].[Malls] set IsDeleted='True' where ID = '" + e.CommandArgument + "'"; // SqlCommand comm = new SqlCommand(query, con); // comm.ExecuteNonQuery(); // GridView1.DataBind(); //} } }
protected void btnCreateShop_Click(object sender, EventArgs e) { // Create_ShopsByAdmin Cs_Ad = new Create_ShopsByAdmin(); For_Admin Cs_Ad = new For_Admin(); Cs_Ad.Name = txtName.Text; Cs_Ad.UserName = txtUName.Text; Cs_Ad.Password = txtpsswrd.Text; Cs_Ad.Address = txtaddress.Text; Cs_Ad.Email = txtemail.Text; Cs_Ad.Contact = txtcontact.Text; Cs_Ad.MallId = Convert.ToInt32(ddlmalls.Text); Cs_Ad.ShopName = txtshopname.Text; Cs_Ad.Image = Path.GetFileName(FileUpload_shop.PostedFile.FileName); FileUpload_shop.PostedFile.SaveAs(Server.MapPath("~/Admin/Shops_Images/") + Cs_Ad.Image); Cs_Ad.CNIC = txtcnic.Text; Cs_Ad.Created_By = Convert.ToInt32(txtadmin_id.Text); Cs_Ad.Creating_shops(); Response.Redirect("Create_Shops.aspx"); }
protected void btnEdit_Click(object sender, EventArgs e) { For_Admin Mall = new For_Admin(); Mall.Id = Convert.ToInt32(txtId.Text); Mall.Name = txtname.Text; Mall.Address = txtAddress.Text; Mall.IsDeleted = txtstatus.Text; //Mall.Modified_On = ; //Mall.Image = Path.GetFileName(FileUpload1.PostedFile.FileName); //FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Admin/Mall_Images/") + Cm.Image); Mall.Created_By = Convert.ToInt32(Session["id"]); Mall.Modified_By = Convert.ToInt32(Session["id"]); Mall.EditMalls(); txtstatus.Text = ""; txtname.Text = ""; txtCreated_By.Text = ""; txtCreatedOn.Text = ""; txtAddress.Text = ""; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["id"] == null) { Response.Redirect("AdminPanel.aspx"); } else { txtadmin_id.Text = Session["id"].ToString(); For_Admin Cs_Ad = new For_Admin(); //Create_ShopsByAdmin Cs_Ad = new Create_ShopsByAdmin(); DataTable dt = Cs_Ad.bindDropdown(); ddlmalls.DataSource = dt; if (!IsPostBack) { ddlmalls.DataTextField = "Name"; ddlmalls.DataValueField = "Id"; ddlmalls.DataBind(); ddlmalls.Items.Insert(0, "-Please Select-"); } } }
protected void btncreate_Mall_Click(object sender, EventArgs e) { For_Admin Cm = new For_Admin(); Cm.Name = txtname.Text; Cm.Address = txtaddress.Text; Cm.Image = Path.GetFileName(FileUpload1.PostedFile.FileName); FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Admin/Mall_Images/") + Cm.Image); Cm.Created_By = Convert.ToInt32(Session["id"]); Cm.Opening_Mall(); string message = "Created-Successfully"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("<script type = 'text/javascript'>"); //sb.Append("window.onload=function(){"); sb.Append("alert('"); sb.Append(message); sb.Append("')};"); sb.Append("</script>"); Response.Redirect("CreateMall.aspx"); ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (Session["id"] == null) { Response.Redirect("AdminPanel.aspx"); } For_Admin Shop = new For_Admin(); //Get_Malls Gm = new Get_Malls(); GvShops.DataSource = Shop.Shops(); GvShops.DataBind(); DataTable dt = Shop.bindDropdown(); ddlmalls.DataSource = dt; if (!IsPostBack) { ddlmalls.SelectedIndex = -1; ddlmalls.DataTextField = "Name"; ddlmalls.DataValueField = "Id"; ddlmalls.DataBind(); ddlmalls.Items.Insert(0, "-Please Select-"); } }