public static void MoveSubcategory(MergeCategoriesModel model)
        {
            recordSubcategory subCat = db.recordSubcategories.Find(model.recordSubcategoryId_FROM);

            int dossierId = (from c in db.recordCategories
                             join s in db.recordSubcategories on c.recordCategoryId equals s.recordCategoryId
                             where s.recordSubcategoryId == model.recordSubcategoryId_FROM
                             select c.dossierId).Single();

            if (model.dossierId == dossierId)
            {
                subCat.recordCategoryId = model.recordCategoryId_TO;
                db.Entry(subCat).State  = EntityState.Modified;
                db.SaveChanges();
            }
        }
 public static void MergeSubcategories(MergeCategoriesModel model)
 {
     db.sp_mergeSubcategories(model.dossierId,
                              model.recordSubcategoryId_FROM,
                              model.recordSubcategoryId_TO);
 }