public async Task <IActionResult> Delete(RequestDataModel request) { var settings = new JsonSerializerSettings(); var searchObject = new LocaltionModel { }; settings.DateFormatString = "dd/MM/yyyy"; searchObject = JsonConvert.DeserializeObject <LocaltionModel>(request.model, settings); var localtion = new LocaltionModel(); localtion = searchObject; localtion.LastModifyDate = DateTime.Now; var hostAPI = url; var rs = await ApiProvider.PostAsync <int>(hostAPI, ApiConstant.DeleteLocaltion, localtion); if (rs == Constant.ReturnExcuteFunction.Success) { return(Json(new { messege = "Thành công !" })); } else { return(Json(new { messege = "Thất bại!" })); } }
public int CreateOrUpdate(LocaltionModel model) { string msgError = ""; try { var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "LOCALTION_INSERT_OR_UPDATE", "@id", model.Id, "@localtion_code", model.Localtion_Code, "@localtion_name", model.Localtion_Name, "@point_x", model.Point_X, "@poin_y", model.Point_Y, "@description", model.Description, "@active", model.Active); if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError)) { throw new Exception(Convert.ToString(result) + msgError); } else { return(Constant.ReturnExcuteFunction.Success); } } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> GetByID(RequestDataModel request) { var settings = new JsonSerializerSettings(); var searchObject = new LocaltionModel { }; settings.DateFormatString = "dd/MM/yyyy"; searchObject = JsonConvert.DeserializeObject <LocaltionModel>(request.model, settings); var localtion = new LocaltionModel(); localtion = searchObject; localtion.LastModifyDate = DateTime.Now; var hostAPI = url; var rs = await ApiProvider.PostAsync <LocaltionModel>(hostAPI, ApiConstant.GetLocaltionId, localtion); return(Json(rs)); }
public int Delete(LocaltionModel model) { string msgError = ""; try { var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "sp_localtion_delete", "@id", model.Id); if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError)) { throw new Exception(Convert.ToString(result) + msgError); } else { return(Constant.ReturnExcuteFunction.Success); } } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> GetData(RequestDataModel request) { var localtionModelParamater = new LocaltionModelParameter(); var settings = new JsonSerializerSettings(); var searchObject = new LocaltionModel { }; settings.DateFormatString = "dd/MM/yyyy"; searchObject = JsonConvert.DeserializeObject <LocaltionModel>(request.model, settings); var page = new PageParameter { PageIndex = request.start, PageSize = request.length }; localtionModelParamater.Page = page; localtionModelParamater.Data = searchObject; var hostAPI = url; var data = await ApiProvider.PostAsync <LocaltionReturnModel>(hostAPI, ApiConstant.GetAllLocaltion, localtionModelParamater); return(Json(data)); }
public int Delete(LocaltionModel model) { return(_res.Delete(model)); }
public int CreateOrUpdate(LocaltionModel model) { return(_res.CreateOrUpdate(model)); }
public int Delete([FromBody] LocaltionModel model) { return(_bus.Delete(model)); }
public int CreateOrUpdate([FromBody] LocaltionModel model) { return(_bus.CreateOrUpdate(model)); }
public LocaltionModel GetDataID([FromBody] LocaltionModel model) { return(_bus.GetDataByID(model.Id)); }