예제 #1
0
        public async Task <IActionResult> UpdateMotherDetail(MotherUpdateRequest mrData)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            _logger.LogDebug($"Updating mother detail - {JsonConvert.SerializeObject(mrData)}");
            var motherResponse = await _profileService.UpdateMother(mrData);

            return(Ok(new AddMotherResponse
            {
                Status = motherResponse.Status,
                Message = motherResponse.Message,
                MotherSubjectId = motherResponse.MotherSubjectId,
            }));
        }
예제 #2
0
        public string CheckErrorMessage(MotherUpdateRequest mrData)
        {
            var message = "";

            if (mrData.motherFirstName == "")
            {
                message = "Invalid Mother name";
            }
            else if (mrData.stateId <= 0)
            {
                message = "Invalid state";
            }
            return(message);
        }
예제 #3
0
 public MotherReturnDetail UpdateMother(MotherUpdateRequest mrData)
 {
     try
     {
         string stProc = UpdateMotherProfile;
         var    pList  = new List <SqlParameter>
         {
             new SqlParameter("@MotherSubjectId", mrData.motherSubjectId.ToCheckNull()),
             new SqlParameter("@MotherFirstName", mrData.motherFirstName),
             new SqlParameter("@MotherLastName", mrData.motherLastName.ToCheckNull()),
             new SqlParameter("@DOB", mrData.dob.ToCheckNull()),
             new SqlParameter("@Age", mrData.age),
             new SqlParameter("@G", mrData.g),
             new SqlParameter("@P", mrData.p),
             new SqlParameter("@L", mrData.l),
             new SqlParameter("@A", mrData.a),
             new SqlParameter("@RCHID", mrData.rchId),
             new SqlParameter("@MotherGovIdTypeId", mrData.motherGovIdTypeId),
             new SqlParameter("@MotherGovIdDetail", mrData.motherGovIdDetail.ToCheckNull()),
             new SqlParameter("@MotherContactNo", mrData.motherContactNo.ToCheckNull()),
             new SqlParameter("@ECNumber", mrData.ecNumber.ToCheckNull()),
             new SqlParameter("@Address1", mrData.address1.ToCheckNull()),
             new SqlParameter("@Address2", mrData.address2.ToCheckNull()),
             new SqlParameter("@Address3", mrData.address3.ToCheckNull()),
             new SqlParameter("@StateId", mrData.stateId),
             new SqlParameter("@Pincode", mrData.pincode.ToCheckNull()),
             new SqlParameter("@FatherFirstName", mrData.fatherFirstName.ToCheckNull()),
             new SqlParameter("@FatherLastName", mrData.fatherLastName.ToCheckNull()),
             new SqlParameter("@FatherContactNo", mrData.fatherContactNo.ToCheckNull()),
             new SqlParameter("@GuardianFirstName", mrData.guardianFirstName.ToCheckNull()),
             new SqlParameter("@GuardianLastName", mrData.guardianLastName.ToCheckNull()),
             new SqlParameter("@GuardianContactNo", mrData.guardianContactNo.ToCheckNull()),
             new SqlParameter("@UserId", mrData.userId),
         };
         var motherDet = UtilityDL.FillEntity <MotherReturnDetail>(stProc, pList);
         return(motherDet);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #4
0
        public async Task <AddMotherResponse> UpdateMother(MotherUpdateRequest mrData)
        {
            var motherResponse = new AddMotherResponse();

            try
            {
                var msg = CheckErrorMessage(mrData);
                if (msg == "")
                {
                    var motherDetail = _profileData.UpdateMother(mrData);
                    if (motherDetail.success == true)
                    {
                        motherResponse.Status          = "true";
                        motherResponse.Message         = motherDetail.responseMsg;
                        motherResponse.MotherSubjectId = motherDetail.subjectId;
                    }
                    else
                    {
                        motherResponse.Status          = "false";
                        motherResponse.Message         = motherDetail.responseMsg;
                        motherResponse.MotherSubjectId = motherDetail.subjectId;
                    }
                }
                else
                {
                    motherResponse.Status  = "false";
                    motherResponse.Message = msg;
                }
            }
            catch (Exception e)
            {
                motherResponse.Status  = "false";
                motherResponse.Message = e.Message;
            }
            return(motherResponse);
        }