/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private void Check(InitDataModel inputObject) { // Local variable declaration var adminOfferItemEntryDao = new AdminOfferItemEntryDao(); // Check role if (!PageHelper.AuthRole(Logics.RL_OFFERS)) throw new ExecuteException("E_MSG_00013"); // Exist group if (!adminOfferItemEntryDao.IsExistOffer(inputObject.OfferCd)) throw new DataNotExistException("Khuyến mãi"); }
/// <summary> /// Execute convert input. /// </summary> /// <param name="request">RequestModel</param> /// <returns>DataModel</returns> private InitDataModel Convert(InitRequestModel request) { // Local variable declaration InitDataModel inputObject = null; // Variable initialize inputObject = new InitDataModel(); // Convert data input DataHelper.ConvertInput(request, inputObject); // Return value return inputObject; }
/// <summary> /// Execute convert ouput. /// </summary> /// <param name="resultObject">DataModel</param> /// <returns>ResponseModel</returns> private InitResponseModel Convert(InitDataModel resultObject) { // Local variable declaration InitResponseModel response = null; OutputDetailsModel details = null; // Variable initialize response = new InitResponseModel(); details = new OutputDetailsModel(); // Get value details.OfferCd = DataHelper.ToString(resultObject.OfferCd); details.DeleteFlag = DataHelper.ToString(resultObject.DeleteFlag); var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag); details.ListDeleteFlag = cbDeleteFlag.ListItems; details.DeleteFlag = cbDeleteFlag.SeletedValue; // Set value response.Details = new List<OutputDetailsModel>() { details }; // Return value return response; }
/// <summary> /// Get infomation /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private InitDataModel GetInfo(InitDataModel inputObject) { // Local variable declaration InitDataModel getResult = null; MCodeCom mCodeCom = null; // Variable initialize getResult = new InitDataModel(); mCodeCom = new MCodeCom(); // Get data var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false); // Set value getResult.OfferCd = inputObject.OfferCd; getResult.ListDeleteFlag = listDeleteFlag; // Return value return getResult; }