예제 #1
0
        public void checkrate_edit(crm_BeneNextRepo BeneNextRepo)
        {
            try
            {
                var con   = new AppSettings();
                var param = new DynamicParameters();
                param.Add("P_ID", BeneNextRepo.Cust_No, DbType.String, ParameterDirection.Input);
                param.Add("P_BID", BeneNextRepo.Beneficiary_NextOfKin_Id, DbType.String, ParameterDirection.Input);
                param.Add("VDATA", null, DbType.Decimal, ParameterDirection.Output);
                con.GetConnection().Execute("CHECK_RATE2", param, commandType: CommandType.StoredProcedure);
                BeneNextRepo.Total_Rate = param.Get <decimal>("VDATA");
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        public void SaveRecord(crm_BeneNextRepo BeneNextRepo)
        {
            try
            {
                //Get Connection
                AppSettings app = new AppSettings();
                con = app.GetConnection();
                DynamicParameters param = new DynamicParameters();
                param.Add(name: "P_BENEFICIARY_NEXTOFKIN_ID", value: BeneNextRepo.Beneficiary_NextOfKin_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_BENEFICIARY_NEXTOFKIN", value: BeneNextRepo.Beneficiary_NextOfKin, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_SURNAME", value: BeneNextRepo.Surname, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_FIRST_NAME", value: BeneNextRepo.First_Name, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_OTHER_NAME", value: BeneNextRepo.Other_Name, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_MAIDEN_NAME", value: BeneNextRepo.Maiden_Name, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_PHONE_NUMBER1", value: BeneNextRepo.Phone_Number1, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_PHONE_NUMBER2", value: BeneNextRepo.Phone_Number2, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_RESIDENTIAL_ADDRESS", value: BeneNextRepo.Residential_Address, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_EMAIL_ADDRESS", value: BeneNextRepo.Email_Address, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_RELATIONSHIP_NAME", value: BeneNextRepo.Relationship_Name, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_DATE_OF_BIRTH", value: BeneNextRepo.Date_Of_Birth, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_BENEFICIARY_RATE", value: BeneNextRepo.Beneficiary_Rate, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                param.Add(name: "P_CUST_NO", value: BeneNextRepo.Cust_No, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_UPDATE_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKER_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);

                con.Execute("MIX_CRM_BENE_NEXT", param, commandType: CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                    if (con != null)
                    {
                        con = null;
                    }
                }
            }
        }