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")); }