Exemplo n.º 1
0
        public string InsertRequesterDetail(RequesterDetailModel requesterModel)
        {
            try
            {
                if (requesterModel == null)
                {
                    return("empty");
                }
                if (!string.IsNullOrEmpty(requesterModel.AccessNo))
                {
                    return(InsertBREQsRequesterDetail(requesterModel));
                }

                var param = new DynamicParameters();
                param.Add("@RequestSeriesNo ", requesterModel.TransactionSeriesNo);
                param.Add("@LongName", INSTITUTION_NAME);
                param.Add("@LastName", requesterModel.LastName);
                param.Add("@FirstName", requesterModel.FirstName);
                param.Add("@MiddleInitial", requesterModel.MiddleInitial);
                param.Add("@AddressLine1", requesterModel.AddressLine1);
                param.Add("@AddressLine2", requesterModel.AddressLine2);
                param.Add("@Email", requesterModel.EmailAddress);
                param.Add("@CountryCode", requesterModel.CountryCode);
                if (Convert.ToInt16(requesterModel.CountryCode) == 608)
                {
                    param.Add("@ProvinceCode", requesterModel.ProvinceCode);
                    param.Add("@MunicipalCode", requesterModel.CityMunicipalityCode);
                }
                else
                {
                    param.Add("@ProvinceCode", null);
                    param.Add("@MunicipalCode", null);
                }

                param.Add("@MobileNo", requesterModel.TelephoneNumber);
                param.Add("@ZipCode", requesterModel.ZipCode);
                param.Add("@TIN", requesterModel.TIN);
                param.Add("@CustomerNo", CUSTOMER_CODE);
                param.Add("@QueueTicketNo", requesterModel.QueueTicketNumber);
                param.Add("@CreatedBy", _windowsUser);
                _dataService.Exec(StoredProcedure.InsertRequester, ConnectionType.CivilRegistrySystem, param);
                return("Success");
            }
            catch (Exception ex)
            {
                return(ex.ToString());
            }
        }
Exemplo n.º 2
0
 public IActionResult InsertRequesterDetail(RequesterDetailModel requesterModel)
 {
     try
     {
         string response = _serbilisManager.InsertRequesterDetail(requesterModel);
         if (string.IsNullOrEmpty(response))
         {
             return(Problem("Problem with execution", null, 500));
         }
         return(Ok(response));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, ex.Message);
         return(Problem(ex.Message, null, 500));
     }
 }
Exemplo n.º 3
0
        public string InsertBREQsRequesterDetail(RequesterDetailModel requesterModel)
        {
            try
            {
                if (requesterModel == null)
                {
                    return("empty");
                }

                var param = new DynamicParameters();
                param.Add("@LastName", requesterModel.LastName);
                param.Add("@FirstName", requesterModel.FirstName);
                param.Add("@MiddleInitial", requesterModel.MiddleInitial);
                param.Add("@AddressLine1", requesterModel.AddressLine1);
                param.Add("@AddressLine2", requesterModel.AddressLine2);
                param.Add("@CountryCode", requesterModel.CountryCode);
                if (Convert.ToInt16(requesterModel.CountryCode) == 608)
                {
                    param.Add("@ProvinceCode", requesterModel.ProvinceCode);
                    param.Add("@MunicipalCode", requesterModel.CityMunicipalityCode);
                }
                else
                {
                    param.Add("@ProvinceCode", null);
                    param.Add("@MunicipalCode", null);
                }

                param.Add("@ContactNo", requesterModel.TelephoneNumber);
                param.Add("@ZipCode", requesterModel.ZipCode);
                param.Add("@AccessNo", requesterModel.AccessNo);
                param.Add("@RequesterID", 0, DbType.Int64, ParameterDirection.Output);
                RequesterID = _dataService.Exec(StoredProcedure.BreqsInsertRequester,
                                                ConnectionType.CivilRegistrySystem, param);
                RequesterID = param.Get <long>("@RequesterID");
                return(RequesterID.ToString());
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }