private void FillNationality() { try { tbl_CountryMasterProp Objtbl_CountryMasterProp = new tbl_CountryMasterProp(); Objtbl_CountryMasterProp.CountryCode = 0; tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL(); DataSet dsData = Objtbl_CountryMasterBAL.SelectCombo_Data(); DataRow dr = dsData.Tables[0].NewRow(); dr["CountryName"] = "--- Select Any ---"; dr["CountryCode"] = 0; dsData.Tables[0].Rows.InsertAt(dr, 0); ddlNationality.DataSource = dsData.Tables[0]; ddlNationality.DataTextField = "CountryName"; ddlNationality.DataValueField = "CountryCode"; ddlNationality.DataBind(); } catch (Exception ex) { throw ex; } }
private void LoadCountry() { tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL(); DataSet dsData = Objtbl_CountryMasterBAL.SelectCombo_Data(); ddlLivingIn.DataSource = dsData.Tables[0]; ddlLivingIn.DataTextField = "CountryName"; ddlLivingIn.DataValueField = "CountryCode"; ddlLivingIn.DataBind(); }
private void DeleteData(int CountryCode) { try { tbl_CountryMasterProp Objtbl_CountryMasterProp = new tbl_CountryMasterProp(); Objtbl_CountryMasterProp.CountryCode = CountryCode; tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL(); Objtbl_CountryMasterBAL.Delete_Data(Objtbl_CountryMasterProp); FillData(); } catch (Exception ex) { throw ex; } }
private void EditData(int CountryCode) { try { tbl_CountryMasterProp Objtbl_CountryMasterProp = new tbl_CountryMasterProp(); Objtbl_CountryMasterProp.CountryCode = CountryCode; int PageCount = 0; tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL(); DataSet dsData = Objtbl_CountryMasterBAL.Select_Data(Objtbl_CountryMasterProp, ref PageCount); txtCountryName.Text = Convert.ToString(dsData.Tables[0].Rows[0]["CountryName"]); ViewState["EditCode"] = CountryCode; } catch (Exception ex) { throw ex; } }
protected void imgbtnSave_Click(object sender, ImageClickEventArgs e) { try { tbl_CountryMasterProp Objtbl_CountryMasterProp = new tbl_CountryMasterProp(); Objtbl_CountryMasterProp.CountryCode = Convert.ToInt32(ViewState["EditCode"]); Objtbl_CountryMasterProp.CountryName = txtCountryName.Text; tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL(); Objtbl_CountryMasterBAL.InsertUpdate_Data(Objtbl_CountryMasterProp); ShowGuidMessage(1, null); mdlPopupNewEntry.Hide(); FillData(); } catch (Exception ex) { ShowGuidMessage(0, ex); //MessageBox.Show(ex.Message); } }
private void FillData() { try { int PageCount = 0; tbl_CountryMasterProp Objtbl_CountryMasterProp = new tbl_CountryMasterProp(); Objtbl_CountryMasterProp.CountryCode = 0; Objtbl_CountryMasterProp.PageNo = Convert.ToInt32(txtCurPage.Text); Objtbl_CountryMasterProp.RecordCount = Convert.ToInt32(20); tbl_CountryMasterBAL Objtbl_CountryMasterBAL = new tbl_CountryMasterBAL(); DataSet dsData = Objtbl_CountryMasterBAL.Select_Data(Objtbl_CountryMasterProp, ref PageCount); lblTotalPage.Text = Convert.ToString(PageCount); grdData.DataSource = dsData.Tables[0]; grdData.DataBind(); } catch (Exception ex) { throw ex; } }