public int Insert(bool isWeb = false, bool checkpermission = true) { bool hasPermission = true; if (checkpermission) { hasPermission = ClassLibrary.JPermission.CheckPermission("AVL.Coordinate.JCoordinate.Insert"); } if (!hasPermission) { return(0); } JCoordinateTable AT = new JCoordinateTable(); AT.SetValueProperty(this); Code = AT.Insert(0, true); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Coordinate.JCoordinate", Code, 0, 0, 0, "ثبت مختصات", "", 0); if (Code > 0 && !isWeb) { Nodes.DataTable.Merge(JCoordinates.GetDataTable(Code)); } return(Code); }
public bool Update(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.Coordinate.JCoordinate.Update")) { return(false); } JCoordinateTable AT = new JCoordinateTable(); AT.SetValueProperty(this); if (AT.Update()) { if (!isWeb) { Nodes.Refreshdata(Nodes.CurrentNode, JCoordinates.GetDataTable(Code).Rows[0]); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Coordinate.JCoordinate", AT.Code, 0, 0, 0, "ویرایش مختصات", "", 0); return(true); } else { return(false); } }