public JsonResult MovePendingToOk(PlataExtended plata) { string conStr = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString; int _CURENT_USER_ID = Convert.ToInt32(Session["CURENT_USER_ID"]); Plata p = new Plata(_CURENT_USER_ID, conStr); PropertyInfo[] pis = plata.Plata.GetType().GetProperties(); foreach (PropertyInfo pi in pis) { pi.SetValue(p, pi.GetValue(plata.Plata)); // ca sa avem un obiect si cu credentiale } response toReturn = p.UpdateWithErrors(); if (!toReturn.Status) { return(Json(toReturn, JsonRequestBehavior.AllowGet)); } toReturn = p.Validare(); if (!toReturn.Status) { return(Json(toReturn, JsonRequestBehavior.AllowGet)); } PlatiRepository pr = new PlatiRepository(_CURENT_USER_ID, conStr); toReturn = pr.MovePendingToOk(Convert.ToInt32(p.ID)); return(Json(toReturn, JsonRequestBehavior.AllowGet)); }