Exemple #1
0
        public IEnumerable <RBICompoundingOrder> GetRBICompoundingOrder(RBICompoundingOrder rBICompoundingOrder)
        {
            using (DemsifyEntities dataContext = new DemsifyEntities())
            {
                ObjectParameter totalPageCount = new ObjectParameter("TotalPageCount", typeof(int));
                ObjectParameter totalRecord    = new ObjectParameter("TotalRecord", typeof(int));

                var rBICompoundingOrders = dataContext.RBICompoundingOrderGet(rBICompoundingOrder.RBICompoundingOrderId, Utility.TrimString(rBICompoundingOrder.SearchText), rBICompoundingOrder.IsActive, rBICompoundingOrder.PageNumber, rBICompoundingOrder.PageSize, rBICompoundingOrder.IsPagingRequired, Utility.TrimString(rBICompoundingOrder.OrderBy), Utility.TrimString(rBICompoundingOrder.OrderByDirection), totalPageCount, totalRecord).ToList();

                var rBICompoundingOrderList = new List <RBICompoundingOrder>();
                foreach (var rBICompoundingOrderDetail in rBICompoundingOrders)
                {
                    rBICompoundingOrderList.Add(new RBICompoundingOrder()
                    {
                        RBICompoundingOrderId = rBICompoundingOrderDetail.RBICompoundingOrderId,
                        ApplicantName         = rBICompoundingOrderDetail.ApplicantName,
                        OrderGist             = rBICompoundingOrderDetail.OrderGist,
                        Topic = rBICompoundingOrderDetail.Topic,
                        FEMRegulationRuleNo         = rBICompoundingOrderDetail.FEMRegulationRuleNo,
                        OrderDate                   = rBICompoundingOrderDetail.OrderDate,
                        PenaltyAmount               = rBICompoundingOrderDetail.PenaltyAmount,
                        Regional_CentralOfficeOfRBI = rBICompoundingOrderDetail.Regional_CentralOfficeOfRBI,
                        PDF            = rBICompoundingOrderDetail.PDF,
                        IsActive       = rBICompoundingOrderDetail.IsActive,
                        TotalPageCount = Convert.ToInt32(totalPageCount.Value),
                        TotalRecord    = Convert.ToInt32(totalRecord.Value)
                    });
                }
                return(rBICompoundingOrderList);
            }
        }
Exemple #2
0
        public int DeleteRBICompoundingOrder(RBICompoundingOrder rBICompoundingOrder)
        {
            using (DemsifyEntities dataContext = new DemsifyEntities())
            {
                ObjectParameter result = new ObjectParameter("Result", typeof(int));

                dataContext.RBICompoundingOrderDelete(rBICompoundingOrder.RBICompoundingOrderId, rBICompoundingOrder.ModifiedBy, result);

                return(Convert.ToInt32(result.Value));
            }
        }
Exemple #3
0
        public int UpdateRBICompoundingOrder(RBICompoundingOrder rBICompoundingOrder)
        {
            using (DemsifyEntities dataContext = new DemsifyEntities())
            {
                ObjectParameter result = new ObjectParameter("Result", typeof(int));

                dataContext.RBICompoundingOrderUpdate(rBICompoundingOrder.RBICompoundingOrderId, Utility.TrimString(rBICompoundingOrder.ApplicantName), Utility.TrimString(rBICompoundingOrder.OrderGist), Utility.TrimString(rBICompoundingOrder.Topic), Utility.TrimString(rBICompoundingOrder.FEMRegulationRuleNo), rBICompoundingOrder.OrderDate, rBICompoundingOrder.PenaltyAmount, Utility.TrimString(rBICompoundingOrder.Regional_CentralOfficeOfRBI), Utility.TrimString(rBICompoundingOrder.PDF), rBICompoundingOrder.ModifiedBy, result);

                return(Convert.ToInt32(result.Value));
            }
        }
