public JsonResult checkCodeViewExit(string code, string codeView) { int ret; SKILL_BUS bus = new SKILL_BUS(); SKILL_OBJ obj = null; if (!string.IsNullOrEmpty(code)) { //check for update obj = bus.GetByKey(new fieldpara("CODEVIEW", codeView, 0), new fieldpara("UNIVERSITYCODE", ses.gUNIVERSITYCODE, 0)); if (obj == null) { //change codeview ret = 1; } else { //change other feature,not codeview ret = (code == obj.CODE) ? 1 : -1; } } else { obj = bus.GetByKey(new fieldpara("CODEVIEW", codeView, 0), new fieldpara("UNIVERSITYCODE", ses.gUNIVERSITYCODE, 0)); ret = (obj == null) ? 1 : -1; } bus.CloseConnection(); return(Json(new { sussess = ret }, JsonRequestBehavior.AllowGet)); }