private void bakhshList_Click(object sender, EventArgs e) { Komite_List form = new Komite_List(); form.Show(); this.Hide(); }
private void filter_Click(object sender, EventArgs e) { string komiteID = GlobalVariable.comiteID; using (var dbcontext = new Model.Context()) { komite marz = dbcontext.komites.SingleOrDefault(x => x.ID == komiteID); if (marz.final != 1) { string parentID = marz.parent; marz.title = title.Text; marz.masoul = masool.Text; marz.janeshin = janeshin.Text; marz.markazID = bakhsh.SelectedValue.ToString(); List <komite> lst = dbcontext.komites.Where(x => x.parent == parentID).ToList(); foreach (komite item in lst) { item.master = "0"; } ; marz.isDone = true; marz.master = "1"; marz.final = 1; dbcontext.SaveChanges(); } GlobalVariable.comiteID = marz.parent; } this.Hide(); Komite_List form5 = new Komite_List(); form5.Show(); }