public override void Insert(CarrierAcctRow value)
        {
            string _sqlStr = "DECLARE " + base.Database.CreateSqlParameterName(CarrierAcctRow.carrier_acct_id_PropName) + " smallint " +
                             "SET " + base.Database.CreateSqlParameterName(CarrierAcctRow.carrier_acct_id_PropName) +
                             " = COALESCE((SELECT MAX(" + CarrierAcctRow.carrier_acct_id_DbName + ") FROM CarrierAcct) + 1, 10000) " +

                             "INSERT INTO [dbo].[CarrierAcct] (" +
                             "[" + CarrierAcctRow.carrier_acct_id_DbName + "], " +
                             "[" + CarrierAcctRow.name_DbName + "], " +
                             "[" + CarrierAcctRow.status_DbName + "], " +
                             "[" + CarrierAcctRow.rating_type_DbName + "], " +
                             "[" + CarrierAcctRow.prefix_out_DbName + "], " +
                             "[" + CarrierAcctRow.max_call_length_DbName + "], " +
                             "[" + CarrierAcctRow.strip_1plus_DbName + "], " +
                             "[" + CarrierAcctRow.intl_dial_code_DbName + "], " +
                             "[" + CarrierAcctRow.partner_id_DbName + "], " +
                             "[" + CarrierAcctRow.calling_plan_id_DbName + "] " +
                             ") VALUES (" +
                             //"@Carrier_id, " +
                             Database.CreateSqlParameterName(CarrierAcctRow.carrier_acct_id_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.name_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.status_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.rating_type_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.prefix_out_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.max_call_length_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.strip_1plus_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.intl_dial_code_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.partner_id_PropName) + ", " +
                             Database.CreateSqlParameterName(CarrierAcctRow.calling_plan_id_PropName) + ") " +
                             "SELECT " + Database.CreateSqlParameterName(CarrierAcctRow.carrier_acct_id_PropName);

            IDbCommand _cmd = Database.CreateCommand(_sqlStr);

            //AddParameter(cmd, "Carrier_id", DbType.Int32, value.Carrier_id);
            AddParameter(_cmd, CarrierAcctRow.name_PropName, value.Name);
            AddParameter(_cmd, CarrierAcctRow.status_PropName, value.Status);
            AddParameter(_cmd, CarrierAcctRow.rating_type_PropName, value.Rating_type);
            AddParameter(_cmd, CarrierAcctRow.prefix_out_PropName, value.Prefix_out);
            AddParameter(_cmd, CarrierAcctRow.max_call_length_PropName, value.Max_call_length);
            AddParameter(_cmd, CarrierAcctRow.strip_1plus_PropName, value.Strip_1plus);
            AddParameter(_cmd, CarrierAcctRow.intl_dial_code_PropName, value.Intl_dial_code);
            AddParameter(_cmd, CarrierAcctRow.partner_id_PropName, value.Partner_id);
            AddParameter(_cmd, CarrierAcctRow.calling_plan_id_PropName, value.Calling_plan_id);

            object _res = _cmd.ExecuteScalar();

            value.Carrier_acct_id = (short)_res;
        }
Пример #2
0
 public bool IsDeactivated(CarrierAcctRow pOriginal)
 {
     return(this.AccountStatus != pOriginal.AccountStatus && this.AccountStatus != Rbr.Core.Config.Status.Active);
 }
Пример #3
0
 public bool IsNameChanged(CarrierAcctRow pOriginal)
 {
     return(this.Name != pOriginal.Name);
 }