public string AddCountry(string name, string countryname) { object result = null; string strReturn = string.Empty; try { eCountries eObj = new eCountries(); eObj.sCountry = name; eObj.dtActionDate = DateTime.Now; eObj.cStatus = "A"; eObj.iActionBy = 1; int i = BL_Country.AddRecord(eObj); if (i == 1) { result = new { st = 1, msg = "Added successfully." }; } else { result = new { st = 0, msg = "Kindly try after some time." }; } } catch (Exception ex) { result = new { st = 0, msg = "Kindly try after some time." }; } strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result); return(strReturn); }
public string UpdateCountry(int id, string name) { object result = null; string strReturn = string.Empty; try { eCountries obj = new eCountries(); obj = BL_Country.GetSingleRecordById(id); obj.sCountry = name; int i = BL_Country.UpdateRecord(obj); if (i == 1) { result = new { st = 1, msg = "Updated successfully." }; } else { result = new { st = 0, msg = "Kindly try after some time." }; } } catch (Exception) { result = new { st = 0, msg = "Kindly try after some time." }; } strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result); return(strReturn); }
public JsonResult ShowData() { BL_Country count = new BL_Country(); return(new JsonResult { Data = count.SelectAllData(), JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
private int BindCountry() { using (DataTable dt = new BL_Country().select(new ML_Country { Country = null })) { cbo_country.Properties.DataSource = dt; cbo_country.Properties.DisplayMember = "Country"; cbo_country.Properties.ValueMember = "Key"; return(dt.Rows.Count); } }
private void btn_save_country_Click(object sender, EventArgs e) { try { if (!IsNewCountry && !hasAccessUpdate) { ApplicationUtilities.ShowMessage(UniversalEnum.MessageTypes.Error, "You have no save rights.", "Access Denied"); return; } if (txt_new_country.IsNotEmpty()) { using (DataTable Table = new BL_Country().select(new ML_Country { Country = txt_new_country.Text })) { if (Table.Rows.Count < 1) { if (IsNewCountry) { new BL_Country().insert(new ML_Country { Country = txt_new_country.Text }); } else if (CountryID > 0) { new BL_Country().update(new ML_Country { Key = CountryID, Country = txt_new_country.Text }); } ResetCountryForm(); BindCountry(); SetPrevious(); } else { ApplicationUtilities.ShowMessage(UniversalEnum.MessageTypes.Error, "The entered country is already in the database. Please re-check!", "Error"); } } } else { ApplicationUtilities.ShowMessage(UniversalEnum.MessageTypes.Exclamation, "Null value detected for country. Please re-check!", "Error!"); } } catch (Exception ex) { AuditFactory.AuditLog(ex); ApplicationUtilities.ShowMessage(UniversalEnum.MessageTypes.Error, ex.Message); } }
private int BindCountry() { using (DataTable dt = new BL_Country().select(new ML_Country { Country = null })) { lst_country.UnSelectAll(); lst_country.DataSource = dt; lst_country.DisplayMember = "Country"; lst_country.ValueMember = "Key"; return(dt.Rows.Count); } }
public string GetAllRecords1(int sEcho, int iDisplayLength, int iDisplayStart, string sSortDir_0, string sSearch, int iSortCol_0) { OneFineRateAppUtil.jQueryDataTableParamModel tblobj = new OneFineRateAppUtil.jQueryDataTableParamModel(); // int sEcho = ToInt(HttpContext.Current.Request.Params["sEcho"]); tblobj.iDisplayLength = iDisplayLength; // ToInt(HttpContext.Current.Request.Params["iDisplayLength"]); tblobj.iDisplayStart = iDisplayStart; // ToInt(HttpContext.Current.Request.Params["iDisplayStart"]); tblobj.sortDirection = sSortDir_0; //HttpContext.Current.Request.Params["sSortDir_0"]; tblobj.sSearch = sSearch; // HttpContext.Current.Request.Params["sSearch"]; tblobj.iSortingCols = iSortCol_0; // Convert.ToInt32(HttpContext.Current.Request.Params["iSortCol_0"]); string outputJson = string.Empty; StringBuilder sb = new StringBuilder(); int TotalCount; List <eCountries> list = BL_Country.getRecordForSearch(tblobj, out TotalCount).ToList(); if (list.Count > 0) { sb.Clear(); sb.Append("{"); sb.Append(@"""sEcho"": "); sb.AppendFormat(@"""{0}""", sEcho); sb.Append(","); sb.Append(@"""iTotalRecords"": "); sb.Append(TotalCount.ToString()); sb.Append(","); sb.Append(@"""iTotalDisplayRecords"": "); sb.Append(TotalCount.ToString()); sb.Append(", "); sb.Append(@"""aaData"": "); sb.Append(OneFineRateAppUtil.clsUtils.ConvertToJson(list)); sb.Append("}"); outputJson = sb.ToString(); } else { sb.Clear(); sb.Append("{"); sb.Append(@"""sEcho"": "); sb.AppendFormat(@"""{0}""", sEcho); sb.Append(","); sb.Append(@"""iTotalRecords"": 0"); sb.Append(","); sb.Append(@"""iTotalDisplayRecords"": 0"); sb.Append(", "); sb.Append(@"""aaData"": [ "); sb.Append("]}"); outputJson = sb.ToString(); } return(outputJson); }
public ActionResult AddUpdateCompany(int?id) { var model = new eCorporateCompanyM(); if (id.HasValue) { model = BL_CorporateCompanyM.GetCorporateCompanyById(id.Value); } else { model.CountryCodePhoneList = BL_Country.GetAllCountryPhoneCodes(); } return(PartialView("_AddCompany", model)); }
public ActionResult Index(PropSearchRequestModel model) { string type = ""; if (HttpContext.Request.Params["type"] != null && HttpContext.Request.Params["type"] != "") { type = HttpContext.Request.Params["type"]; } ViewBag.type = type == "" ? null : type; eBiddingSearch obj = new eBiddingSearch(); if (User.Identity.IsAuthenticated) { var user = BL_WebsiteUser.GetSingleRecordById(User.Identity.GetUserId <long>()); obj.sUserTitle = user.Title; obj.sUserFirstName = user.FirstName; obj.sUserLastName = user.LastName; obj.sUserEmail = user.Email; obj.sUserMobileNo = user.PhoneNumber; obj.iStateId = user.StateId.HasValue? user.StateId.Value:0; } obj.sSearchId = Convert.ToInt32(model.cid); obj.sSearchName = model.cname; obj.sSearchType = model.ctype == "City" ? "C" : model.ctype == "Locality" ? "L" : "A"; obj.ctype = model.ctype; obj.sJsonRoomData = model.sRoomData; obj.sCheckIn = model.sCheckIn; obj.sCheckOut = model.sCheckOut; obj.cname = model.cname; obj.type = ViewBag.type; obj.CountryCodePhoneList = BL_Country.GetAllCountryPhoneCodes(); List <etblIndianLocalityCordinate> cordinatesList; var list = BL_Bidding.GetAreaLocalityForBid(obj.sSearchType, obj.sSearchId, out cordinatesList); obj.lstPolygonData = cordinatesList; obj.sJsonLocality = OneFineRateAppUtil.clsUtils.ConvertToJson(list); obj.BidSearchData = "BidSearchData" + Guid.NewGuid().ToString(); obj.BidData = "BidData" + Guid.NewGuid().ToString(); Session[obj.BidSearchData] = obj; Session[obj.BidData] = model; //TempData.Keep(); return(View(obj)); }
private void bindInitialData() { using (DataTable dt = new BL_Salutation().select(new OBALog.Model.ML_Salutation { Salutation = null })) { cbo_salutation.Properties.DataSource = dt; cbo_salutation.Properties.DisplayMember = "Salutation"; cbo_salutation.Properties.ValueMember = "Key"; } using (DataTable dt = new BL_Country().select(new OBALog.Model.ML_Country { Country = null })) { cbo_country.Properties.DataSource = dt; cbo_country.Properties.DisplayMember = "Country"; cbo_country.Properties.ValueMember = "Key"; } }
public string DeleteCountry(int id) { object result = null; string strReturn = string.Empty; try { int i = BL_Country.DeleteRecord(id); if (i == 1) { result = new { st = 1, msg = "Deleted successfully." }; } else { result = new { st = 0, msg = "Kindly try after some time." }; } } catch (Exception) { result = new { st = 0, msg = "Kindly try after some time." }; } strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result); return(strReturn); }