public ActionResult DeleteConfirmed(int? id)
        {
            if (id == null)
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);

            TreeViewModel db_cs = new TreeViewModel();
            CompanyEntity comp = db_cs.CompaniesTreeViewTable.Find(id);
            if (comp == null)
                return HttpNotFound();

            //get childs for change it's parent
            IQueryable<CompanyEntity> childs = db_cs.CompaniesTreeViewTable.Where(c => c.ParentId == comp.Id);
            if (childs.Count() > 0)
                //move childs to up level in tree
                foreach (CompanyEntity c_c in childs)
                {
                    c_c.ParentId = comp.ParentId;
                    db_cs.Entry(c_c).State = EntityState.Modified;
                }

            db_cs.CompaniesTreeViewTable.Remove(comp);

            db_cs.SaveChanges();
            return RedirectToAction("GetTree");
        }
        public ActionResult EditCompany(
            [Bind(Include = "Id, Name,Earning,ParentId")] CompanyEntity comp)
        {
            if (ModelState.IsValid)
            {
                TreeViewModel db_cs = new TreeViewModel();
                db_cs.Entry(comp).State = EntityState.Modified;
                db_cs.SaveChanges();
            }

            return View(comp);
        }