Пример #1
0
 public IHttpActionResult GetDCCentersByCity([FromUri] string city, [FromUri] int pageNumber)
 {
     try
     {
         return(Ok(_distributionCenterService.GetDistributionCentersByCity(city, pageNumber)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #2
0
 public IHttpActionResult GetDCWalletBalance(int id)
 {
     try
     {
         return(Ok(_distributionCenterService.GetDCWalletBalance(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #3
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Ok(_productService.GetAllDCProductsByCategoryId(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #4
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Ok(_vLCPaymentService.GetAllVLCPayementsByVLCId(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
 public IHttpActionResult Get()
 {
     try
     {
         return(Ok(_customerAgricultureService.GetAllCustomerAgriCultures()));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #6
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Ok(_customerService.GetCustomerByCustomerId(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #7
0
 public IHttpActionResult GetDCOrdersByStatus(int id, [FromUri] string orderStatus)
 {
     try
     {
         return(Ok(_dCOrderService.GetDCOrdersByOrderStatus(id, orderStatus)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #8
0
        // GET api/Customer

        public IHttpActionResult Get()
        {
            try
            {
                return(Ok(_userService.GetAllUsers()));
            }
            catch (PlatformModuleException ex)
            {
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }
 public IHttpActionResult GetDockCollectionSummaryByVLC(int id, [FromUri] DateTime collectionStartDate, [FromUri] DateTime collectionEndDate, [FromUri] int startShift, [FromUri] int endShift, [FromUri] int milkType)
 {
     try
     {
         return(Ok(_dockCollectionReportService.DockCollectionSummaryByVLC(id, collectionStartDate, collectionEndDate, startShift, endShift, milkType)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #10
0
 public IHttpActionResult Get([FromUri] int?pageNumber, [FromUri] int?count)
 {
     try
     {
         return(Ok(_vlcService.GetAllVLCAgentsByPageCount(pageNumber, count)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #11
0
 public IHttpActionResult GetCustomerCollectionSummary(int id)
 {
     try
     {
         return(Ok(_vlcService.GetCustomerCollectionSummary(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #12
0
 public IHttpActionResult GetContactUsDetails()
 {
     try
     {
         return(Ok(_loginService.GetContactUsDetails()));
     }
     catch (PlatformModuleException exception)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(exception.Message)));
     }
 }
Пример #13
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Ok(_dCAddressService.GetDefaultDCAddressByDCId(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #14
0
 public IHttpActionResult GetCustomerListByVLCId(int id, [FromUri] int pageNumber)
 {
     try
     {
         return(Ok(_customerService.GetCustomerListByVLCId(id, pageNumber)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #15
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         return(Ok(_vlcMilkCollectionService.GetVLCMilkCollectionById(id)));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #16
0
 public IHttpActionResult Get()
 {
     try
     {
         return(Ok(_adminService.UpdateMilkFixedRateDetails()));
     }
     catch (PlatformModuleException ex)
     {
         //Write Log Here
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #17
0
 public IHttpActionResult Get([FromUri] string productName)
 {
     try
     {
         ResponseDTO responseDTO = _productService.SearchDCProductsByProductName(productName);
         return(Ok(responseDTO));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #18
0
 public IHttpActionResult Delete(int id)
 {
     try
     {
         return(Ok(_dCOrderService.DeleteDCOrder(id)));
     }
     catch (PlatformModuleException ex)
     {
         //Write Log Here
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #19
0
 public IHttpActionResult Get([FromUri] int vlcId, [FromUri] DateTime collectionDate, [FromUri] int shift, [FromUri] int pageNumber)
 {
     try
     {
         ResponseDTO responseDTO = _vlcMilkCollectionService.GetVLCCustomerCollectionsByDateAndShift(vlcId, collectionDate, shift, pageNumber);
         return(Ok(responseDTO));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #20
0
        public IHttpActionResult Delete(int id)
        {
            try
            {
                //Delete Customer

                return(Ok(_vLCPaymentService.DeleteVLCPaymentDetail(id)));
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }
Пример #21
0
        public IHttpActionResult DeleteDistributionCenter(int id)
        {
            try
            {
                //Delete Customer

                return(Ok(_distributionCenterService.DeleteDistriubtionCenter(id)));
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }
Пример #22
0
 public IHttpActionResult DeleteVLCMilkCollection(int id)
 {
     try
     {
         //Delete Customer
         ResponseDTO responseDTO = _vlcMilkCollectionService.DeleteVLCMilkCollection(id);
         return(Ok(responseDTO));
     }
     catch (PlatformModuleException ex)
     {
         //Write Log Here
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #23
0
 public IHttpActionResult Delete(int id)
 {
     try
     {
         //Delete Customer
         _dCAddressService.DeleteDCAddress(id);
         return(Ok());
     }
     catch (PlatformModuleException ex)
     {
         //Write Log Here
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #24
0
 public IHttpActionResult PostResetPassword([FromBody] ResetPasswordDTO resetPasswordDTO)
 {
     try
     {
         if (resetPasswordDTO == null)
         {
             throw new ArgumentNullException("NULL");
         }
         return(Ok(_loginService.ResetPassword(resetPasswordDTO)));
     }
     catch (PlatformModuleException exception)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(exception.Message)));
     }
 }
Пример #25
0
 public IHttpActionResult Post(ProductDTO productDTO)
 {
     try
     {
         if (productDTO == null)
         {
             Ok(ResponseHelper.CreateResponseDTOForException("Argument Null"));
         }
         ResponseDTO responseDTO = _productService.AddProduct(productDTO);
         return(Ok(responseDTO));
     }
     catch (PlatformModuleException ex)
     {
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #26
0
 public IHttpActionResult Post([FromUri] String userName, [FromUri] String password)
 {
     try
     {
         if (string.IsNullOrWhiteSpace(userName))
         {
             return(Ok(ResponseHelper.CreateResponseDTOForException("UserName cannot be Balank")));
         }
         else if (string.IsNullOrWhiteSpace(password))
         {
             return(Ok(ResponseHelper.CreateResponseDTOForException("Password cannot be Balank")));
         }
         else
         {
             LoggedInUserDTO loggedInUserDTO = _loginService.ValidateLoginAndCreateLoginSession(userName, password);
             if (loggedInUserDTO.LoginStatus)
             {
                 var    secretKey           = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("PlatformSecretKey"));
                 var    signingCredientials = new SigningCredentials(secretKey, SecurityAlgorithms.HmacSha256);
                 string baseAddress         = ConfigurationManager.AppSettings["BaseUri"].ToString();
                 var    tokenOptions        = new JwtSecurityToken(
                     issuer: baseAddress,
                     audience: baseAddress,
                     claims: new List <Claim>(),
                     expires: DateTimeHelper.GetISTDateTime().AddMinutes(6),
                     signingCredentials: signingCredientials);
                 var tokenString = new JwtSecurityTokenHandler().WriteToken(tokenOptions);
                 loggedInUserDTO.TokenString = tokenString;
                 ResponseDTO responseDTO = new ResponseDTO();
                 responseDTO.Data    = loggedInUserDTO;
                 responseDTO.Status  = true;
                 responseDTO.Message = "Login Successful";
                 return(Ok(responseDTO));
             }
             else
             {
                 return(Ok(ResponseHelper.CreateResponseDTOForException("User Name or Password is InCorrect")));
             }
         }
     }
     catch (PlatformModuleException ex)
     {
         //Write Log Here
         return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
     }
 }
Пример #27
0
        public IHttpActionResult Post([FromBody] VLCPaymentDTO vLCPaymentDTO)
        {
            try
            {
                if (vLCPaymentDTO == null)
                {
                    Ok(ResponseHelper.CreateResponseDTOForException("Argument Null"));
                }
                //Create New Distribution Center
                ResponseDTO responseDTO = _vLCPaymentService.AddVLCPaymentDetail(vLCPaymentDTO);

                return(Ok(responseDTO));
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }
Пример #28
0
        //Post api/Customer

        public IHttpActionResult Post([FromBody] VLCMilkCollectionDTO vLCMilkCollectionDTO)
        {
            try
            {
                if (vLCMilkCollectionDTO == null)
                {
                    Ok(ResponseHelper.CreateResponseDTOForException("Argument Null"));
                }
                //Create New Customer
                ResponseDTO responseDTO = _vlcMilkCollectionService.AddVLCMilkCollection(vLCMilkCollectionDTO);

                return(Ok(responseDTO));
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }
Пример #29
0
        //Post api/Customer

        public IHttpActionResult Post([FromBody] CustomerDto customer)
        {
            try
            {
                if (customer == null)
                {
                    return(Ok(ResponseHelper.CreateResponseDTOForException("Argument Null")));
                }
                //Create New Customer
                ResponseDTO responseDTO = _customerService.AddCustomer(customer);

                return(Ok(responseDTO));
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }
Пример #30
0
        //Post api/Customer

        public IHttpActionResult Post([FromBody] UserDTO userDTO)
        {
            try
            {
                if (userDTO == null)
                {
                    Ok(ResponseHelper.CreateResponseDTOForException("Argument Null"));
                }
                //Create New Customer
                _userService.AddUser(userDTO);

                return(Ok());
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(Ok(ResponseHelper.CreateResponseDTOForException(ex.Message)));
            }
        }