public int Insert(bool isWeb = false) { if (!JPermission.CheckPermission("BusManagment.Station.JStation.Insert")) { return(0); } StationTable AT = new StationTable(); AT.SetValueProperty(this); Code = AT.Insert(); if (Code > 0 && !isWeb) { Nodes.DataTable.Merge(JStations.GetDataTable(Code)); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("BusManagment.JStation", Code, 0, 0, 0, "ثبت ایستگاه", "", 0); return(Code); }
public bool Update(bool isWeb = false) { if (!JPermission.CheckPermission("BusManagment.Station.JStation.Update")) { return(false); } StationTable AT = new StationTable(); AT.SetValueProperty(this); if (AT.Update()) { if (!isWeb) { Nodes.Refreshdata(Nodes.CurrentNode, JStations.GetDataTable(Code).Rows[0]); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("BusManagment.JStation", AT.Code, 0, 0, 0, "ویرایش ایستگاه", "", 0); return(true); } else { return(false); } }
public bool Delete(bool isWeb = false) { if (!JPermission.CheckPermission("BusManagment.Station.JStation.Delete")) { return(false); } StationTable AT = new StationTable(); AT.SetValueProperty(this); if (AT.Delete()) { if (!isWeb) { Nodes.Delete(Nodes.CurrentNode); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("BusManagment.JStation", AT.Code, 0, 0, 0, "حذف ایستگاه", "", 0); return(true); } else { return(false); } }