Ejemplo n.º 1
0
        public override ReportTypeTable MakeReportTable()
        {
            string sql = String.Format("select DESCR," +
                                       "REPORT_TYPE_ID," +
                                       "SHORT_NAME," +
                                       "SQL," +
                                       "ALLOW_DYNAMIC_MODS," +
                                       "DATA_DUMP_ONLY," +
                                       "MUST_ENCRYPT " +
                                       "from SPHRSBILLING.REPORT_TYPE");

            DataTable dt = OracleHelper.ExecuteQuery(base.ConnectionString.Value, sql, null);
            ObservableCollection <ContractRateAlt> rpt = ConvertDataTableToObservableCollection(dt);

            ReportTypeTable rtt = new ReportTypeTable();

            rtt.AvailableFields = GetAvailableFields();
            foreach (ContractRateAlt package in rpt)
            {
                package.Table           = rtt;
                package.AvailableFields = rtt.AvailableFields;
                rtt.Add(package);
            }
            return(rtt);
        }
        /// <summary>
        /// Ctor uses a of Models
        /// </summary>
        /// <param name="notes">List<ContractNote></param>
        public DetailInvoiceFileVM(ReportTypeTable _Table)
        {
            Target = Spheris.Billing.Data.BillingDataFactory.NewInstance().CreateInvoiceDetailRepository();

            table = Target.MakeReportTable();

            SelectedGrid = new ObservableCollection <object>();
            SelectedData = new ObservableCollection <object>();
            status       = "Ok";
#if TOO_SLOW
            table.ParseEntireTable();
#endif
            SaveCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => (HasErrorVM == null),
                ExecuteDelegate    = x => Save()
            };

            NoSaveCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => (HasErrorVM == null),
                ExecuteDelegate    = x => NoSave()
            };

            CancelCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => !IsBusy,
                ExecuteDelegate    = x => Cancel()
            };

            NewTypeCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => (HasErrorVM == null),
                ExecuteDelegate    = x => NewType()
            };

            RemoveTypeCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => !IsBusy,
                ExecuteDelegate    = x => RemoveType()
            };

            SQLCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => !IsBusy,
                ExecuteDelegate    = x => SwapMode()
            };

            ShiftLeftCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => !IsBusy,
                ExecuteDelegate    = x => ShiftLeft()
            };

            ShiftRightCommand = new SimpleCommand
            {
                CanExecuteDelegate = x => !IsBusy,
                ExecuteDelegate    = x => ShiftRight()
            };

            Package = Table[0];
            //Package = Table[ Table.Count - 1 ];
        }