public void ApproveRecord(pfm_SchemeRepo pfm_schemerepo)
        {
            try
            {
                var param = new DynamicParameters();


                pfm_schemerepo.Auth_Status = "AUTHORIZED";

                pfm_schemerepo.Scheme_Status = "ACTIVE";


                param.Add(name: "P_SCHEME_ID", value: pfm_schemerepo.Scheme_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_SCHEME_STATUS", value: pfm_schemerepo.Scheme_Status, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_AUTH_STATUS", value: pfm_schemerepo.Auth_Status, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_AUTH_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_AUTH_DATE", value: pfm_schemerepo.Auth_Date, dbType: DbType.Date, direction: ParameterDirection.Input);

                db.GetConnection().Execute(sql: "SETUP_PROCEDURES.APP_PFM_SCHEME", param: param, commandType: CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                db.Dispose();
            }
        }
        public void EditSaveRecord(pfm_SchemeRepo setup_schemerepo)
        {
            try
            {
                var param = new DynamicParameters();


                //setup_schemerepo.Auth_Status = "EDITING";
                setup_schemerepo.Tier = "N/A";
                param.Add(name: "P_SCHEME_ID", value: setup_schemerepo.Scheme_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_SCHEME_NAME", value: setup_schemerepo.Scheme_Name, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_NPRA_NUMBER", value: setup_schemerepo.NPRA_Number, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_TIER_TYPE", value: setup_schemerepo.Tier_Type, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_TIER", value: setup_schemerepo.Tier, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_CUSTODIAN_ID", value: setup_schemerepo.Custodian_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_SALARY_RATE", value: setup_schemerepo.Salary_Rate, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                param.Add(name: "P_FIRST_DEADLINE_DATE", value: setup_schemerepo.First_Deadline_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_NEXT_DEADLINE_DATE", value: setup_schemerepo.First_Deadline_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_SURCHARGE_GRACE_PERIOD", value: setup_schemerepo.Surcharge_Grace_Period, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                param.Add(name: "P_MONTHLY_PENAL_RATE", value: setup_schemerepo.Monthly_Penal_Rate, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                param.Add(name: "P_UPDATE_DATE", value: setup_schemerepo.Update_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_UPDATE_ID", value: setup_schemerepo.Update_Id, dbType: DbType.String, direction: ParameterDirection.Input);

                db.GetConnection().Execute(sql: "SETUP_PROCEDURES.UPD_PFM_SCHEME", param: param, commandType: CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                db.Dispose();
            }
        }
        public void ReassignSaveRecord(pfm_SchemeRepo setup_schemerepo)
        {
            try
            {
                var param = new DynamicParameters();


                //setup_schemerepo.Auth_Status = "EDITING";
                setup_schemerepo.Tier = "N/A";
                param.Add(name: "P_SCHEME_ID", value: setup_schemerepo.Scheme_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_CUSTODIAN_ID", value: setup_schemerepo.Custodian_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_UPDATE_DATE", value: setup_schemerepo.Update_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_UPDATE_ID", value: setup_schemerepo.Update_Id, dbType: DbType.String, direction: ParameterDirection.Input);

                db.GetConnection().Execute(sql: "SETUP_PROCEDURES.REASSIGN_CUST_PFM_SCHEME", param: param, commandType: CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                db.Dispose();
            }
        }
        public bool AddSaveRecord(pfm_SchemeRepo setup_schemerepo)
        {
            try
            {
                bool success = false;
                var  param   = new DynamicParameters();

                if (string.IsNullOrEmpty(setup_schemerepo.Scheme_Id))
                {
                    setup_schemerepo.Scheme_Status = "PENDING";
                    setup_schemerepo.Auth_Status   = "PENDING";
                    setup_schemerepo.Tier          = "N/A";
                    param.Add(name: "P_SCHEME_NAME", value: setup_schemerepo.Scheme_Name, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_NPRA_NUMBER", value: setup_schemerepo.NPRA_Number, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_TIER_TYPE", value: setup_schemerepo.Tier_Type, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_TIER", value: setup_schemerepo.Tier, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_CUSTODIAN_ID", value: setup_schemerepo.Custodian_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_SALARY_RATE", value: setup_schemerepo.Salary_Rate, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param.Add(name: "P_FIRST_DEADLINE_DATE", value: setup_schemerepo.First_Deadline_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                    param.Add(name: "P_NEXT_DEADLINE_DATE", value: setup_schemerepo.First_Deadline_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                    param.Add(name: "P_SURCHARGE_GRACE_PERIOD", value: setup_schemerepo.Surcharge_Grace_Period, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param.Add(name: "P_MONTHLY_PENAL_RATE", value: setup_schemerepo.Monthly_Penal_Rate, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                    param.Add(name: "P_SCHEME_STATUS", value: setup_schemerepo.Scheme_Status, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_START_DATE", value: setup_schemerepo.Start_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                    param.Add(name: "P_TODAY_DATE", value: setup_schemerepo.Start_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                    param.Add(name: "P_PRICING_TYPE", value: setup_schemerepo.Pricing_Type, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_MAKER_ID", value: setup_schemerepo.Maker_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                    param.Add(name: "P_MAKE_DATE", value: setup_schemerepo.Make_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                    param.Add(name: "P_AUTH_STATUS", value: setup_schemerepo.Auth_Status, dbType: DbType.String, direction: ParameterDirection.Input);

                    db.GetConnection().Execute(sql: "SETUP_PROCEDURES.ADD_PFM_SCHEME", param: param, commandType: CommandType.StoredProcedure);
                    success = true;
                }
                return(success);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                db.Dispose();
            }
        }