Example #1
0
        public async Task <List <SellPolicyLinkDetails> > GetPolicyLinkByDetails(SellPolicyLinkDetails details)
        {
            List <SellPolicyLinkDetails> detailsResponse = null;

            using (IDbConnection dbConnection = this.GetConnection())
            {
                try
                {
                    dbConnection.Open();
                    var result = await dbConnection.QueryMultipleAsync("GetPolicyLinkByDetails", new
                    {
                        details.BusinessTypeId,
                        details.PolicyTypeId,
                        details.RTO_Id,
                        details.SegmentId,
                    }
                                                                       , commandType : CommandType.StoredProcedure);

                    var entities = await result.ReadAsync <SellPolicyLinkDetails>();

                    detailsResponse = entities.ToList();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    dbConnection.Close();
                }
            }

            return(detailsResponse);
        }
Example #2
0
        public async Task <SellPolicyLinkDetails> CreatePolicyLink(SellPolicyLinkDetails details)
        {
            SellPolicyLinkDetails detailsResponse = new SellPolicyLinkDetails();

            using (IDbConnection dbConnection = this.GetConnection())
            {
                try
                {
                    dbConnection.Open();
                    var result = await dbConnection.QueryMultipleAsync("CreatePolicyLink", new
                    {
                        details.BusinessTypeId,
                        details.PolicyTypeId,
                        details.RTO_Id,
                        details.SegmentId,
                        details.URL,
                    }, commandType : CommandType.StoredProcedure);

                    //var entities = await result.ReadAsync<SellPolicyLinkDetails>();

                    //detailsResponse = entities.FirstOrDefault();
                }
                catch (Exception ex)
                {
                    detailsResponse.Error = ex.Message;
                    return(detailsResponse);
                }
                finally
                {
                    dbConnection.Close();
                }
            }

            return(detailsResponse);
        }
Example #3
0
        public async Task <IActionResult> CreatePolicyLink([FromBody] SellPolicyLinkDetails details)
        {
            dynamic resp = null;

            try
            {
                resp = await _sellPolicyManager.CreatePolicyLink(details);
            } catch (Exception e)
            {
                return(Ok(new { error = e.Message }));
            }
            return(Ok(resp));
        }
Example #4
0
        public async Task <IActionResult> GetPolicyLinkByDetails([FromBody] SellPolicyLinkDetails data)
        {
            var d = await _sellPolicyManager.GetPolicyLinkByDetails(data);

            return(Ok(d));
        }
Example #5
0
 public Task <List <SellPolicyLinkDetails> > GetPolicyLinkByDetails(SellPolicyLinkDetails details)
 {
     return(_sellPolicyRepository.GetPolicyLinkByDetails(details));
 }
Example #6
0
 public Task <SellPolicyLinkDetails> CreatePolicyLink(SellPolicyLinkDetails details)
 {
     return(_sellPolicyRepository.CreatePolicyLink(details));
 }