Example #1
0
        public int Insert(bool isWeb = false)
        {
            if (!ClassLibrary.JPermission.CheckPermission("BusManagment.Fleet.JFleet.Insert"))
            {
                return(0);
            }

            FleetTable AT = new FleetTable();

            AT.SetValueProperty(this);
            Code = AT.Insert();
            if (Code > 0 && !isWeb)
            {
                Nodes.DataTable.Merge(JFleets.GetDataTable(Code));
            }
            ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory();
            jHistory.Save("BusManagment.JFleet", Code, 0, 0, 0, "ثبت ناوگان", "", 0);
            return(Code);
        }
Example #2
0
        public bool Delete(bool isWeb = false)
        {
            if (!ClassLibrary.JPermission.CheckPermission("BusManagment.Fleet.JFleet.Delete"))
            {
                return(false);
            }
            FleetTable AT = new FleetTable();

            AT.SetValueProperty(this);
            if (AT.Delete())
            {
                if (!isWeb)
                {
                    Nodes.Delete(Nodes.CurrentNode);
                }
                ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory();
                jHistory.Save("BusManagment.JFleet", AT.Code, 0, 0, 0, "حذف ناوگان", "", 0);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        public bool Update(bool isWeb = false)
        {
            if (!ClassLibrary.JPermission.CheckPermission("BusManagment.Fleet.JFleet.Update"))
            {
                return(false);
            }
            FleetTable AT = new FleetTable();

            AT.SetValueProperty(this);
            if (AT.Update())
            {
                if (!isWeb)
                {
                    Nodes.Refreshdata(Nodes.CurrentNode, JFleets.GetDataTable(Code).Rows[0]);
                }
                ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory();
                jHistory.Save("BusManagment.JFleet", AT.Code, 0, 0, 0, "ویرایش ناوگان", "", 0);
                return(true);
            }
            else
            {
                return(false);
            }
        }