Ejemplo n.º 1
0
 public RoomInfo[] GetAllRoom()
 {
     using (SecureDBEntities db = new SecureDBEntities())
     {
         return db.tblEngineRoomConfig.Select(n => new RoomInfo() { ERName = n.ERName, ERID = n.ERID ,LineID=n.LineID}).ToArray();
     }
 }
Ejemplo n.º 2
0
        public AddCardInfo[] GetCardInfoByMCNSID(string MCNSID)
        {
            using (SecureDBEntities db = new SecureDBEntities())
            {
                var q = from n in db.vwMagneticCardDetail
                        where  n.MCNSID==MCNSID
                        group (int)n.ERID by new { n.ABA, n.Memo, n.StartDate, n.EndDate, n.Name } into g
                        select new  { g.Key.ABA, g,   g.Key.Memo,    g.Key.EndDate,  g.Key.StartDate, Name = g.Key.Name };

                System.Collections.Generic.List<AddCardInfo> list = new List<AddCardInfo>();
                foreach (var i in q)
                {
                    list.Add(new AddCardInfo() {  CardNo = i.ABA, EndDate = (DateTime)i.EndDate, StartDate = (DateTime)i.StartDate, MCNSID = i.Memo, Name = i.Name, ERIDs = i.g.Distinct().ToArray<int>() });
                }
                return list.ToArray();
            }
        }
Ejemplo n.º 3
0
        public MagneticCardBasicInfo[] GetAllTempMagneticCardBasicInfo()
        {
            using (SecureDBEntities db = new SecureDBEntities())
            {
                var q = from n in db.tblMagneticCard
                        where n.Enable == "Y" 
                        select new MagneticCardBasicInfo { ABA = n.ABA, Type=n.Type, CardEndDate = n.CardEndDate, CardStartDate = n.CardStartDate, Company = n.Company, EmployeeNo = n.EmployeeNo, EndDate = n.EndDate, IDNumber = n.IDNumber, JobTitle = n.JobTitle, Mobile = n.Mobile, Name = n.Name, StartDate = n.StartDate, Tel = n.Tel };


                return q.ToArray();
                //System.Collections.Generic.List<MagneticCardBasicInfo> list = new List<MagneticCardBasicInfo>();
                //foreach (var i in q)
                //{
                //    list.Add(new AddCardInfo() { CardNo = i.ABA, EndDate = (DateTime)i.EndDate, StartDate = (DateTime)i.StartDate, MCNSID = i.Memo, Name = i.Name, ERIDs = i.g.Distinct().ToArray<int>() });
                //}
                //return list.ToArray();
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
          //  string json = "{\"name\":\"Joe\"}";
            Response.Clear();
            Response.ContentType = "application/json; charset=utf-8";

               slSecure.Web.SecureDBEntities db=new SecureDBEntities();
               var q=  from n in  db.tblCCTVSplitScreen orderby n.NO  join o in db.tblCCTVConfig on n.CCTVID equals o.CCTVID
                       select new CCTVGridInfo
                       {    NO= n.NO, 
                            CCTVID=n.CCTVID??-1,CCTVName= o.CCTVName, IP= o.IP, Port= o.Port, UserName= o.UserName,Password= o.Password,Type= o.Type??-1 };

                DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(CCTVGridInfo[]));
                MemoryStream ms = new MemoryStream();
                CCTVGridInfo[] infos= q.ToArray<CCTVGridInfo>();
                ser.WriteObject(ms,infos);
        string jsonString = Encoding.UTF8.GetString(ms.ToArray());
        ms.Close();

        Response.Write(jsonString);
            Response.End();
        }
Ejemplo n.º 5
0
        public CardSendingResult[] GetR23CardSendingResult(string mcnsid)
        {
            IQueryable<CardSendingResult> q;
            
            using (SecureDBEntities db = new SecureDBEntities())
            {
                 q = from n in db.vwCardCommandLog where n.MCNSID == mcnsid select new CardSendingResult() {
                     ABA=n.ABA,
                      ComandTypeName=n.CommandTypeName,
                       ERName=n.ERName,
                        IsSuccessName=n.IsSuccessName,
                         Memo=n.Memo,
                          MSNCID=n.MCNSID,
                           Name=n.Name,
                            TimeStamp=n.Timestamp

                };
                 if (q == null)
                     return new CardSendingResult[0];
                 return q.ToArray();
                
            }

           
        }