Exemple #4
0
        public IHttpActionResult DeleteRBICompoundingOrder(DeleteRBICompoundingOrderRequest deleteRBICompoundingOrderRequest)
        {
            var responses = new Responses();

            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (Utility.UserId < 0)
                {
                    return(BadRequest(Utility.INVALID_USER));
                }

                var rBICompoundingOrder = new RBICompoundingOrder()
                {
                    RBICompoundingOrderId = deleteRBICompoundingOrderRequest.RBICompoundingOrderId,
                    ModifiedBy            = Utility.UserId
                };

                int result = iRBICompoundingOrder.DeleteRBICompoundingOrder(rBICompoundingOrder);
                switch (result)
                {
                case 1:
                    responses.Status      = Utility.SUCCESS_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder deleted successfully.";
                    break;

                case -2:
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder doesn't exist.";
                    break;

                default:
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "Error while deleting rbicompoundingorder.";
                    break;
                }
            }
            catch (Exception ex)
            {
                responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                responses.Description = "Error while deleting rbicompoundingorder.";

                Utility.WriteLog("DeleteRBICompoundingOrder", deleteRBICompoundingOrderRequest, "Error while deleting rbicompoundingorder. (RBICompoundingOrderAdminController)", ex.ToString());
            }
            return(Ok(responses));
        }
Exemple #5
0
        public IHttpActionResult AddRBICompoundingOrder(AddRBICompoundingOrderRequest addRBICompoundingOrderRequest)
        {
            var responses = new Responses();

            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                var rBICompoundingOrder = new RBICompoundingOrder()
                {
                    ApplicantName               = addRBICompoundingOrderRequest.ApplicantName,
                    OrderGist                   = addRBICompoundingOrderRequest.OrderGist,
                    Topic                       = addRBICompoundingOrderRequest.Topic,
                    FEMRegulationRuleNo         = addRBICompoundingOrderRequest.FEMRegulationRuleNo,
                    OrderDate                   = addRBICompoundingOrderRequest.OrderDate,
                    PenaltyAmount               = addRBICompoundingOrderRequest.PenaltyAmount,
                    Regional_CentralOfficeOfRBI = addRBICompoundingOrderRequest.Regional_CentralOfficeOfRBI,
                    PDF       = addRBICompoundingOrderRequest.PDF,
                    CreatedBy = Utility.UserId
                };
                int result = iRBICompoundingOrder.AddRBICompoundingOrder(rBICompoundingOrder);
                if (result > 0)
                {
                    responses.Status      = Utility.SUCCESS_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder added successfully.";
                }
                else if (result == -2)
                {
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder alread exists.";
                }
                else
                {
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "Error while adding rbicompoundingorder.";
                }
            }
            catch (Exception ex)
            {
                responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                responses.Description = "Error while adding rbicompoundingorder.";

                Utility.WriteLog("AddRBICompoundingOrder", addRBICompoundingOrderRequest, "Error while adding rbicompoundingorder. (RBICompoundingOrderAdminController)", ex.ToString());
            }
            return(Ok(responses));
        }
