public ClientDefWorkTypeViewModel(IClientDefWorkTypeView view)
            : base(view)
        {
            _view = view;

            NoneAltRate       = new ContractRateAlt();
            NoneAltRate.DESCR = "<none>";

            //ExtSysTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateExtSysRepository();

            ContractRateTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateContractRateRepository();

            ContractRateAltTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateContractRateAltRepository();

            ExtWorkTypeTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateExtWorkTypeRepository();

            ExtClientTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateExtClientRepository();

            ExtWorkTypeSourceTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateExtWorkTypeSourceRepository();

            InvoiceGroupTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateInvoiceGroupRepository();
            //OverRideKeySourceTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateOverRideKeySourceRepository();

            //ClientTarget = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateExtClientRepository();
        }
Exemple #2
0
 public override void Remove(ContractRateAlt package)
 {
     try
     {
         string sql = String.Format("DELETE FROM {0}.CONTRACT_RATE_ALT WHERE CONTRACT_RATE_ID = :CONTRACT_RATE_ID and RATE_NBR = :RATE_NBR", SchemaName);
         List <OracleParameter> parameters = new List <OracleParameter>();
         parameters.Add(OracleHelper.CreateParameter(":CONTRACT_RATE_ID", package.CONTRACT_RATE_ID, OracleType.Int32, ParameterDirection.Input));
         parameters.Add(OracleHelper.CreateParameter(":RATE_NBR", package.RATE_NBR, OracleType.Int32, ParameterDirection.Input));
         OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
     }
     catch (OracleException ex)
     {
         throw ex;
         //throw ex;
     }
 }
