public bool Update(bool isWeb = false, bool checkPermission = false) { bool hasPermission = true; if (checkPermission) { hasPermission = ClassLibrary.JPermission.CheckPermission("AVL.RegisterDevice.JRegisterDevice.Update"); } if (!hasPermission) { return(false); } JRegisterDeviceTable AT = new JRegisterDeviceTable(); AT.SetValueProperty(this); if (AT.Update()) { try { } catch (Exception e) { ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.RegisterDevice.JRegisterDevice", AT.Code, 0, 0, 0, "ویرایش دستگاه", "", 0); } return(true); } else { return(false); } }
public bool Update(bool isWeb = false, bool checkPermission = true) { bool hasperission = true; if (checkPermission) { hasperission = ClassLibrary.JPermission.CheckPermission("AVL.ObjectList.JObjectList.Update"); } if (!hasperission) { return(false); } JObjectListTable AT = new JObjectListTable(); AT.SetValueProperty(this); if (AT.Update()) { if (!isWeb) { Nodes.Refreshdata(Nodes.CurrentNode, JObjectLists.GetDataTable(Code).Rows[0]); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.ObjectList.JObjectList", AT.Code, 0, 0, 0, "ویرایش متحرک", "", 0); return(true); } else { return(false); } }
public bool Delete(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.RegisterDevice.JRegisterDevice.Delete")) { return(false); } ClassLibrary.JDataBase DB = new ClassLibrary.JDataBase(); DB.setQuery("delete from AVLCoordinate where DeviceCode=" + Code.ToString()); DB.Query_Execute(true); JRegisterDeviceTable AT = new JRegisterDeviceTable(); AT.SetValueProperty(this); if (AT.Delete()) { if (!isWeb) { Nodes.Delete(Nodes.CurrentNode); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.RegisterDevice.JRegisterDevice", AT.Code, 0, 0, 0, "حذف دستگاه", "", 0); return(true); } else { return(false); } }
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, bool checkpermission = true) { bool haspermission = true; if (checkpermission) { haspermission = ClassLibrary.JPermission.CheckPermission("AVL.Accounting.JCash.Update"); } if (!haspermission) { return(false); } JCashTable AT = new JCashTable(); AT.SetValueProperty(this); if (AT.Update()) { ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Accounting.JCash.Update", AT.Code, 0, 0, 0, "ویرایش صندوق", "", 0); return(true); } else { return(false); } }
public int Insert(decimal taxPercent, decimal DeviceRegisterPrice, bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.RegisterDevice.JRegisterDevice.Insert")) { return(0); } this.active = false; JRegisterDeviceTable AT = new JRegisterDeviceTable(); AT.SetValueProperty(this); Code = AT.Insert(); decimal Total = 0; //Insert factor Accounting.Factor.JFactor factor = new Accounting.Factor.JFactor(); factor.RegisterDate = DateTime.Now; factor.userCode = WebClassLibrary.SessionManager.Current.MainFrame.CurrentUserCode; factor.payState = false; //insert active factorItem Accounting.Factor.FactorItem.JFactorItem item = new Accounting.Factor.FactorItem.JFactorItem(); item.count = 1; item.describe = "هزینه فعال کردن"; item.product = 1; item.FactorCode = factor.Insert(); Total = item.TotalUnitPrice = item.unitPrice = DeviceRegisterPrice; item.Insert(); ////insert charge factorItem item.describe = "هزینه شارژ سی روز"; AVL.Device.JDeviceModel m = new AVL.Device.JDeviceModel(); m.GetData(this.DeviceType.ToString()); item.unitPrice = (decimal)m.UnitPrice; item.count = 30; Total += item.TotalUnitPrice = 30 * item.unitPrice; item.Insert(); factor.Tax = taxPercent * Total / 100; factor.Total = Total + factor.Tax; factor.Discount = 0; factor.Update(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.RegisterDevice.JRegisterDevice", Code, 0, 0, 0, "ثبت دستگاه", "", 0); if (Code > 0 && !isWeb) { Nodes.DataTable.Merge(JRegisterDevices.GetDataTable(true, "", Code)); } ClassLibrary.JException j = ClassLibrary.JCore.Except; // foreach (Exception ex in ClassLibrary.JSystem.Except) // { // Exception e = ex; // } return(Code); }
public int Insert() { if (!ClassLibrary.JPermission.CheckPermission("AVL.Accounting.JAVLPaid.Insert")) { return(0); } JAVLPaidTable AT = new JAVLPaidTable(); AT.SetValueProperty(this); code = AT.Insert(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Accounting.JAVLPaid", code, 0, 0, 0, "ثبت فیش پرداختی", "", 0); return(code); }
public int Insert(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.Accounting.JCash.Insert")) { return(0); } JCashTable AT = new JCashTable(); AT.SetValueProperty(this); code = AT.Insert(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Accounting.JCash", code, 0, 0, 0, "ثبت در صندوق", "", 0); return(code); }
public int Insert(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.Device.JDeviceModel.Insert")) { return(0); } JDeviceModelTable AT = new JDeviceModelTable(); AT.SetValueProperty(this); Code = AT.Insert(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Device.JDeviceModel", Code, 0, 0, 0, "ثبت مدل دستگاه", "", 0); if (Code > 0 && !isWeb) { Nodes.DataTable.Merge(JDeviceModels.GetDataTable(Code)); } return(Code); }
public int Insert(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.ObjectList.JObjectList.Insert")) { return(0); } JObjectListTable AT = new JObjectListTable(); AT.SetValueProperty(this); Code = AT.Insert(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.ObjectList.JObjectList", Code, 0, 0, 0, "ثبت متحرک", "", 0); if (Code > 0 && !isWeb) { Nodes.DataTable.Merge(JObjectLists.GetDataTable(Code)); } return(Code); }
/// <summary> /// insert data int GeofenceData with check permission definition. /// </summary> /// <param name="isWeb"></param> /// <param name="checkPermission"></param> /// <returns></returns> public int Insert(bool isWeb = false, bool checkPermission = true) { bool haspermission = true; if (checkPermission) { haspermission = (ClassLibrary.JPermission.CheckPermission("AVL.Geofence.GeoData.JGeofenceData.Insert")); } if (!haspermission) { return(0); } JGeofeneceDataTable AT = new JGeofeneceDataTable(); AT.SetValueProperty(this); Code = AT.Insert(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Geofence.GeoData.JGeofenceData", Code, 0, 0, 0, "ثبت اطلاعات ژئوفنس", "", 0); return(Code); }
public int Insert(bool isWeb = false, bool checkPermission = true) { bool hasPermission = true; if (checkPermission) { hasPermission = ClassLibrary.JPermission.CheckPermission("AVL.RegisterDevice.JRegisterDevice.Insert"); } if (!hasPermission) { return(0); } JRegisterDeviceTable AT = new JRegisterDeviceTable(); AT.SetValueProperty(this); Code = AT.Insert(); ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.RegisterDevice.JRegisterDevice", Code, 0, 0, 0, "ثبت دستگاه", "", 0); try { if (Code > 0 && !isWeb && Nodes != null) { Nodes.DataTable.Merge(JRegisterDevices.GetDataTable(true, "", Code)); } } catch { } ClassLibrary.JException j = ClassLibrary.JCore.Except; // foreach (Exception ex in ClassLibrary.JSystem.Except) // { // Exception e = ex; // } return(Code); }
public bool Delete(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.Accounting.JAVLPaid.Delete")) { return(false); } JAVLPaidTable AT = new JAVLPaidTable(); AT.SetValueProperty(this); if (AT.Delete()) { if (!isWeb) { Nodes.Delete(Nodes.CurrentNode); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Accounting.JAVLPaid", AT.Code, 0, 0, 0, "حذف فیش", "", 0); return(true); } else { return(false); } }
public bool Update(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.Device.JDeviceModel.Update")) { return(false); } JDeviceModelTable AT = new JDeviceModelTable(); AT.SetValueProperty(this); if (AT.Update()) { if (!isWeb) { Nodes.Refreshdata(Nodes.CurrentNode, JDeviceModels.GetDataTable(Code).Rows[0]); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Device.JDeviceModel", AT.Code, 0, 0, 0, "ویرایش مدل دستگاه", "", 0); return(true); } else { return(false); } }
public bool Delete(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.Device.JDeviceModel.Delete")) { return(false); } JDeviceModelTable AT = new JDeviceModelTable(); AT.SetValueProperty(this); if (AT.Delete()) { if (!isWeb) { Nodes.Delete(Nodes.CurrentNode); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.Device.JDeviceModel", AT.Code, 0, 0, 0, "حذف مدل دستگاه", "", 0); return(true); } else { return(false); } }
public bool Delete(bool isWeb = false) { if (!ClassLibrary.JPermission.CheckPermission("AVL.ObjectList.JObjectList.Delete")) { return(false); } JObjectListTable AT = new JObjectListTable(); AT.SetValueProperty(this); if (AT.Delete()) { if (!isWeb) { Nodes.Delete(Nodes.CurrentNode); } ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory(); jHistory.Save("AVL.ObjectList.JObjectList", AT.Code, 0, 0, 0, "حذف متحرک", "", 0); return(true); } else { return(false); } }