예제 #1
0
        private void SaveDelay_Click(object sender, EventArgs e)
        {
            string line = "";

            foreach (Control item in SettingDelay.Controls)
            {
                if (item.Name.Contains("Delay"))
                {
                    var i = SettingDelay.Controls.IndexOf(item);
                    foreach (Control item2 in SettingDelay.Controls)
                    {
                        if (item2.TabIndex == i)
                        {
                            line += item2.Text + ",";
                            continue;
                        }
                    }
                }
            }

            using (var fas = new FASEntities())
            {
                var F = (from lot in fas.FAS_GS_LOTs
                         join m in fas.FAS_Models on lot.ModelID equals m.ModelID
                         where lot.LOTID == BaseC.LOTID
                         select m);

                F.FirstOrDefault().DelaySetting = line;
                fas.SaveChanges();
            }

            SaveDelays.Text = "Сохранено";
        }
예제 #2
0
 string GetFullSTBSN(int serial)
 {
     using (var FAS = new FASEntities())
     {
         return(FAS.FAS_Start.Where(c => c.SerialNumber == serial).Select(c => c.FullSTBSN).FirstOrDefault());
     }
 }
예제 #3
0
 long GetSmartCardID(int serial)
 {
     using (var FAS = new FASEntities())
     {
         return(FAS.FAS_Upload.Where(c => c.SerialNumber == serial).Select(c => c.SmartCardID).FirstOrDefault());
     }
 }
예제 #4
0
파일: Form1.cs 프로젝트: Andreissw/GS_STB
        void GetLot(DataGridView Grid)
        {
            using (FASEntities FAS = new FASEntities())
            {
                var list = from Lot in FAS.FAS_GS_LOTs
                           join model in FAS.FAS_Models on Lot.ModelID equals model.ModelID
                           where Lot.IsActive == true
                           orderby Lot.LOTID descending
                           select new
                {
                    Lot      = Lot.LOTCode,
                    Full_Lot = Lot.FULL_LOT_Code,
                    Model    = model.ModelName,
                    InLot    = (from s in FAS.FAS_SerialNumbers where s.LOTID == Lot.LOTID select s.LOTID).Count(),
                    Ready    = (from s in FAS.FAS_SerialNumbers where s.IsUsed == false & s.IsActive == true & s.LOTID == Lot.LOTID select s.LOTID).Count(),
                    User     = (from s in FAS.FAS_SerialNumbers where s.IsUsed == true & s.LOTID == Lot.LOTID select s.LOTID).Count(),
                    //Lot.LOTID,
                    Стартдиапазон = Lot.RangeStart,
                    Конецдиапазон = Lot.RangeEnd,
                    Lot.FixedRG,
                    Lot.StartDate
                };

                Grid.DataSource = list.ToList();
            }
        }
예제 #5
0
 bool GetUser()
 {
     using (FASEntities FAS = new FASEntities())
     {
         UserName = FAS.FAS_Users.Where(c => c.RFID == TB_RFIDIn.Text && c.IsActiv == true).Select(c => c.UserName).FirstOrDefault();
         if (string.IsNullOrEmpty(UserName))
         {
             return(true);
         }
         BaseC.UserID = FAS.FAS_Users.Where(c => c.RFID == TB_RFIDIn.Text && c.IsActiv == true).Select(c => c.UserID).FirstOrDefault();
         //BaseC.ArrayList.Add(Name);
         return(false);
     }
 }
예제 #6
0
파일: Form1.cs 프로젝트: Andreissw/GS_STB
 void GetListApp()
 {
     using (FASEntities Fas = new FASEntities()) //131,37
     { short[] sh = new short[] { 4, 3, 5, 20, 2, 24, 37 };
       ListApp.AddRange(Fas.FAS_Applications.Where(c => sh.Contains(c.App_ID)).Select(c => c.App_Name).AsEnumerable()); }
 }