public List <int> getExitsQuoteProposal(QuoteCreateRequest obj, string _userI) { SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { List <int> ListQuote = QuoteDataLayer.GetInstance().getExitsQuoteProposal(connection, obj.ProposalList, obj.CustomerList, _userI); return(ListQuote); } }
public ActionMessage CreateQuote([FromBody] QuoteCreateRequest QuoteObj) { ActionMessage ret = new ActionMessage(); try { ret = QuoteService.GetInstance().CreateQuoteWithMutilProposal(QuoteObj, this.GetUserId()); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage CreateQuoteWithMutilProposal(QuoteCreateRequest QuoteObj, string _userI) { ActionMessage ret = new ActionMessage(); SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { try { int quoteId = 0; quoteId = QuoteDataLayer.GetInstance().InsertQuoteWithOutDetails(connection, _userI); int i = 0; foreach (int customerID in QuoteObj.CustomerList) { if (QuoteObj.CustomerList.Length == 1) { QuoteDataLayer.GetInstance().InsertQuoteCustomer(connection, quoteId, customerID, true); } else { if (i == 0) { QuoteDataLayer.GetInstance().InsertQuoteCustomer(connection, quoteId, customerID, true); } else { QuoteDataLayer.GetInstance().InsertQuoteCustomer(connection, quoteId, customerID, false); } } i++; } foreach (int proposalId in QuoteObj.ProposalList) { QuoteDataLayer.GetInstance().InsertQuoteProposal(connection, quoteId, proposalId); } ret.isSuccess = true; } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error"; ret.err.msgString = ex.Message; } } return(ret); }
public ListResponeMessage <int> getExitsQuote([FromBody] QuoteCreateRequest QuoteObj) { ListResponeMessage <int> ret = new ListResponeMessage <int>(); try { ret.data = QuoteService.GetInstance().getExitsQuoteProposal(QuoteObj, this.GetUserId()); ret.isSuccess = true; } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }