예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GridViewGetData.DataSource = BL.GetProduct();
         GridViewGetData.DataBind();
     }
 }
예제 #2
0
        protected void GridViewGetData_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow gvR = GridViewGetData.SelectedRow;
            int         id  = int.Parse(gvR.Cells[1].Text);

            BL.DeleteProduct(id);
            GridViewGetData.DataSource = BL.GetProduct();
            GridViewGetData.DataBind();
        }
예제 #3
0
 protected void BtnInsert_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtMRP.Text))
     {
         _ = double.TryParse(txtMRP.Text, out double price);
         BL.InsertProduct(txtProductName.Text, ddlCategory.SelectedValue, txtProductDesc.Text, price);
         txtProductName.Text       = "";
         txtProductDesc.Text       = "";
         ddlCategory.SelectedValue = "-1";
         txtMRP.Text = "";
         txtProductName.Focus();
     }
     else
     {
         txtMRP.Focus();
     }
     GridViewGetData.DataSource = BL.GetProduct();
     GridViewGetData.DataBind();
 }