Пример #1
0
        private void label17_Click(object sender, EventArgs e)
        {
            Form5_shenasnameList form = new Form5_shenasnameList();

            form.Show();
            this.Hide();
        }
Пример #2
0
        private void label3_Click(object sender, EventArgs e)
        {
            string shenasnameID = GlobalVariable.shenasnameID;

            using (var dbcontext = new Model.Context())
            {
                shenasname shen = dbcontext.shenasnames.SingleOrDefault(x => x.ID == shenasnameID);

                if (shen.final != 1)
                {
                    string parentID = shen.parent;

                    List <shenasname> shenList = dbcontext.shenasnames.Where(x => x.parent == parentID).ToList();
                    foreach (shenasname item in shenList)
                    {
                        item.master = "0";
                    }
                    ;
                    shen.isDone = true;
                    shen.master = "1";
                    shen.final  = 1;

                    dbcontext.SaveChanges();
                }

                this.Hide();
                Form5_shenasnameList form5 = new Form5_shenasnameList();
                form5.Show();
            }
        }