Esempio n. 1
0
        public static bool ModifySmallPopulationEntry(EnlistmentDC dc)
        {
            var cfg = from c in dc.Configurations
                      where c.PhoneSKU.Name == "CEPC"
                      select c;

            foreach (var x in cfg)
            {
                x.PhoneSKU.Name = "CEPC1";
            }
            dc.SubmitChanges();

            var mod = from c in dc.Configurations
                      where c.PhoneSKU.Name == "CEPC1"
                      select c;

            if (mod != null && mod.Count() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public static Configuration AddConfigurationTypeEntry(
            EnlistmentDC dc,
            bool submit,
            short id,
            short userId,
            short emailId,
            short phoneSkuId,
            short commandId,
            short buildXmlId,
            short enlistmentId,
            short dailyBuild)
        {
            Configuration o = new Configuration {
                ID         = id, UserID = userId,
                EmailID    = emailId, PhoneSkuID = phoneSkuId, CommandID = commandId,
                BuildXmlID = buildXmlId, EnlistmentID = enlistmentId, DailyBuild = dailyBuild
            };

            dc.Configurations.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 3
0
        public static Configuration AddConfigurationTypeEntry(
            EnlistmentDC dc,
            bool submit,
            short id,
            User u,
            Email e,
            PhoneSKU p,
            Command c,
            BuildXml b,
            Enlistment1 en,
            BuildType bt)
        {
            Configuration o = new Configuration
            {
                ID          = id,
                User        = u,
                Email       = e,
                PhoneSKU    = p,
                Command     = c,
                BuildXml    = b,
                Enlistment1 = en,
                BuildType   = bt
            };

            dc.Configurations.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 4
0
        private void deleteTestRowButton_Click(object sender, RoutedEventArgs e)
        {
            EnlistmentDC dc    = this.viewModel.dc;
            var          query = from s in dc.Configurations
                                 where s.PhoneSkuID == 3
                                 select s;

            dc.Configurations.DeleteAllOnSubmit(query);
            dc.SubmitChanges();
            queryButton_Click(sender, e);
        }
Esempio n. 5
0
        public static User AddUserTypeEntry(EnlistmentDC dc, bool submit, short id, string firstName, string lastName)
        {
            User o = new User {
                UserID = id, FirstName = firstName, LastName = lastName
            };

            dc.Users.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 6
0
        public static PhoneSKU AddPhoneSkuTypeEntry(EnlistmentDC dc, bool submit, short id, string name)
        {
            PhoneSKU o = new PhoneSKU {
                ID = id, Name = name
            };

            dc.PhoneSKUs.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 7
0
        public static Enlistment1 AddEnlistmentTypeEntry(EnlistmentDC dc, bool submit, short id, string path)
        {
            Enlistment1 o = new Enlistment1 {
                Id = id, Path = path
            };

            dc.Enlistments.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 8
0
        public static Email AddEmailTypeEntry(EnlistmentDC dc, bool submit, short emailID, User u, bool primaryAccount, string emailAccount)
        {
            Email o = new Email {
                EmailID = emailID, EmailAccount = emailAccount, Primary = primaryAccount, User = u
            };

            dc.Emails.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 9
0
        public static Command AddCommandTypeEntry(EnlistmentDC dc, bool submit, short id, string command, string commandLine)
        {
            Command o = new Command {
                CommandID = id, Command1 = command, CommandLine = commandLine
            };

            dc.Commands.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 10
0
        public static BuildXml AddBuildXmlTypeEntry(EnlistmentDC dc, bool submit, short id, string filePath)
        {
            BuildXml o = new BuildXml {
                FileID = id, FilePath = filePath
            };

            dc.BuildXmls.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 11
0
        public static BuildType AddBuildTypeEntry(EnlistmentDC dc, bool submit, short id, string name)
        {
            BuildType o = new BuildType {
                ID = id, Name = name
            };

            dc.BuildTypes.InsertOnSubmit(o);
            if (submit)
            {
                dc.SubmitChanges();
            }
            return(o);
        }
Esempio n. 12
0
        private void modifyTestRowButton_Click(object sender, RoutedEventArgs e)
        {
            EnlistmentDC dc    = this.viewModel.dc;
            var          query = (from s in dc.Configurations
                                  where s.PhoneSkuID == 3
                                  select s);
            var command = (from s in dc.Commands
                           where s.CommandID == 4
                           select s).First();

            foreach (Configuration c in query)
            {
                c.Command = command;
            }


            dc.SubmitChanges();
            queryButton_Click(sender, e);
        }
Esempio n. 13
0
        public static bool DeleteEntriesFromSmallPopulationEntry(EnlistmentDC dc)
        {
            var cfg = from c in dc.Configurations
                      where c.PhoneSKU.Name == "CEPC"
                      select c;

            dc.Configurations.DeleteAllOnSubmit(cfg);
            dc.SubmitChanges();

            var mod = from c in dc.Configurations
                      where c.PhoneSKU.Name == "CEPC"
                      select c;

            if (mod != null && mod.Count() > 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Esempio n. 14
0
        private void addTestRowButton_Click(object sender, RoutedEventArgs e)
        {
            EnlistmentDC dc    = this.viewModel.dc;
            short        maxId = (short)(from s in dc.Configurations
                                         select s.ID).Max <short>();

            maxId += 1;
            this.testConfigItem = new Configuration
            {
                ID           = maxId,
                UserID       = 1,
                EmailID      = 1,
                PhoneSkuID   = 3,
                CommandID    = 1,
                BuildXmlID   = 1,
                EnlistmentID = 1,
                DailyBuild   = 1
            };
            dc.Configurations.InsertOnSubmit(this.testConfigItem);
            dc.SubmitChanges();
            queryButton_Click(sender, e);
        }
 internal virtual void AddItem()
 {
     dc.SubmitChanges();
     this.QueryAllDbTable();
 }