public bool Delete(bool isWeb = false, JDataBase db = null) { if (!JPermission.CheckPermission("BusManagment.WorkOrder.JTariff.Delete")) { return(false); } TariffTable AT = new TariffTable(); AT.SetValueProperty(this); if (isWeb || JMessages.Question("آیا میخواهید حکم انتخاب شده حذف شود؟", "") == System.Windows.Forms.DialogResult.Yes) { if (AT.Delete(db)) { if (!isWeb) { Nodes.Delete(Nodes.CurrentNode); } return(true); } else { return(false); } } return(false); }
public int Insert(bool isWeb = false) { //if (!JPermission.CheckPermission("BusManagment.WorkOrder.JTariff.Insert")) // return 0; TariffTable AT = new TariffTable(); AT.SetValueProperty(this); Code = AT.Insert(); if (Code > 0 && !isWeb) { Nodes.DataTable.Merge(JTariffs.GetDataTable(Code)); } return(Code); }
public bool Update(bool isWeb = false) { //if (!JPermission.CheckPermission("BusManagment.WorkOrder.JTariff.Update")) // return false; TariffTable AT = new TariffTable(); AT.SetValueProperty(this); if (AT.Update()) { if (!isWeb) { Nodes.Refreshdata(Nodes.CurrentNode, JTariffs.GetDataTable(Code).Rows[0]); } return(true); } else { return(false); } }