public bool SetSave() { bool ReturnValue = false; try { if (DataValidator.IsValid(this.grpData)) { if (_Mode == (int)Common.Constant.Mode.Insert) { objCityBL.Insert(_StateID, txtCityName.Text); } else if (_Mode == (int)Common.Constant.Mode.Modify) { objCityBL.Update(_CityID, _StateID, txtCityName.Text); } if (objCityBL.Exception == null) { if (objCityBL.ErrorMessage != "") { lblErrorMessage.Text = objCityBL.ErrorMessage; txtCityName.Focus(); ReturnValue = false; } else { lblErrorMessage.Text = "No error"; ReturnValue = true; } } else { MessageBox.Show(objCityBL.Exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Information); ReturnValue = false; } } } catch (Exception exc) { Utill.Common.ExceptionLogger.writeException("City", exc.StackTrace); MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception"); } return(ReturnValue); }
public ActionResult <EditCityResponseModel> EditCity([FromBody] EditCityInputModel data) { EditCityResponseModel res = new EditCityResponseModel(); try { CityBL bl = new CityBL(db); var res2 = bl.Update(data); res.data = res2; res.Message = res.Message; res.Response = true; return(res); } catch (Exception ex) { res.Message = ex.Message; res.Response = false; return(res); } }
public JsonResultEntity Update([FromBody] CityEntity cityEntity) { CityBL cityBL = new CityBL(); JsonResultEntity response = new JsonResultEntity(); try { var result = cityBL.Update(cityEntity); if (result.HasWarning() || result.Value == null) { response.Message = String.Join(",", result.Warning); return(response); } response.Success = true; response.Data = result.Value; } catch (Exception e) { response.Message = e.Message; LoggerHelper.Error(e); } return(response); }
public ResponseModel Update(RequestModel model) { var cityBL = new CityBL(); return(cityBL.Update(model.Data)); }