public static string UpdateTcpip1(LTcpip pitems) { int i = 0; string id = "-1"; Query _QueryRS = LTcpip.CreateQuery(); try { if (LTcpip.FetchByParameter(LTcpip.Columns.Id, Comparison.Equals, pitems.Id).Read()) { pitems.IsNew = false; pitems.Save(); id = _QueryRS.GetMax(LTcpip.Columns.Id).ToString(); } } catch (Exception ex) { id = "-1"; } return(id); }
/// <summary> /// Hàm thực hiện Insert, Delte, Update TCIP /// </summary> /// <param name="pitems"></param> public static string InsertTCPIP(LTcpip pitems) { int i = 0; Query _QueryRS = LTcpip.CreateQuery(); try { if (!LTcpip.FetchByParameter(LTcpip.Columns.IPAddress, Comparison.Equals, pitems.IPAddress).Read()) { pitems.IsNew = true; pitems.Save(i); return(_QueryRS.GetMax(LTcpip.Columns.Id).ToString()); } else { return("-1"); } } catch (Exception ex) { throw ex; } }