/// <summary> /// Return Cellar ID To Specific Product ID and Cellar Area ID /// </summary> /// <param name="request">Product ID and Cellar Area ID</param> /// <returns>Cellar ID</returns> public static GetCellarResponse GetCellarIDByProductIDAndCellarArea(GetCellarRequest request) { GetCellarResponse response = new GetCellarResponse(); response.Error = new Handler.ErrorObject(); response.Cellar = new Cellars(); try { var bussines = CellarData.Select.GetCellarIDByProductIDAndCellarArea(request.ProductID, request.CellarAreaID); if (!bussines.Item1.Error) { response.Cellar = new Cellars() { amount = bussines.Item2 }; } else { response.Error.InfoError(bussines.Item1); } } catch (Exception ex) { response.Error.InfoError(ex); } return(response); }
/// <summary> /// Return Cellar Information To Specific Cellar ID /// </summary> /// <param name="request">Cellar ID</param> /// <returns>Cellar Information</returns> public static GetCellarResponse GetCellarByProductID(GetCellarRequest request) { GetCellarResponse response = new GetCellarResponse(); response.CellarList = new List <Cellars>(); response.Error = new Handler.ErrorObject(); try { var bussines = CellarData.Select.GetCellarByProductID(request.ProductID); if (!bussines.Item1.Error) { foreach (var item in bussines.Item2) { response.CellarList.Add(new Cellars() { id = item.id, amount = item.amount, detail = item.detail, Min = item.min, Max = item.max, idProduct = item.idProduct, idcellarArea = item.idcellarArea, createDate = item.createDate, upDateDate = item.upDateDate, deleteDate = item.deleteDate, state = item.state }); } } else { response.Error.InfoError(bussines.Item1); } } catch (Exception ex) { response.Error.InfoError(ex); } return(response); }
/// <summary> /// Return Amount To Specific Product ID and Cellar Area ID /// </summary> /// <param name="request">Product ID and Cellar Area ID</param> /// <returns>Amount</returns> public static GetCellarResponse GetCellarByProductIDAndCellarArea(GetCellarRequest request) { GetCellarResponse response = new GetCellarResponse(); response.Error = new Handler.ErrorObject(); response.Cellar = new Cellars(); try { var bussines = CellarData.Select.GetCellarByProductIDAndCellarArea(request.ProductID, request.CellarAreaID, request.conditionID, request.TransactionTypeID); if (!bussines.Item1.Error) { response.Cellar = new Cellars() { id = bussines.Item2.id, amount = bussines.Item2.amount, detail = bussines.Item2.detail, idProduct = bussines.Item2.idProduct, Min = bussines.Item2.min, Max = bussines.Item2.max, idcellarArea = bussines.Item2.idcellarArea, createDate = bussines.Item2.createDate, upDateDate = bussines.Item2.upDateDate, deleteDate = bussines.Item2.deleteDate, state = bussines.Item2.state }; } else { response.Error.InfoError(bussines.Item1); } } catch (Exception ex) { response.Error.InfoError(ex); } return(response); }
public static GetCellarResponse CellarAmount(GetCellarRequest request) { GetCellarResponse response = new GetCellarResponse(); response.Error = new Handler.ErrorObject(); try { var result = CellarData.Update.CellarAmoun(request.CellarID, request.amount); if (result.Item1.Error) { response.Error.InfoError(result.Item1); } else { response.Message = result.Item2; } } catch (Exception ex) { response.Error.InfoError(ex); } return(response); }
public static GetCellarResponse Cellar(GetCellarResponse cellarInformation, GetCellarRequest request) { GetCellarResponse response = new GetCellarResponse(); response.Error = new Handler.ErrorObject(); try { CellarAmount(request); var result = Transaction.TransactionConfigurateBussines.Insert.TransactionConfigurate(request.CellarID, request.TransactionTypeID, cellarInformation.transaction); response.Message = result.Message.ToString(); } catch (Exception ex) { response.Error.InfoError(ex); } return(response); }