Exemplo n.º 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);
        }
Exemplo n.º 2
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);
            }
        }