private void GetRecords(int Id) { DataTable table = BAL_Zonecomponents.SelectZonecomponent("selectbyid", Id); { txtZone.Text = Convert.ToString(table.Rows[0]["ZoneName"]); } }
protected void btnInActive_Click(object sender, EventArgs e) { if (BAL_Zonecomponents.DeleteZonecomponent("inactive", ReturnIds()) == true) { ShowMessage("Record Deactivated succefully"); FillGrid(); } else { ShowMessage("Error in record deactivation."); } }
protected void btnDelete_Click(object sender, EventArgs e) { if (BAL_Zonecomponents.DeleteZonecomponent("delete", ReturnIds()) == true) { ShowMessage("Record Deleted Successfully."); FillGrid(); } else { ShowMessage("Error in record deletion."); } }
private void FillGrid() { DataTable table = BAL_Zonecomponents.SelectZonecomponent("selectall", 0); gvAdminList.DataSource = table; gvAdminList.DataBind(); if (gvAdminList.Rows.Count > 0) { lblsearch2.Visible = true; } else { lblsearch2.Visible = false; } }
protected void imgbtn_Insert_Click(object sender, EventArgs e) { if (ValidateInput() == false) { Page.Validate("AddCategory"); if (Page.IsValid == true) { txtZone.Text = Server.HtmlEncode(txtZone.Text); if (string.IsNullOrEmpty(lblMode.Text)) { lblMode.Text = "0"; if (BAL_Zonecomponents.InsertUpdateZonecomponent("insert", lblMode.Text, ddlZoneName.SelectedValue, txtZone.Text, "0") == true) { ShowMessage("Record Insert Susseccfully."); FillGrid(); ClearInput(); } else { ShowMessage("Error in record updation."); } lblMode.Text = string.Empty; } else { if (BAL_Zonecomponents.InsertUpdateZonecomponent("update", lblMode.Text, ddlZoneName.SelectedValue, txtZone.Text, "0") == true) { ShowMessage("Record Updated Susseccfully."); FillGrid(); ClearInput(); } else { ShowMessage("Error in record insertion."); } } } else { ShowMessage("Some Required Field Missing"); } } }