public static string InsertPatientInfo(LPatientInfo pitems) { int i = 0; Query _QueryRS = LPatientInfo.CreateQuery(); try { if (!LUser.FetchByParameter(LPatientInfo.Columns.PatientId, Comparison.Equals, pitems.PatientId).Read()) { pitems.IsNew = true; pitems.Save(i); return(_QueryRS.GetMax(LPatientInfo.Columns.PatientId).ToString()); } else { return("-1"); //throw new Exception(string.Format("Name:{0} Đã tồn tại", pitems.IPAddress)); } } catch (Exception ex) { throw ex; } }