public int InsertEntity_tip(int?id_sup, bool?elcat, string kodi, int?kodifillim, int?kodimbarim, int?kodiaktual, string emertimi, string pershkrimi, string emertimiang, string pershkrimiang, double?rradha, int?perdorues_id)
 {
     using (var context = new taskDb())
     {
         var result = context.spI_tbl_Analize_tip(id_sup, elcat, kodi, kodifillim, kodimbarim, kodiaktual, emertimi, pershkrimi, emertimiang, pershkrimiang, rradha, perdorues_id);
         return(result);
     }
 }
        public ActionResult SaveNewTip(TipiViewModel model)
        {
            bool True = true;

            using (var db = new taskDb())
            {
                db.spI_tbl_Analize_tip(model.SelectedParent, True, model.EntitetTip.kodi, model.EntitetTip.kodifillim, model.EntitetTip.kodimbarim, model.EntitetTip.kodiaktual, model.EntitetTip.emertimi, model.EntitetTip.pershkrimi, model.EntitetTip.emertimiang, model.EntitetTip.pershkrimiang, model.EntitetTip.rradha, model.EntitetTip.perdorues_id);
                db.SaveChanges();
                int a = db.SelectAllActiveRec_Entitet_tip("tbl_Analize").OrderByDescending(i => i.nrrendor).FirstOrDefault().nrrendor;
                db.spI_tbl_nder_Analize_tip_kategori(model.SelectedParent, a, model.SelectedKategoriId, model.EntitetTip.perdorues_id);
            }

            return(RedirectToAction("Index"));
        }