Exemple #3
0
        public override void Update(ContractRateAlt package)
        {
            try
            {
                string sql = String.Format("update {0}.CONTRACT_RATE_ALT set "
                                           + "  DESCR = :DESCR "
                                           + "  ,INHOUSE_SR_RATE = :INHOUSE_SR_RATE "
                                           + "  ,INHOUSE_SR_RATE_DELTA = :INHOUSE_SR_RATE_DELTA "
                                           + "  ,INHOUSE_TR_RATE = :INHOUSE_TR_RATE "
                                           + "  ,INHOUSE_TR_RATE_DELTA = :INHOUSE_TR_RATE_DELTA "
                                           + "  ,OFFSHORE_RATE = :OFFSHORE_RATE "
                                           + "  ,OFFSHORE_RATE_DELTA = :OFFSHORE_RATE_DELTA "
                                           + "  ,RATE_NBR = :RATE_NBR "
                                           + "  ,SR_OFFSHORE_RATE = :SR_OFFSHORE_RATE "
                                           + "  ,SR_OFFSHORE_RATE_DELTA = :SR_OFFSHORE_RATE_DELTA "
                                           + "  ,SR_RATE = :SR_RATE "
                                           + "  ,SR_RATE_DELTA = :SR_RATE_DELTA "
                                           + "  ,STD_RATE = :STD_RATE "
                                           + "  ,STD_RATE_DELTA = :STD_RATE_DELTA "
                                           + "where CONTRACT_RATE_ID = :CONTRACT_RATE_ID AND RATE_NBR = :RATE_NBR"
                                           , SchemaName);
                List <OracleParameter> parameters = new List <OracleParameter>();
                parameters.Add(OracleHelper.CreateParameter(":DESCR", package.DESCR, OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_SR_RATE", CheckNull(package.INHOUSE_SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_SR_RATE_DELTA", CheckNull(package.INHOUSE_SR_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_TR_RATE", CheckNull(package.INHOUSE_TR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_TR_RATE_DELTA", CheckNull(package.INHOUSE_TR_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":OFFSHORE_RATE", CheckNull(package.OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":OFFSHORE_RATE_DELTA", CheckNull(package.OFFSHORE_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":RATE_NBR", CheckNull(package.RATE_NBR), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_OFFSHORE_RATE", CheckNull(package.SR_OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_OFFSHORE_RATE_DELTA", CheckNull(package.SR_OFFSHORE_RATE_DELTA), OracleType.Number, ParameterDirection.InputOutput));
                parameters.Add(OracleHelper.CreateParameter(":SR_RATE", CheckNull(package.SR_RATE), OracleType.Number, ParameterDirection.InputOutput));
                parameters.Add(OracleHelper.CreateParameter(":SR_RATE_DELTA", CheckNull(package.SR_RATE_DELTA), OracleType.Number, ParameterDirection.InputOutput));
                parameters.Add(OracleHelper.CreateParameter(":STD_RATE", CheckNull(package.STD_RATE), OracleType.Number, ParameterDirection.InputOutput));
                parameters.Add(OracleHelper.CreateParameter(":STD_RATE_DELTA", CheckNull(package.STD_RATE_DELTA), OracleType.Number, ParameterDirection.InputOutput));
                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_RATE_ID", CheckNull(package.CONTRACT_RATE_ID), OracleType.Number, ParameterDirection.InputOutput));

                OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
            }
            catch (OracleException ex)
            {
                throw ex;
                //throw ex;
            }
        }
        void AddAltExecute(object param)
        {
            ContractRateAlt newAltRate;

            if (SelectedAltContractRate != null)
            {
                newAltRate = SelectedAltContractRate.Clone();
            }
            else
            {
                newAltRate = new ContractRateAlt();
            }
            newAltRate.CONTRACT_RATE_ID = SelectedContractRate.CONTRACT_RATE_ID;
            AltContractRates.Add(newAltRate);
            SelectedAltContractRate          = newAltRate;
            SelectedAltContractRate.Modified = true;
            SelectedAltContractRate.RATE_NBR = 0;
        }
 void ResetAltRateOverrideSelection()
 {
     if (SelectedExtWorkType != null)
     {
         AltContractRates = this.ContractRateAltTarget.GetAltRatesFromClients(selectedExtWorkType.EXT_SYS, selectedExtWorkType.EXT_CLIENT_KEY);
         AltContractRates.Insert(0, NoneAltRate);
         if (selectedExtWorkType.RATE_NBR == null)
         {
             SelectedAltContractRate = NoneAltRate;
         }
         else
         {
             SelectedAltContractRate = (AltContractRates.FirstOrDefault(acr => acr.RATE_NBR == selectedExtWorkType.RATE_NBR) as ContractRateAlt);
         }
     }
     else
     {
         AltContractRates = new ObservableCollection <ContractRateAlt>();
         AltContractRates.Insert(0, NoneAltRate);
         SelectedAltContractRate = NoneAltRate;
     }
 }
Exemple #6
0
 protected override void RowConverter(ContractRateAlt item, DataRow row)
 0
 {
Exemple #7
0
        public override void Add(ContractRateAlt r)
        {
            string sql = String.Format("insert into {0}.CONTRACT_RATE_ALT"
                                       + "("
                                       + "  CONTRACT_RATE_ID"
                                       + ", DESCR"
                                       + ", INHOUSE_SR_RATE"
                                       + ", INHOUSE_SR_RATE_DELTA "
                                       + ", INHOUSE_TR_RATE "
                                       + ", INHOUSE_TR_RATE_DELTA "
                                       + ", OFFSHORE_RATE "
                                       + ", OFFSHORE_RATE_DELTA "
                                       + ", RATE_NBR "
                                       + ", SR_OFFSHORE_RATE "
                                       + ", SR_OFFSHORE_RATE_DELTA "
                                       + ", SR_RATE "
                                       + ", SR_RATE_DELTA "
                                       + ", STD_RATE "
                                       + ", STD_RATE_DELTA "
                                       + " ) "
                                       + "values "
                                       + " ( "
                                       + "  :CONTRACT_RATE_ID"
                                       + ", :DESCR"
                                       + ", :INHOUSE_SR_RATE"
                                       + ", :INHOUSE_SR_RATE_DELTA "
                                       + ", :INHOUSE_TR_RATE "
                                       + ", :INHOUSE_TR_RATE_DELTA "
                                       + ", :OFFSHORE_RATE "
                                       + ", :OFFSHORE_RATE_DELTA "
                                       + ", :RATE_NBR "
                                       + ", :SR_OFFSHORE_RATE "
                                       + ", :SR_OFFSHORE_RATE_DELTA "
                                       + ", :SR_RATE "
                                       + ", :SR_RATE_DELTA "
                                       + ", :STD_RATE "
                                       + ", :STD_RATE_DELTA "
                                       + " ) "
                                       // + " returning RATE_NBR into :RATE_NBR "
                                       , SchemaName);

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

                parameters.Add(OracleHelper.CreateParameter(":CONTRACT_RATE_ID", CheckNull(r.CONTRACT_RATE_ID), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":DESCR", CheckNull(r.DESCR), OracleType.VarChar, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_SR_RATE", CheckNull(r.INHOUSE_SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_SR_RATE_DELTA", CheckNull(r.INHOUSE_SR_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_TR_RATE", CheckNull(r.INHOUSE_TR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":INHOUSE_TR_RATE_DELTA", CheckNull(r.INHOUSE_TR_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":OFFSHORE_RATE", CheckNull(r.OFFSHORE_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":OFFSHORE_RATE_DELTA", CheckNull(r.OFFSHORE_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":RATE_NBR", CheckNull(r.RATE_NBR), 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_OFFSHORE_RATE_DELTA", r.SR_OFFSHORE_RATE_DELTA, OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_RATE", CheckNull(r.SR_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":SR_RATE_DELTA", CheckNull(r.SR_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STD_RATE", CheckNull(r.STD_RATE), OracleType.Number, ParameterDirection.Input));
                parameters.Add(OracleHelper.CreateParameter(":STD_RATE_DELTA", CheckNull(r.STD_RATE_DELTA), OracleType.Number, ParameterDirection.Input));
                // parameters.Add(OracleHelper.CreateParameter(":RATE_NBR", OracleType.Int32, ParameterDirection.InputOutput));
                OracleParameterCollection outParams = OracleHelper.ExecuteNonQuery(base.ConnectionString.Value, sql, parameters.ToArray <OracleParameter>());
            }
            catch (OracleException ex)
            {
                throw ex;
            }
            catch (Exception x)
            {
                throw x;
            }
        }