/// <summary> /// Check processing. /// </summary> /// <param name="inputObject">DataModel</param> private void Check(InitDataModel inputObject) { // Local variable declaration ClientItemDetailsDao clientItemDetailsDao = null; // Variable initialize clientItemDetailsDao = new ClientItemDetailsDao(); // Check valid if (!clientItemDetailsDao.IsExistItem(inputObject.ItemCd)) throw new DataNotExistException(string.Format("Sản phẩm ({0})", inputObject.ItemCd)); }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(BuyDataModel inputObject) { // Local variable declaration ClientItemDetailsDao clientItemDetailsDao = null; // Variable initialize clientItemDetailsDao = new ClientItemDetailsDao(); // Check valid if (!clientItemDetailsDao.IsExistItem(inputObject.ItemCd)) throw new DataNotExistException(string.Format("Sản phẩm ({0})", inputObject.ItemCd)); if (DataCheckHelper.IsNull(inputObject.ItemQtty)) throw new ExecuteException("E_MSG_00001", "Số lượng"); if (inputObject.ItemQtty <= decimal.Zero) throw new ExecuteException("E_MSG_00011", "Số lượng"); }
/// <summary> /// Get infomation /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>DataModel</returns> private InitDataModel GetInfo(InitDataModel inputObject) { // Local variable declaration InitDataModel getResult = null; ClientItemDetailsDao clientItemDetailsDao = null; ItemCom itemCom = null; MParameterCom mParameterCom = null; // Variable initialize getResult = new InitDataModel(); clientItemDetailsDao = new ClientItemDetailsDao(); itemCom = new ItemCom(); mParameterCom = new MParameterCom(); // Get data var item = clientItemDetailsDao.GetItem(inputObject); var listRelation = clientItemDetailsDao.GetListItemsByBrandCd(item.BrandCd, inputObject.ItemCd); var strHotline = mParameterCom.GetString(Logics.PR_HOTLINE, false); // Update data itemCom.UpdateViewer(inputObject.ItemCd); // Set value getResult.Item = itemCom.ToItemModel(item); getResult.ListRelation = itemCom.ToListItemModel(listRelation); getResult.Hotline = strHotline; // Return value return getResult; }