private void GetRecords(int Id) { DataTable table = BAL_Whitelistips.GetById(Id); { txtLocationName.Text = Convert.ToString(table.Rows[0]["IPAddress"]); } }
protected void btnInActive_Click(object sender, EventArgs e) { if (BAL_Whitelistips.ActivateRecords(ReturnIds(), 2) == true) { ShowMessage("Record Deactivated succefully"); FillGrid(); } else { ShowMessage("Error in record deactivation."); } }
protected void btnDelete_Click(object sender, EventArgs e) { if (BAL_Whitelistips.DeleteRecords(ReturnIds()) == true) { ShowMessage("Record Deleted Successfully."); FillGrid(); } else { ShowMessage("Error in record deletion."); } }
protected void imgbtn_Insert_Click(object sender, EventArgs e) { if (ValidateInput() == false) { Page.Validate("AddCategory"); if (Page.IsValid == true) { txtLocationName.Text = Server.HtmlEncode(txtLocationName.Text); if (!string.IsNullOrEmpty(lblMode.Text)) { if (BAL_Whitelistips.UpdateCMS(Convert.ToInt32(lblMode.Text), txtLocationName.Text, "0") == true) { ShowMessage("Record Updated Susseccfully."); FillGrid(); ClearInput(); } else { ShowMessage("Error in record updation."); } } else { if (BAL_Whitelistips.InsertCMS(txtLocationName.Text) == true) { ShowMessage("Record Inserted Susseccfully."); FillGrid(); ClearInput(); } else { ShowMessage("Error in record insertion."); } } } else { ShowMessage("Some Required Field Missing"); } } }
private void FillGrid() { int TotalCount; gvAdminList.PageIndex = gvIndex; DataTable table = BAL_Whitelistips.GetCMSInfo(gvAdminList.PageIndex, gvAdminList.PageSize, gvAdminList.OrderBy, out TotalCount); gvAdminList.VirtualItemCount = TotalCount; gvAdminList.DataSource = table; gvAdminList.DataBind(); if (gvAdminList.Rows.Count > 0) { lblsearch2.Visible = true; ddlPerpage.Visible = true; lable123.Visible = true; } else { lblsearch2.Visible = false; ddlPerpage.Visible = false; lable123.Visible = false; } }