public ActionResult CreateClient(string fio, string note, int sourceID, int statusID) { var mng = new CRMManager(); int? sourceID_ = null; if (sourceID != 0) sourceID_ = sourceID; int? statusID_ = null; if (statusID != 0) statusID_=statusID; var user = HttpContext.User.Identity.Name; var item = new crm_clients { id = 0, fio = fio, city=null, note = note, sourceID =sourceID_, statusID = statusID_, addedBy = user, created = DateTime.Now, nextContact = DateTime.Now, subchannel = null, username = null, needActive = null }; mng.SaveClient(item); return Json(new { result = item.id > 0, clientID = item.id }); }