예제 #1
0
        public DataMessage Renew(USSDPolicy model)
        {
            DataHelper helper = new DataHelper(Configuration);

            SqlParameter[] sqlParameters =
            {
                new SqlParameter("@AuditUserID",           UserId),
                new SqlParameter("@InsuranceNumber",       model.InsuranceNumber),
                new SqlParameter("@RenewalDate",           model.Date),
                new SqlParameter("@ProductCode",           model.ProductCode),
                new SqlParameter("@EnrollmentOfficerCode", model.EnrollmentOfficerCode)
            };

            DataMessage message;

            try
            {
                var response = helper.Procedure("uspAPIRenewPolicy", sqlParameters);
                message = new RenewPolicyResponse(response.Code, false, 0).Message;
            }
            catch (Exception e)
            {
                message = new EditFamilyResponse(e).Message;
            }

            return(message);
        }
        public DataMessage Enter(Contribution model)
        {
            DataHelper helper = new DataHelper(Configuration);

            SqlParameter[] sqlParameters =
            {
                new SqlParameter("@AuditUserID",          UserId),
                new SqlParameter("@InsuranceNumber",      model.InsuranceNumber),
                new SqlParameter("@Payer",                model.Payer),
                new SqlParameter("@PaymentDate",          model.PaymentDate),
                new SqlParameter("@ProductCode",          model.ProductCode),
                new SqlParameter("@ReceiptNo",            model.ReceiptNumber),
                new SqlParameter("@ReactionType",         model.ReactionType),
                new SqlParameter("@ContributionCategory", model.ContributionCategory),
                new SqlParameter("@ContributionAmount",   model.Amount),
                new SqlParameter("@PaymentType",          model.PaymentType)
            };

            DataMessage message;

            try
            {
                var response = helper.Procedure("uspAPIEnterContribution", sqlParameters, 1);
                message = new EnterContibutionResponse(response.Code, false, response.Data, 0).Message;
            }
            catch (Exception e)
            {
                message = new EditFamilyResponse(e).Message;
            }

            return(message);
        }
예제 #3
0
        public DataMessage AddNew(FamilyModelv3 model)
        {
            DataMessage message;

            try
            {
                SqlParameter[] sqlParameters =
                {
                    new SqlParameter("@AuditUserID",          UserId),
                    new SqlParameter("@PermanentVillageCode", model.VillageCode),
                    new SqlParameter("@InsuranceNumber",      model.HeadOfFamilyId),
                    new SqlParameter("@OtherNames",           model.OtherName),
                    new SqlParameter("@LastName",             model.LastName),
                    new SqlParameter("@BirthDate",            model.BirthDate),
                    new SqlParameter("@Gender",               model.Gender),
                    new SqlParameter("@PovertyStatus",        model.PovertyStatus),
                    new SqlParameter("@ConfirmationType",     model.ConfirmationType),
                    new SqlParameter("@GroupType",            model.GroupType),
                    new SqlParameter("@ConfirmationNo",       model.ConfrimationNo),
                    new SqlParameter("@PermanentAddress",     model.PermanentAddressDetails),
                    new SqlParameter("@MaritalStatus",        model.MaritalStatus),
                    new SqlParameter("@BeneficiaryCard",      model.BeneficiaryCard),
                    new SqlParameter("@CurrentVillageCode",   model.CurrentVillageCode),
                    new SqlParameter("@CurrentAddress",       model.CurrentAddressDetails),
                    new SqlParameter("@Proffesion",           model.Profession),
                    new SqlParameter("@Education",            model.Education),
                    new SqlParameter("@PhoneNumber",          model.PhoneNumber),
                    new SqlParameter("@Email",                model.Email),
                    new SqlParameter("@IdentificationType",   model.IdentificationType),
                    new SqlParameter("@IdentificationNumber", model.IdentificationNumber),
                    new SqlParameter("@FspCode",              model.FspCode),
                };

                DataHelper helper = new DataHelper(Configuration);

                using (var imisContext = new ImisDB())
                {
                    var response = helper.Procedure("uspAPIEnterFamily", sqlParameters);

                    message = new EnterFamilyResponse(response.Code, false, response.Data, 0).Message;
                }

                return(message);
            }
            catch (Exception e)
            {
                message = new EditFamilyResponse(e).Message;
            }
            return(message);
        }
예제 #4
0
        public DataMessage EditMember(EditFamilyMember model)
        {
            DataHelper helper = new DataHelper(Configuration);

            SqlParameter[] sqlParameters =
            {
                new SqlParameter("@AuditUserID",          UserId),
                new SqlParameter("@InsureeNumber",        model.InsureeNumber),
                new SqlParameter("@OtherNames",           model.OtherName),
                new SqlParameter("@LastName",             model.LastName),
                new SqlParameter("@BirthDate",            model.BirthDate),
                new SqlParameter("@Gender",               model.Gender),
                new SqlParameter("@Relationship",         model.Relationship),
                new SqlParameter("@MaritalStatus",        model.MaritalStatus),
                new SqlParameter("@BeneficiaryCard",      model.Beneficiary_Card),
                new SqlParameter("@VillageCode",          model.CurrentVillageCode),
                new SqlParameter("@CurrentAddress",       model.CurrentAddressDetails),
                new SqlParameter("@Proffesion",           model.Profession),
                new SqlParameter("@Education",            model.Education),
                new SqlParameter("@PhoneNumber",          model.PhoneNumber),
                new SqlParameter("@Email",                model.Email),
                new SqlParameter("@IdentificationType",   model.IdentificationType),
                new SqlParameter("@IdentificationNumber", model.IdentificationNumber),
                new SqlParameter("@FspCode",              model.FspCode)
            };

            DataMessage message;

            try
            {
                var response = helper.Procedure("uspAPIEditMemberFamily", sqlParameters);
                message = new EditMemberFamilyResponse(response.Code, false, response.Data, 0).Message;
            }
            catch (Exception e)
            {
                message = new EditFamilyResponse(e).Message;
            }

            return(message);
        }