Beispiel #1
0
        public void TestMethod1()
        {
            TicketDS ticket = new TicketDS();
            DBRepository r = DBRepository.GetDbRepository(true);
            r.BeginTransaction();
            ticket.Insert_Preveedor_Ticket(r, 7612, 112, 8, "Esta es una prueba desde un test unitario", "Hash");
            
            

        }
Beispiel #2
0
        static void Main(string[] args)
        {

            Console.WriteLine("Inicio Programa.");


            DBRepository respository = DBRepository.GetDbRepository();
            TicketDS ticket = new TicketDS();

            DataTable dt = ticket.ObtenercasosMensuales(2015, 6, "715420/1");

            
            Console.WriteLine("Fin Programa.");
            Console.ReadLine();

        }
Beispiel #3
0
        public static ContadorCasos getContadorCasos(int mes, int anno, string poliza)
        {
            ContadorCasos rContador = new ContadorCasos();

            rContador._cantidad = 0;

            TicketDS ds = new TicketDS();
            DataTable dt = ds.ObtenercasosMensuales(anno, mes, poliza);

            if(dt!=null && dt.Rows.Count>0)
            {
                rContador._cantidad = Int32.Parse(dt.Rows[0][COL_TOTAL].ToString());
                foreach(DataRow r in dt.Rows)
                {
                    CasosMesurables caso = new CasosMesurables();
                    caso.TipoCaso = r[COL_TIPO_TICKET].ToString();
                    caso.Cantidad = Int32.Parse(r[COL_CANTIIDAD].ToString());
                    rContador._casos.Add(caso);
                }
            }

            return rContador;
        }
Beispiel #4
0
        private void LoadPrestadores()
        {
            if(this.ID!=NULL_ID && !this.IsPrestadorLoaded)
            {
                TicketDS ticketDataService = new TicketDS();
                DataSet ds = ticketDataService.List_PrestadoresByTicket(this.ID);

                if(ds.Tables.Count>0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        PrestadorCaso p = new PrestadorCaso();
                        ORM_PrestadorCaso(p, dr);
                        this._prestadorCaso.Add(p);
                    }
                }

                this._isPrestadorLoaded = true;

            }
        }
Beispiel #5
0
        public override bool Persist()
        {
            bool result = false;

            try
            {

                TicketDS dataservice = new TicketDS();

                if (this.Observacion == null)
                    throw new Exception("El objeto ticket debe tener una observación");

                if (this.IsNew)
                {
                    this._id = dataservice.Create(this.ObjectToRow(), this.Observacion.ObjectToRow(), this.GetPrestadoresTable());
                    result = true;
                }
                else
                {
                    result = dataservice.Update(this.ObjectToRow(), this.Observacion.ObjectToRow(), this.GetPrestadoresTable());
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return result;
        }
Beispiel #6
0
        public static List<Ticket> List(FiltroTicket f, out int RecordCount)
        {
            List<Ticket> resultList = new List<Ticket>();

            try
            {
                TicketDS dataservice = new TicketDS();
                DataSet ds = dataservice.List(f, out RecordCount);

                if (ds.Tables.Count > 0)
                {
                    foreach (DataRow r in ds.Tables[0].Rows)
                    {
                        Ticket t = new Ticket();
                        ORM(t, r);
                        resultList.Add(t);
                    }
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return resultList;
        }
Beispiel #7
0
        public static Ticket GetById(int id)
        {
            Ticket ticketResult = null;

            try
            {
                TicketDS ticketDS = new TicketDS();
                String objectHash = Guid.NewGuid().ToString();
                DataRow dr = ticketDS.GetObjectById(id, objectHash);

                if (dr != null)
                {
                    ticketResult = new Ticket();
                    ticketResult._UObjectID = objectHash;
                    ORM(ticketResult, dr);

                    ticketResult.ObservacionesHistoricas = Observacion.ListByTicket(ticketResult.ID);
                    ticketResult.LoadPrestadores();

                }

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return ticketResult;
        }