private void SaveData() { string sUserName = Session["User"].ToString(); oDAL = new InsuranceCompanyDAL(); oClass = new InsuranceCompanyModel(); oClass.Code = Code.Value; oClass.CompanyName = CompanyName.Value; oClass.ContactPerson = ContactPerson.Value; oClass.CountryCode = ddlCountryCode.SelectedValue; oClass.Address = txtAddress.InnerText; oClass.Phone = txtContact.Value; oClass.Email = txtEmail.Value; string id = ClientID.Value; if (id == "") { oDAL.InsertData(sUserName, oClass); //lblMsg.Text = "New Record has been saved"; } else { oClass.ID = Convert.ToInt16(id); oDAL.UpdateData(sUserName, oClass); // lblMsg.Text = "Record has been updated"; } }
private void LoadInsurance() { InsuranceCompanyDAL insuranceDAL = new InsuranceCompanyDAL(); ddlInsurance.DataSource = insuranceDAL.SelectAll(); ddlInsurance.DataTextField = "CompanyName"; ddlInsurance.DataValueField = "ID"; ddlInsurance.DataBind(); }
private void LoadAssistanceCompany() { InsuranceCompanyDAL insuranceCompanyDAL = new InsuranceCompanyDAL(); ddlCompany.DataSource = insuranceCompanyDAL.SelectAll(); ddlCompany.DataTextField = "CompanyName"; ddlCompany.DataValueField = "id"; ddlCompany.DataBind(); }
private void LoadInsuranceCompany() { InsuranceCompanyDAL insuranceCompanyDAL = new InsuranceCompanyDAL(); InsuranceCompanyModel insuranceModel = new InsuranceCompanyModel(); insuranceModel.CountryCode = "PHL"; oDs = new DataSet(); oDs = insuranceCompanyDAL.SelectByCountryCode(insuranceModel); //var result = oDs.Tables[0].AsEnumerable().Where(myRow => myRow.Field<string>("CountryCode") == "PHL").CopyToDataTable(); ddlInsuranceCompany.DataSource = oDs.Tables[0]; ddlInsuranceCompany.DataTextField = "CompanyName"; ddlInsuranceCompany.DataValueField = "id"; ddlInsuranceCompany.DataBind(); }
protected void Ok_ServerClick(object sender, EventArgs e) { string UserName = Session["User"].ToString(); int ID = Convert.ToInt32(HiddenFieldItem.Value); oDAL = new InsuranceCompanyDAL(); oClass = new InsuranceCompanyModel(); oDs = new DataSet(); oClass.IsDeleted = true; oClass.ReasonDelete = itemname.InnerText; string lbl = lblSelectedItem.Text; oClass.ID = ID; oDAL.DeleteData(UserName, oClass); PopulateGrid(); }
private void PopulateData(int id) { oDAL = new InsuranceCompanyDAL(); oClass = new InsuranceCompanyModel(); oDs = new DataSet(); oClass.ID = id; oDs = oDAL.SelectByID(oClass); ClientID.Value = oDs.Tables[0].Rows[0][0].ToString(); Code.Value = oDs.Tables[0].Rows[0][1].ToString(); CompanyName.Value = oDs.Tables[0].Rows[0][2].ToString(); ContactPerson.Value = oDs.Tables[0].Rows[0][3].ToString(); ddlCountryCode.SelectedValue = oDs.Tables[0].Rows[0][4].ToString(); txtAddress.Value = oDs.Tables[0].Rows[0][5].ToString(); txtEmail.Value = oDs.Tables[0].Rows[0][6].ToString(); txtContact.Value = oDs.Tables[0].Rows[0][7].ToString(); }
private void PopulateGrid() { oDAL = new InsuranceCompanyDAL(); oDs = new DataSet(); if (searchKeyword.Value != "") { oDs = oDAL.SeachData(searchKeyword.Value); } else { oDs = oDAL.SelectAll(); } if (oDs != null) { gvList.DataSource = oDs.Tables[0]; gvList.DataBind(); } }