void AddExecute(object param)
        {
            ContractRate newRate = new ContractRate();

            newRate.CONTRACT_ID = CurrentContract.CONTRACT_ID;
            ContractRates.Add(newRate);
            newRate.Modified     = true;
            SelectedContractRate = newRate;
        }
Example #2
0
        public override void Remove(ContractRate package)
        {
            string sql;

            try
            {
                //string sql = String.Format("DELETE FROM {0}.CONTRACT_RATE WHERE CONTRACT_RATE_ID = :CONTRACT_RATE_ID", SchemaName);
                sql = String.Format("DELETE FROM {0}.CONTRACT_RATE_ALT WHERE CONTRACT_RATE_ID = :CONTRACT_RATE_ID", SchemaName);
                List <OracleParameter> parameters = new List <OracleParameter>();
                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_RATE_ID", package.CONTRACT_RATE_ID, OracleType.Int32, ParameterDirection.Input));
                OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());

                sql        = String.Format("DELETE FROM {0}.CONTRACT_RATE WHERE CONTRACT_RATE_ID = :CONTRACT_RATE_ID", SchemaName);
                parameters = new List <OracleParameter>();
                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_RATE_ID", package.CONTRACT_RATE_ID, OracleType.Int32, ParameterDirection.Input));
                outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
            }
            catch (OracleException ex)
            {
                throw ex;
                //throw ex;
            }
        }
