示例#1
0
        public async Task <IActionResult> AddNewILR(AddILRRequest sData)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            _logger.LogDebug($"Request - {JsonConvert.SerializeObject(sData)}");

            var data = await _saService.AddILRDetail(sData);

            _logger.LogInformation($"Response - Add New ILR {data}");
            _logger.LogDebug($"Response - {JsonConvert.SerializeObject(data)}");
            return(Ok(new AddEditResponse
            {
                Status = data.Status,
                Message = data.Message,
            }));
        }
示例#2
0
 public AddUpdateMaster AddILRDetail(AddILRRequest data)
 {
     try
     {
         string stProc = AddILR;
         var    pList  = new List <SqlParameter>
         {
             new SqlParameter("@CHCID", data.chcId),
             new SqlParameter("@ILRCode", data.ilrCode),
             new SqlParameter("@ILRPoint", data.name ?? data.name),
             new SqlParameter("@Comments", data.comments.ToCheckNull()),
             new SqlParameter("@UserId", data.userId),
         };
         var returnData = UtilityDL.FillEntity <AddUpdateMaster>(stProc, pList);
         return(returnData);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
示例#3
0
        public async Task <AddEditResponse> AddILRDetail(AddILRRequest data)
        {
            var response = new AddEditResponse();

            try
            {
                if (string.IsNullOrEmpty(data.ilrCode))
                {
                    response.Status  = "false";
                    response.Message = "Please enter ILR Code";
                }
                else if (string.IsNullOrEmpty(data.name))
                {
                    response.Status  = "false";
                    response.Message = "Please enter ILR Point";
                }
                else if (data.chcId <= 0)
                {
                    response.Status  = "false";
                    response.Message = "Invalid chc";
                }
                else
                {
                    var addEditResponse = _saData.AddILRDetail(data);
                    response.Status  = "true";
                    response.Message = addEditResponse.message;
                }
                return(response);
            }
            catch (Exception e)
            {
                response.Status  = "false";
                response.Message = $"Unable to process - {e.Message}";
                return(response);
            }
        }