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