Example #3
0
 protected override void RowConverter(ContractRate item, DataRow row)
 0
 {
Example #4
0
        public override void Update(ContractRate r)
        {
            //r.BEGIN_ON =                   :BEGIN_ON =
            //r.CHAR_COMP_METHOD =           :CHAR_COMP_METHOD =
            //r.CONTRACT_ID =                :CONTRACT_ID =
            //r.CONTRACT_RATE_ID =           :CONTRACT_RATE_ID =
            //r.DICTATOR_SR_THRESHOLD =      :DICTATOR_SR_THRESHOLD =
            //r.DOCUMENT_SR_THRESHOLD =      :DOCUMENT_SR_THRESHOLD =
            //r.END_AFTER =                  :END_AFTER =
            //r.FAX_COMP_METHOD =            :FAX_COMP_METHOD =
            //r.FAX_RATE =                   :FAX_RATE =
            //r.FRONTEND_SR_RATE =           :FRONTEND_SR_RATE =
            //r.HOLIDAY_RATE_DELTA =         :HOLIDAY_RATE_DELTA =
            //r.INCLUDE_INHOUSE_IN_TAT_CALC =:INCLUDE_INHOUSE_IN_TAT_CALC =
            //r.INHOUSE_SR_RATE =            :INHOUSE_SR_RATE =
            //r.INHOUSE_TR_RATE =            :INHOUSE_TR_RATE =
            //r.OFFSHORE_RATE =              :OFFSHORE_RATE =
            //r.SR_OFFSHORE_RATE =           :SR_OFFSHORE_RATE =
            //r.SR_RATE =                    :SR_RATE =
            //r.STAT_COMP_METHOD =           :STAT_COMP_METHOD =
            //r.STAT_PREMIUM =               :STAT_PREMIUM =
            //r.STAT_THRESHOLD =             :STAT_THRESHOLD =
            //r.STD_RATE =                   :STD_RATE =
            //r.SYLCOUNT =                   :SYLCOUNT =
            //r.TECHNOLOGY_CHG =             :TECHNOLOGY_CHG
            //                               :

            if (r.CONTRACT_RATE_ID == 0)
            {
                throw new ArgumentNullException("Item.InvoiceGrpId", "An item InvoiceGrpId was provided for the update.");
            }
            try
            {
                string sql = String.Format("update {0}.CONTRACT_RATE set "
                                           + " BEGIN_ON = :BEGIN_ON "
                                           + " ,CHAR_COMP_METHOD = :CHAR_COMP_METHOD "
                                           + " ,CONTRACT_ID = :CONTRACT_ID "
                                           + " ,DICTATOR_SR_THRESHOLD = :DICTATOR_SR_THRESHOLD "
                                           + " ,DOCUMENT_SR_THRESHOLD = :DOCUMENT_SR_THRESHOLD "
                                           + " ,END_AFTER = :END_AFTER "
                                           + " ,FAX_COMP_METHOD = :FAX_COMP_METHOD "
                                           + " ,FAX_RATE = :FAX_RATE "
                                           + " ,FRONTEND_SR_RATE = :FRONTEND_SR_RATE "
                                           + " ,HOLIDAY_RATE_DELTA = :HOLIDAY_RATE_DELTA "
                                           + " ,INCLUDE_INHOUSE_IN_TAT_CALC = :INCLUDE_INHOUSE_IN_TAT_CALC"
                                           + " ,INHOUSE_SR_RATE = :INHOUSE_SR_RATE "
                                           + " ,INHOUSE_TR_RATE = :INHOUSE_TR_RATE "
                                           + " ,OFFSHORE_RATE = :OFFSHORE_RATE "
                                           + " ,SR_OFFSHORE_RATE = :SR_OFFSHORE_RATE "
                                           + " ,SR_RATE = :SR_RATE "
                                           + " ,STAT_COMP_METHOD = :STAT_COMP_METHOD "
                                           + " ,STAT_PREMIUM = :STAT_PREMIUM "
                                           + " ,STAT_THRESHOLD = :STAT_THRESHOLD "
                                           + " ,STD_RATE = :STD_RATE "
                                           + " ,SYLCOUNT = :SYLCOUNT "
                                           + " ,TECHNOLOGY_CHG = :TECHNOLOGY_CHG "
                                           + " ,EER_SR_THRESHOLD = :EER_SR_THRESHOLD "
                                           + " where CONTRACT_RATE_ID = :CONTRACT_RATE_ID", SchemaName);
                List <OracleParameter> parameters = new List <OracleParameter>();
                parameters.Add(OracleHelper.CreateParameter(":BEGIN_ON", CheckNull(r.BEGIN_ON), OracleType.DateTime, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":CHAR_COMP_METHOD", CheckNull(r.CHAR_COMP_METHOD), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_ID", CheckNull(r.CONTRACT_ID), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":DICTATOR_SR_THRESHOLD", CheckNull(r.DICTATOR_SR_THRESHOLD), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":DOCUMENT_SR_THRESHOLD", CheckNull(r.DOCUMENT_SR_THRESHOLD), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":END_AFTER", CheckNull(r.END_AFTER), OracleType.DateTime, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":FAX_COMP_METHOD", CheckNull(r.FAX_COMP_METHOD), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":FAX_RATE", CheckNull(r.FAX_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":FRONTEND_SR_RATE", CheckNull(r.FRONTEND_SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":HOLIDAY_RATE_DELTA", CheckNull(r.HOLIDAY_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INCLUDE_INHOUSE_IN_TAT_CALC", (r.INCLUDE_INHOUSE_IN_TAT_CALC) ? 'Y' : 'N', OracleType.Char, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_SR_RATE", CheckNull(r.INHOUSE_SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_TR_RATE", CheckNull(r.INHOUSE_TR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":OFFSHORE_RATE", CheckNull(r.OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_OFFSHORE_RATE", CheckNull(r.SR_OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_RATE", CheckNull(r.SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STAT_COMP_METHOD", CheckNull(r.STAT_COMP_METHOD), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STAT_PREMIUM", CheckNull(r.STAT_PREMIUM), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STAT_THRESHOLD", CheckNull(r.STAT_THRESHOLD), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STD_RATE", CheckNull(r.STD_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SYLCOUNT", CheckNull(r.SYLCOUNT), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":TECHNOLOGY_CHG", CheckNull(r.TECHNOLOGY_CHG), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":EER_SR_THRESHOLD", CheckNull(r.EER_SR_THRESHOLD), OracleType.Number, ParameterDirection.Input));

                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_RATE_ID", CheckNull(r.CONTRACT_RATE_ID), OracleType.Number, ParameterDirection.Input));

                OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            catch (Exception x)
            {
                throw x;
            }
        }
Example #5
0
        public override void Add(ContractRate r)
        {
            string sql = String.Format("insert into {0}.CONTRACT_RATE "
                                       + "("
                                       + "  BEGIN_ON"
                                       + ", CHAR_COMP_METHOD"
                                       + ", CONTRACT_ID"
                                       + ", CONTRACT_RATE_ID "
                                       + ", DICTATOR_SR_THRESHOLD "
                                       + ", DOCUMENT_SR_THRESHOLD "
                                       + ", END_AFTER "
                                       + ", FAX_COMP_METHOD "
                                       + ", FAX_RATE "
                                       + ", FRONTEND_SR_RATE "
                                       + ", HOLIDAY_RATE_DELTA "
                                       + ", INCLUDE_INHOUSE_IN_TAT_CALC "
                                       + ", INHOUSE_SR_RATE "
                                       + ", INHOUSE_TR_RATE "
                                       + ", OFFSHORE_RATE "
                                       + ", SR_OFFSHORE_RATE "
                                       + ", SR_RATE "
                                       + ", STAT_COMP_METHOD "
                                       + ", STAT_PREMIUM "
                                       + ", STAT_THRESHOLD "
                                       + ", STD_RATE "
                                       + ", SYLCOUNT "
                                       + ", TECHNOLOGY_CHG "
                                       + ", EER_SR_THRESHOLD "
                                       + " ) "
                                       + "values "
                                       + " ( "
                                       + "  :BEGIN_ON"
                                       + ", :CHAR_COMP_METHOD"
                                       + ", :CONTRACT_ID"
                                       + ", {0}.CONTRACT_RATE_ID.nextval "
                                       + ", :DICTATOR_SR_THRESHOLD "
                                       + ", :DOCUMENT_SR_THRESHOLD "
                                       + ", :END_AFTER "
                                       + ", :FAX_COMP_METHOD "
                                       + ", :FAX_RATE "
                                       + ", :FRONTEND_SR_RATE "
                                       + ", :HOLIDAY_RATE_DELTA "
                                       + ", :INCLUDE_INHOUSE_IN_TAT_CALC "
                                       + ", :INHOUSE_SR_RATE "
                                       + ", :INHOUSE_TR_RATE "
                                       + ", :OFFSHORE_RATE "
                                       + ", :SR_OFFSHORE_RATE "
                                       + ", :SR_RATE "
                                       + ", :STAT_COMP_METHOD "
                                       + ", :STAT_PREMIUM "
                                       + ", :STAT_THRESHOLD "
                                       + ", :STD_RATE "
                                       + ", :SYLCOUNT "
                                       + ", :TECHNOLOGY_CHG "
                                       + ", :EER_SR_THRESHOLD "
                                       + " ) "
                                       + " returning CONTRACT_RATE_ID into :RATEID "
                                       , SchemaName);

            try
            {
                List <OracleParameter> parameters = new List <OracleParameter>();

                parameters.Add(OracleHelper.CreateParameter(":BEGIN_ON", CheckNull(r.BEGIN_ON), OracleType.DateTime, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":CHAR_COMP_METHOD", CheckNull(r.CHAR_COMP_METHOD), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_ID", CheckNull(r.CONTRACT_ID), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":DICTATOR_SR_THRESHOLD", CheckNull(r.DICTATOR_SR_THRESHOLD), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":DOCUMENT_SR_THRESHOLD", CheckNull(r.DOCUMENT_SR_THRESHOLD), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":END_AFTER", CheckNull(r.END_AFTER), OracleType.DateTime, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":FAX_COMP_METHOD", CheckNull(r.FAX_COMP_METHOD), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":FAX_RATE", CheckNull(r.FAX_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":FRONTEND_SR_RATE", CheckNull(r.FRONTEND_SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":HOLIDAY_RATE_DELTA", CheckNull(r.HOLIDAY_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INCLUDE_INHOUSE_IN_TAT_CALC", (r.INCLUDE_INHOUSE_IN_TAT_CALC) ? 'Y' : 'N', OracleType.Char, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_SR_RATE", CheckNull(r.INHOUSE_SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_TR_RATE", CheckNull(r.INHOUSE_TR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":OFFSHORE_RATE", CheckNull(r.OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_OFFSHORE_RATE", CheckNull(r.SR_OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_RATE", CheckNull(r.SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STAT_COMP_METHOD", CheckNull(r.STAT_COMP_METHOD), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STAT_PREMIUM", CheckNull(r.STAT_PREMIUM), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STAT_THRESHOLD", CheckNull(r.STAT_THRESHOLD), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STD_RATE", CheckNull(r.STD_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SYLCOUNT", CheckNull(r.SYLCOUNT), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":TECHNOLOGY_CHG", CheckNull(r.TECHNOLOGY_CHG), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":EER_SR_THRESHOLD", CheckNull(r.EER_SR_THRESHOLD), OracleType.Number, ParameterDirection.Input));

                parameters.Add(OracleHelper.CreateParameter(":RATEID", OracleType.Int32, ParameterDirection.InputOutput));

                OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
                r.CONTRACT_RATE_ID = int.Parse(parameters[parameters.Count - 1].Value.ToString());
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            catch (Exception x)
            {
                throw x;
            }
        }