Ejemplo n.º 1
0
        public Models.AlertManager[] GetAlertEmails(string code)
        {
            try
            {
                using (var context = new AprManager())
                {
                    var codeparam = new SqlParameter("@code", code);

                    var result = context.Database
                                 .SqlQuery <Models.AlertManager>("GetAlertEmails @code", codeparam)
                                 .ToArray();

                    if (result != null)
                    {
                        return(result);
                    }
                }
            } catch (Exception ex)
            {
                ErrorFlag    = true;
                ErrorMessage = ex.Message;
            }

            return(new Models.AlertManager[] { });
        }
Ejemplo n.º 2
0
        public menu.Models.WorkroomsUserObject[] GetActiveWorkrooms(string CID)
        {
            try
            {
                MangContext = getNewMangContext();

                var locid = (from x in MangContext.LocationMasters where x.CID == CID.Trim() select x.id).FirstOrDefault();
                if (locid > 0)
                {
                    context.Configuration.ProxyCreationEnabled = false;
                    var warr1 = (from x in context.WorkroomActivators
                                 join wr in context.WorkRooms on x.WorkroomId equals wr.Id
                                 where x.LocationMasterId == locid && x.Status == true
                                 select new menu.Models.WorkroomsUserObject {
                        Id = wr.Id, Name = wr.Name, Abbreviation = wr.Abbreviation, Status = x.Status
                    }).ToArray();
                    return(warr1);
                }
            }
            catch (Exception ex)
            {
                ErrorMessage = ex.Message;
                Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            }
            return(new menu.Models.WorkroomsUserObject[] { });
        }
Ejemplo n.º 3
0
 public Models.EF.LocationMaster[] getLocations()
 {
     try
     {
         AprManager context = new AprManager();
         context.Configuration.ProxyCreationEnabled = false;
         locations_data = (from x in context.LocationMasters where x.InspectionResults == true select x).ToArray();
         cacheInspectionLocs();
     } catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         ErrorMessage = ex.Message;
     }
     return(locations_data);
 }
Ejemplo n.º 4
0
        public string GetSerLocs()
        {
            var s = "000000:ALL;";

            using (var context = new AprManager())
            {
                var lrecs = (from x in context.LocationMasters
                             select x).ToArray();

                for (int i = 0; i < lrecs.Length; i++)
                {
                    if (i == lrecs.Length - 1)
                    {
                        s = s + lrecs[i].CID.Trim() + ":" + lrecs[i].Name;
                    }
                    else
                    {
                        s = s + lrecs[i].CID.Trim() + ":" + lrecs[i].Name + ";";
                    }
                }
            }

            return(s);
        }
Ejemplo n.º 5
0
 public AdminService(AprManager _MangContext = null)
 {
     MangContext = (_MangContext == null) ? new AprManager() : _MangContext;
 }