Exemplo n.º 1
0
        public int InsertTicket(TaksAdmon ticket, out int newID)
        {
            int val = 0;

            newID = 0;
            try
            {
                using (ClusmextContext context = new ClusmextContext())
                {
                    if (ticket.IdTaks > 0)
                    {
                        context.Entry(ticket).State = EntityState.Modified;
                    }
                    else
                    {
                        context.Entry(ticket).State = EntityState.Added;
                    }

                    val = context.SaveChanges();
                    if (val != 0)
                    {
                        newID = ticket.IdTaks;
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(val);
        }
Exemplo n.º 2
0
        public TaksAdmon GetDetails(int id)
        {
            TaksAdmon list = new TaksAdmon();

            try
            {
                using (ClusmextContext context = new ClusmextContext())
                {
                    list = context.TaksAdmon.Include("Empresas").Include("Usuarios").Include("CA_Areas").Include("TaksEstatus").Include("TaksTipo").Include("TaksPertenencia").Include("TaksComentarios").Where(x => x.IdTaks == id).SingleOrDefault();
                }
            }
            catch (Exception ex)
            {
            }
            return(list);
        }
Exemplo n.º 3
0
        public int ChangeStatus(TaksAdmon ticket)
        {
            int val = 0;

            try
            {
                using (ClusmextContext context = new ClusmextContext())
                {
                    context.Entry(ticket).State = EntityState.Modified;
                    val = context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }
            return(val);
        }
Exemplo n.º 4
0
        public TaksAdmon GetRawTicket(int id)
        {
            TaksAdmon ticket = new TaksAdmon();

            try
            {
                if (id == 0)
                {
                    ticket.Id_Empresa = -1;
                    ticket.IdTaksTipo = -1;
                    ticket.Id_CA_Area = -1;
                    return(ticket);
                }
                using (ClusmextContext context = new ClusmextContext())
                {
                    ticket = context.TaksAdmon.Where(x => x.IdTaks == id).SingleOrDefault();
                }
            }
            catch (Exception ex)
            {
            }
            return(ticket);
        }