/// <summary> /// Update item to cart /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private UpdateDataModel UpdateInfo(UpdateDataModel inputObject) { // Local variable declaration UpdateDataModel getResult = null; CartCom cartCom = null; // Variable initialize getResult = new UpdateDataModel(); cartCom = new CartCom(inputObject.Cart); // Get data foreach (var obj in inputObject.ListItems) { if (DataCheckHelper.IsNull(obj.Quantity) || obj.Quantity < decimal.Zero) { continue; } var item = new CartItem(); item.ItemCd = obj.ItemCd; item.Quantity = obj.Quantity.Value; cartCom.UpdateItem(item); } // Set value getResult.Cart = cartCom.Items; // Return value return(getResult); }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration StorageFileCom storageFileCom = null; // Variable initialize storageFileCom = new StorageFileCom(); // Check valid int i = 0; foreach (var obj in inputObject.ListFiles) { if (DataCheckHelper.IsNull(obj.FileId)) { throw new ExecuteException("E_MSG_00004", string.Format("Mã tập tin ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.FileNo)) { throw new ExecuteException("E_MSG_00004", string.Format("Số tập tin ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.SortKey)) { throw new ExecuteException("E_MSG_00004", string.Format("Thứ tự ({0})", i + 1)); } if (!storageFileCom.IsExist(obj.FileId, obj.FileNo, true)) { throw new DataNotExistException(string.Format("Tập tin ({0})", i + 1)); } i++; } }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration DataCom dataCom = null; CartCom cartCom = null; // Variable initialize dataCom = new DataCom(); cartCom = new CartCom(inputObject.Cart); // Check valid foreach (var item in cartCom.Items) { if (!dataCom.IsExist <Item>(item.ItemCd, false)) { throw new DataNotExistException(string.Format("Sản phẩm ({0})", item.ItemCd)); } if (DataCheckHelper.IsNull(item.Quantity)) { throw new ExecuteException("E_MSG_00001", "Số lượng"); } if (item.Quantity <= decimal.Zero) { throw new ExecuteException("E_MSG_00011", "Số lượng"); } } }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration AdminCategoryListDao adminCategoryListDao = null; MCodeCom mCodeCom = null; // Variable initialize adminCategoryListDao = new AdminCategoryListDao(); mCodeCom = new MCodeCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_CATEGORIES)) { throw new ExecuteException("E_MSG_00013"); } // Check valid int i = 0; foreach (var obj in inputObject.ListCategories) { var dFlag = DataHelper.ToString(obj.DeleteFlag); if (DataCheckHelper.IsNull(obj.CategoryName)) { throw new ExecuteException("E_MSG_00004", string.Format("Tên loại ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.CategoryDiv)) { throw new ExecuteException("E_MSG_00004", string.Format("Chủng loại ({0})", i + 1)); } if (!mCodeCom.IsExist(Logics.GROUP_CATEGORY_DIV, obj.CategoryDiv, false)) { throw new DataNotExistException(string.Format("Chủng loại ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.SortKey)) { throw new ExecuteException("E_MSG_00004", string.Format("Thứ tự ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.DeleteFlag)) { throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1)); } if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false)) { throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1)); } if (!adminCategoryListDao.IsExistCategory(obj.CategoryCd)) { throw new DataNotExistException(string.Format("Loại sản phẩm ({0})", i + 1)); } i++; } }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration AdminOfferItemListDao adminOfferItemListDao = null; MCodeCom mCodeCom = null; // Variable initialize adminOfferItemListDao = new AdminOfferItemListDao(); mCodeCom = new MCodeCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_OFFERS)) { throw new ExecuteException("E_MSG_00013"); } // Check valid int i = 0; foreach (var obj in inputObject.ListOfferItems) { if (DataCheckHelper.IsNull(obj.OfferItemCd)) { throw new ExecuteException("E_MSG_00004", string.Format("Mã sản phẩm ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.OfferItemQtty)) { throw new ExecuteException("E_MSG_00004", string.Format("Số lượng ({0})", i + 1)); } if (obj.OfferItemQtty <= 0) { throw new ExecuteException("E_MSG_00011", "Số lượng"); } var dFlag = DataHelper.ToString(obj.DeleteFlag); if (DataCheckHelper.IsNull(obj.DeleteFlag)) { throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1)); } if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false)) { throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1)); } if (!adminOfferItemListDao.IsExistItem(obj.OfferItemCd)) { throw new DataNotExistException(string.Format("Mã sản phẩm ({0})", i + 1)); } if (!adminOfferItemListDao.IsExistOfferItem(obj.OfferCd, obj.DetailNo)) { throw new DataNotExistException(string.Format("Sản phẩm tặng ({0})", i + 1)); } i++; } }
/// <summary> /// Execute convert output. /// </summary> /// <param name="resultObject">DataModel</param> /// <returns>ResponseModel</returns> private UpdateResponseModel Convert(UpdateDataModel resultObject) { // Local variable declaration UpdateResponseModel responseModel = null; // Variable initialize responseModel = new UpdateResponseModel(); // Set value responseModel.Cart = resultObject.Cart; // Return value return(responseModel); }
/// <summary> /// Execute convert input. /// </summary> /// <param name="request">RequestModel</param> /// <returns>DataModel</returns> private UpdateDataModel Convert(UpdateRequestModel request) { // Local variable declaration UpdateDataModel inputObject = null; // Variable initialize inputObject = new UpdateDataModel(); // Convert data input DataHelper.ConvertInput(request, inputObject); // Return value return(inputObject); }
/// <summary> /// Execute convert input. /// </summary> /// <param name="request">RequestModel</param> /// <returns>DataModel</returns> private UpdateDataModel Convert(UpdateRequestModel request) { // Local variable declaration UpdateDataModel inputObject = null; // Variable initialize inputObject = new UpdateDataModel(); // Convert data input DataHelper.ConvertInput(request, inputObject); // Return value return inputObject; }
/// <summary> /// Execute convert output. /// </summary> /// <param name="resultObject">DataModel</param> /// <returns>ResponseModel</returns> private UpdateResponseModel Convert(UpdateDataModel resultObject) { // Local variable declaration UpdateResponseModel responseModel = null; // Variable initialize responseModel = new UpdateResponseModel(); // Add message responseModel.AddMessage(MessageHelper.GetMessageInfo("I_MSG_00001")); // Return value return(responseModel); }
/// <summary> /// Execute command event for update button. /// </summary> /// <param name="parameter">Command parameter.</param> public override void Execute(object parameter) { try { UpdateDataModel model = new UpdateDataModel(); model.AltitudeColumn = this.parent.Input.AltitudeColumn; model.AltitudeSytle = this.parent.Input.AltitudeSytle; model.AltitudeConstant = this.parent.Input.AltitudeConstant; model.AlphaConstant = this.parent.Input.AlphaConstant; model.BetaConstant = this.parent.Input.BetaConstant; model.ColorColumn = this.parent.Input.ColorColumn; model.ColorPalette = this.parent.Input.ColorPalette; model.ColorScheme = this.parent.Input.ColorScheme; model.ColorMax = this.parent.Input.ColorMax; model.ColorMin = this.parent.Input.ColorMin; model.DeltaLatitude = this.parent.Input.DeltaLatitude; model.DeltaLongitude = this.parent.Input.DeltaLongitude; model.RColumn = this.parent.Input.RColumn; model.GColumn = this.parent.Input.GColumn; model.BColumn = this.parent.Input.BColumn; model.MinLatitude = this.parent.Input.MinLatitude; model.MaxLatitude = this.parent.Input.MaxLatitude; model.MinLongitude = this.parent.Input.MinLongitude; model.MaxLongitude = this.parent.Input.MaxLongitude; model.FilterBetweenBoundaries = this.parent.Input.FilterBetweenBoundaries; WorkflowController.Instance.GenerateWWTColumns(model); // WorkflowController.Instance.GenerateHuricaneColumns(model); } catch (CustomException ex) { Ribbon.ShowError(ex.HasCustomMessage ? ex.Message : Resources.LayerOperationError); } catch (Exception exception) { Logger.LogException(exception); Ribbon.ShowError(Resources.DefaultErrorMessage); } // Closing the popup. this.parent.OnRequestClose(); }
public static string GetGeometry(double lat, double lon, UpdateDataModel input) { //double ln1 = lon - deltaLong; //double lt1 = lat - deltaLat; //double ln2 = lon + deltaLong; //double lt2 = lat + deltaLat; // return string.Format("Polygon(({0} {1},{0} {3}, {2} {3},{2} {1},{0} {1}))", ln1, lt1, ln2, lt2); return(string.Format( "Polygon(({0} {1},{0} {3}, {2} {3},{2} {1},{0} {1}))", lon - input.DeltaLongitude, lat - input.DeltaLatitude, lon + input.DeltaLongitude, lat + input.DeltaLatitude)); }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration AdminGroupListDao adminGroupListDao = null; MCodeCom mCodeCom = null; // Variable initialize adminGroupListDao = new AdminGroupListDao(); mCodeCom = new MCodeCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_USERS)) { throw new ExecuteException("E_MSG_00013"); } // Check valid int i = 0; foreach (var obj in inputObject.ListGroups) { var dFlag = DataHelper.ToString(obj.DeleteFlag); if (DataCheckHelper.IsNull(obj.GroupName)) { throw new ExecuteException("E_MSG_00004", string.Format("Tên nhóm ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.SortKey)) { throw new ExecuteException("E_MSG_00004", string.Format("Thứ tự ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.DeleteFlag)) { throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1)); } if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false)) { throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1)); } if (!adminGroupListDao.IsExistGroup(obj.GroupCd)) { throw new DataNotExistException(string.Format("Nhóm ({0})", i + 1)); } i++; } }
public static double GetAltitudeValue(double altValue, UpdateDataModel input) { double updatedValue = altValue; switch (input.AltitudeSytle) { case AltitudeStyle.Constant: updatedValue = altValue + input.AltitudeConstant; break; case AltitudeStyle.Linear: updatedValue = input.AlphaConstant + (altValue * input.BetaConstant); break; } return(updatedValue); }
private async Task <IActionResult> SportDataToHtml(IEnumerable <Base> sporDataColletion, string parentIdPropertyName) { if (sporDataColletion != null) { var resultList = new List <UpdateDataModel>(); foreach (var ev in sporDataColletion) { var model = new UpdateDataModel(); model.ParentContainerID = (int)ev.GetType().GetProperty(parentIdPropertyName).GetValue(ev); model.DataHtml = await this._viewRenderer.RenderToStringAsync("Home/_EventPatialView", ev); } return(Json(resultList)); } return(BadRequest()); }
public ReturnModel UpdateData([FromBody] UpdateDataModel model, string accessToken) { var account = _readOnlyRepository.First <Account>(account1 => account1.Token == accessToken); ReturnModel remodel = new ReturnModel(); if (account != null) { if (account.VerifyToken(account)) { account.FirstName = model.FirstName; account.LastName = model.LastName; var Updateaccount = _writeOnlyRepository.Update(account); ReturnUpdateDataModel updatemodel = _mappingEngine.Map <Account, ReturnUpdateDataModel>(account); return(updatemodel.ConfigureModel("Successfull", "Se actualizo correctamente su informacion", remodel)); } return(remodel.ConfigureModel("Error", "Su session ya expiro", remodel)); } return(remodel.ConfigureModel("Error", "No se pudo acceder a su cuenta", remodel)); }
/// <summary> /// Update item to cart /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private UpdateDataModel UpdateInfo(UpdateDataModel inputObject) { // Local variable declaration UpdateDataModel getResult = null; AdminAcceptListDao adminAcceptListDao = null; // Variable initialize getResult = new UpdateDataModel(); adminAcceptListDao = new AdminAcceptListDao(); // Update data foreach (var obj in inputObject.ListAccepts) { adminAcceptListDao.UpdateAccept(obj); } // Submit data adminAcceptListDao.SubmitChanges(); // Return value return(getResult); }
/// <summary> /// Update data /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private UpdateDataModel UpdateInfo(UpdateDataModel inputObject) { // Local variable declaration UpdateDataModel getResult = null; StorageFileCom storageFileCom = null; // Variable initialize getResult = new UpdateDataModel(); storageFileCom = new StorageFileCom(); // Get data foreach (var obj in inputObject.ListFiles) { storageFileCom.UpdateSortKey(obj, true); } // Submit data storageFileCom.SubmitChanges(); // Return value return(getResult); }
/// <summary> /// Update data /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private UpdateDataModel UpdateInfo(UpdateDataModel inputObject) { // Local variable declaration UpdateDataModel getResult = null; MParameterCom mParameterCom = null; // Variable initialize getResult = new UpdateDataModel(); mParameterCom = new MParameterCom(); // Get data foreach (var obj in inputObject.ListParams) { mParameterCom.Update(obj, false); } // Submit data mParameterCom.SubmitChanges(); // Return value return(getResult); }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration MParameterCom mParameterCom = null; // Variable initialize mParameterCom = new MParameterCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_SYSTEMS)) { throw new ExecuteException("E_MSG_00013"); } // Check valid int i = 0; foreach (var obj in inputObject.ListParams) { if (DataCheckHelper.IsNull(obj.ParamValue)) { throw new ExecuteException("E_MSG_00004", string.Format("Giá trị ({0})", i + 1)); } if (!mParameterCom.IsExist(obj.ParamCd, false)) { throw new DataNotExistException(string.Format("Tham số ({0})", i + 1)); } var paramType = mParameterCom.GetType(obj.ParamCd, false); if (paramType == Logics.PT_NUMBER && !DataCheckHelper.IsNumber(obj.ParamValue)) { throw new ExecuteException("E_MSG_00001", string.Format("Giá trị ({0})", i + 1)); } if (paramType == Logics.PT_DATE && !DataCheckHelper.IsDate(obj.ParamValue)) { throw new ExecuteException("E_MSG_00001", string.Format("Giá trị ({0})", i + 1)); } i++; } }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration AdminCategoryListDao adminCategoryListDao = null; MCodeCom mCodeCom = null; // Variable initialize adminCategoryListDao = new AdminCategoryListDao(); mCodeCom = new MCodeCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_CATEGORIES)) throw new ExecuteException("E_MSG_00013"); // Check valid int i = 0; foreach (var obj in inputObject.ListCategories) { var dFlag = DataHelper.ToString(obj.DeleteFlag); if (DataCheckHelper.IsNull(obj.CategoryName)) throw new ExecuteException("E_MSG_00004", string.Format("Tên loại ({0})", i + 1)); if (DataCheckHelper.IsNull(obj.CategoryDiv)) throw new ExecuteException("E_MSG_00004", string.Format("Chủng loại ({0})", i + 1)); if (!mCodeCom.IsExist(Logics.GROUP_CATEGORY_DIV, obj.CategoryDiv, false)) throw new DataNotExistException(string.Format("Chủng loại ({0})", i + 1)); if (DataCheckHelper.IsNull(obj.SortKey)) throw new ExecuteException("E_MSG_00004", string.Format("Thứ tự ({0})", i + 1)); if (DataCheckHelper.IsNull(obj.DeleteFlag)) throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1)); if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false)) throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1)); if (!adminCategoryListDao.IsExistCategory(obj.CategoryCd)) throw new DataNotExistException(string.Format("Loại sản phẩm ({0})", i + 1)); i++; } }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration AdminAcceptListDao adminAcceptListDao = null; MCodeCom mCodeCom = null; // Variable initialize adminAcceptListDao = new AdminAcceptListDao(); mCodeCom = new MCodeCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_ACCEPTS)) { throw new ExecuteException("E_MSG_00013"); } // Check valid int i = 0; foreach (var obj in inputObject.ListAccepts) { if (DataCheckHelper.IsNull(obj.SlipStatus)) { throw new ExecuteException("E_MSG_00004", string.Format("Trạng thái ({0})", i + 1)); } if (!mCodeCom.IsExist(Logics.GROUP_SLIP_STATUS, obj.SlipStatus, false)) { throw new DataNotExistException(string.Format("Trạng thái ({0})", i + 1)); } if (!adminAcceptListDao.IsExistAccept(obj.AcceptSlipNo)) { throw new DataNotExistException(string.Format("Hóa đơn ({0})", i + 1)); } i++; } }
/// <summary> /// Execute processing. /// </summary> /// <param name="request">RequestModel</param> /// <returns>ResponseModel</returns> private UpdateResponseModel Execute(UpdateRequestModel request) { // Local variable declaration UpdateResponseModel responseModel = null; UpdateDataModel inputObject = null; UpdateDataModel resultObject = null; // Variable initialize responseModel = new UpdateResponseModel(); // Execute convert input. inputObject = Convert(request); // Check infomation Check(inputObject); // Update infomation resultObject = UpdateInfo(inputObject); // Execute convert ouput. responseModel = Convert(resultObject); return(responseModel); }
/// <summary> /// Execute convert output. /// </summary> /// <param name="resultObject">DataModel</param> /// <returns>ResponseModel</returns> private UpdateResponseModel Convert(UpdateDataModel resultObject) { // Local variable declaration UpdateResponseModel responseModel = null; // Variable initialize responseModel = new UpdateResponseModel(); // Add message responseModel.AddMessage(MessageHelper.GetMessageInfo("I_MSG_00001")); // Return value return responseModel; }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration AdminOfferListDao adminOfferListDao = null; MCodeCom mCodeCom = null; // Variable initialize adminOfferListDao = new AdminOfferListDao(); mCodeCom = new MCodeCom(); // Check role if (!PageHelper.AuthRole(Logics.RL_OFFERS)) { throw new ExecuteException("E_MSG_00013"); } // Check valid int i = 0; foreach (var obj in inputObject.ListOffers) { var dFlag = DataHelper.ToString(obj.DeleteFlag); if (DataCheckHelper.IsNull(obj.OfferCd)) { throw new ExecuteException("E_MSG_00004", string.Format("Khuyến mãi ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.ItemCd)) { throw new ExecuteException("E_MSG_00004", string.Format("Sản phẩm ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.StartDate)) { throw new ExecuteException("E_MSG_00004", string.Format("Ngày bắt đầu ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.EndDate)) { throw new ExecuteException("E_MSG_00004", string.Format("Ngày kết thúc ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.Percent)) { throw new ExecuteException("E_MSG_00004", string.Format("Giảm ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.OfferGroupCd)) { throw new ExecuteException("E_MSG_00004", string.Format("Nhóm khuyến mãi ({0})", i + 1)); } if (DataCheckHelper.IsNull(obj.DeleteFlag)) { throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1)); } if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false)) { throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1)); } if (DateTime.Compare(obj.StartDate.Value, obj.EndDate.Value) > 0) { throw new ExecuteException("E_MSG_00015", "Ngày bắt đầu", "Ngày kết thúc"); } if (obj.Percent < 0) { throw new ExecuteException("E_MSG_00011", string.Format("Giảm ({0})", i + 1)); } if (!adminOfferListDao.IsExistItem(obj.ItemCd)) { throw new DataNotExistException(string.Format("Sản phẩm ({0})", i + 1)); } if (!adminOfferListDao.IsExistOffer(obj.OfferCd)) { throw new DataNotExistException(string.Format("Khuyến mãi ({0})", i + 1)); } i++; } }
public async Task <IActionResult> UpdateAsync([FromBody] UpdateDataModel model) { var dto = await _service.UpdateAsync(_mapper.Map <DataDTO>(model)); return(Ok(_mapper.Map <DataViewModel>(dto))); }
/// <summary> /// Update item to cart /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private UpdateDataModel UpdateInfo(UpdateDataModel inputObject) { // Local variable declaration UpdateDataModel getResult = null; AdminCategoryListDao adminCategoryListDao = null; // Variable initialize getResult = new UpdateDataModel(); adminCategoryListDao = new AdminCategoryListDao(); // Update data foreach (var obj in inputObject.ListCategories) { adminCategoryListDao.UpdateCategory(obj); } // Submit data adminCategoryListDao.SubmitChanges(); // Return value return getResult; }