Exemple #6
0
        public IHttpActionResult GetRBICompoundingOrder([FromUri] GetRBICompoundingOrderRequest getRBICompoundingOrderRequest)
        {
            var responses = new Responses();

            try
            {
                if (Utility.UserId < 0)
                {
                    return(BadRequest(Utility.INVALID_USER));
                }

                if (getRBICompoundingOrderRequest == null)
                {
                    getRBICompoundingOrderRequest = new GetRBICompoundingOrderRequest();
                }

                if (getRBICompoundingOrderRequest.PageSize == null)
                {
                    getRBICompoundingOrderRequest.PageSize = Convert.ToInt32(ConfigurationManager.AppSettings["PageSize"]);
                }

                var rBICompoundingOrder = new RBICompoundingOrder()
                {
                    RBICompoundingOrderId = getRBICompoundingOrderRequest.RBICompoundingOrderId,
                    SearchText            = getRBICompoundingOrderRequest.SearchText,
                    IsActive         = getRBICompoundingOrderRequest.IsActive,
                    PageNumber       = getRBICompoundingOrderRequest.PageNumber,
                    PageSize         = Convert.ToInt32(getRBICompoundingOrderRequest.PageSize),
                    IsPagingRequired = (getRBICompoundingOrderRequest.PageNumber != null) ? true : false,
                    OrderBy          = getRBICompoundingOrderRequest.OrderBy,
                    OrderByDirection = getRBICompoundingOrderRequest.OrderByDirection
                };
                var rBICompoundingOrders = iRBICompoundingOrder.GetRBICompoundingOrder(rBICompoundingOrder);

                var rBICompoundingOrderList = new List <GetRBICompoundingOrderResponse>();
                foreach (var rBICompoundingOrderDetail in rBICompoundingOrders)
                {
                    rBICompoundingOrderList.Add(new GetRBICompoundingOrderResponse()
                    {
                        RBICompoundingOrderId = Convert.ToInt32(rBICompoundingOrderDetail.RBICompoundingOrderId),
                        ApplicantName         = rBICompoundingOrderDetail.ApplicantName,
                        OrderGist             = rBICompoundingOrderDetail.OrderGist,
                        Topic = rBICompoundingOrderDetail.Topic,
                        FEMRegulationRuleNo         = rBICompoundingOrderDetail.FEMRegulationRuleNo,
                        OrderDate                   = rBICompoundingOrderDetail.OrderDate,
                        PenaltyAmount               = rBICompoundingOrderDetail.PenaltyAmount,
                        Regional_CentralOfficeOfRBI = rBICompoundingOrderDetail.Regional_CentralOfficeOfRBI,
                        PDF            = rBICompoundingOrderDetail.PDF,
                        IsActive       = Convert.ToBoolean(rBICompoundingOrderDetail.IsActive),
                        CreatedBy      = rBICompoundingOrderDetail.CreatedBy,
                        TotalPageCount = rBICompoundingOrderDetail.TotalPageCount,
                        TotalRecord    = rBICompoundingOrderDetail.TotalRecord
                    });
                }

                responses.Status      = Utility.SUCCESS_STATUS_RESPONSE;
                responses.Description = "RBICompoundingOrder retrieved successfully";
                responses.Response    = rBICompoundingOrderList;
            }
            catch (Exception ex)
            {
                responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                responses.Description = "Error while retrieving rbicompoundingorder.";

                Utility.WriteLog("GetRBICompoundingOrder", getRBICompoundingOrderRequest, "Error while retrieving rbicompoundingorder. (RBICompoundingOrderAdminController)", ex.ToString());
            }
            return(Ok(responses));
        }
Exemple #7
0
        public IHttpActionResult UpdateRBICompoundingOrder(UpdateRBICompoundingOrderRequest updateRBICompoundingOrderRequest)
        {
            var responses = new Responses();

            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (Utility.UserId < 0)
                {
                    return(BadRequest(Utility.INVALID_USER));
                }

                var rBICompoundingOrder = new RBICompoundingOrder()
                {
                    RBICompoundingOrderId = updateRBICompoundingOrderRequest.RBICompoundingOrderId,
                    ApplicantName         = updateRBICompoundingOrderRequest.ApplicantName,
                    OrderGist             = updateRBICompoundingOrderRequest.OrderGist,
                    Topic = updateRBICompoundingOrderRequest.Topic,
                    FEMRegulationRuleNo         = updateRBICompoundingOrderRequest.FEMRegulationRuleNo,
                    OrderDate                   = updateRBICompoundingOrderRequest.OrderDate,
                    PenaltyAmount               = updateRBICompoundingOrderRequest.PenaltyAmount,
                    Regional_CentralOfficeOfRBI = updateRBICompoundingOrderRequest.Regional_CentralOfficeOfRBI,
                    PDF        = updateRBICompoundingOrderRequest.PDF,
                    ModifiedBy = Utility.UserId
                };
                int result = iRBICompoundingOrder.UpdateRBICompoundingOrder(rBICompoundingOrder);

                switch (result)
                {
                case 1:
                    responses.Status      = Utility.SUCCESS_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder updated successfully.";
                    break;

                case -2:
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder already exists.";
                    break;

                case -3:
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "RBICompoundingOrder doesn't exist.";
                    break;

                default:
                    responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                    responses.Description = "Error while updating rbicompoundingorder.";
                    break;
                }
            }
            catch (Exception ex)
            {
                responses.Status      = Utility.ERROR_STATUS_RESPONSE;
                responses.Description = "Error while updating admin profile.";

                Utility.WriteLog("UpdateRBICompoundingOrder", updateRBICompoundingOrderRequest, "Error while updating rbicompoundingorder. (RBICompoundingOrderAdminController)", ex.ToString());
            }
            return(Ok(responses));
        }