Ejemplo n.º 1
0
        public void ChangeComputer(BindingSource BSTemp)
        {
            int MonitorID = GetidCurrentMonitor(BSTemp);

            DS_NiheComputers.MonitorRow mr = DS.Monitor.FindByID(MonitorID);
            Monitor             monitor    = new Monitor(DS, mr);
            DialogListValueEdit D          = new DialogListValueEdit(Operation.ChahgeComputer);

            foreach (DS_NiheComputers.CompRow r in DS.Comp)
            {
                Console.Write(r.Room);
                Console.Write("  ");
                Console.WriteLine(r.MonitorGUID);
            }

            D.ValuesList = DS.Comp.Select(string.Format("room = '{0}' and monitorGuid = ''", monitor.Room));
            if (mr.CompRow != null)
            {
                D.StartValue = mr.CompRow.ID;
            }
            else
            {
                D.StartValue = 0;
            }
            if (ChangeListValueEvent != null)
            {
                ChangeListValueEvent(this, D);
                if (D.Changed)
                {
                    ChangeComputer(monitor.GUID, D.EndValue, D.Date, D.ExtendedInfo);
                }
            }
            D       = null;
            monitor = null;
        }
        public Form05ChangeValue(DialogListValueEdit D)
        {
            InitializeComponent();
            this.DialogList        = D;
            this.comboBox1.Visible = true;
            this.textBox1.Visible  = false;

            this.comboBox1.DataSource = DialogList.ValuesList;

            this.comboBox1.ValueMember = "id";
            //this.comboBox1.SelectedValue = DialogList.StartValue;
            this.label2.Visible = false;
            this.label1.Visible = false;
            initForm(D);
        }
Ejemplo n.º 3
0
        public void ChangeDepartment(BindingSource BSTemp)
        {
            int MonitorID = GetidCurrentMonitor(BSTemp);

            DS_NiheComputers.MonitorRow mr = DS.Monitor.FindByID(MonitorID);
            Monitor             monitor    = new Monitor(DS, mr);
            DialogListValueEdit D          = new DialogListValueEdit(Operation.ChangeDepartment);

            D.ValuesList = DS.Department.Select();
            D.StartValue = monitor.DepartmentID;
            if (ChangeListValueEvent != null)
            {
                ChangeListValueEvent(this, D);
                if (D.Changed)
                {
                    ChangeDepartment(monitor, D.EndValue, D.Date, D.ExtendedInfo);
                }
            }
            D       = null;
            monitor = null;
        }
Ejemplo n.º 4
0
        public void ChangeDepartment(BindingSource BSTemp)
        {
            int ComputerID = GetidCurrentComputer(BSTemp);

            DS_NiheComputers.CompRow cr = DS.Comp.FindByID(ComputerID);
            Computer            comp    = new Computer(DS, cr);
            DialogListValueEdit D       = new DialogListValueEdit(Operation.ChangeDepartment);

            D.ValuesList = DS.Department.Select("name <> 'списан'", "Sort");
            D.StartValue = comp.DepartmentID;
            if (ChangeListValueEvent != null)
            {
                ChangeListValueEvent(this, D);
                if (D.Changed)
                {
                    ChangeDepartment(comp.GUID, D.EndValue, D.Date, D.ExtendedInfo);
                }
            }
            D    = null;
            comp = null;
        }
        private void initForm(DialogListValueEdit D)
        {
            this.comboBox1.DisplayMember = "FullName";
            switch (D.OperationName)
            {
            case Operation.ChahgeComputer:
                this.comboBox1.DisplayMember = "FullName2";
                this.Text = "Выбор компьютера";
                break;

            case Operation.ChangeDepartment:
                this.Text = "Выбор структурного подразделения";
                break;

            case Operation.ChangeHDD:
                this.Text = "Выбор жесткого диска";
                break;

            case Operation.ChangeMonitor:
                this.Text = "Выбор монитора";
                break;

            case Operation.ChangeMonitorModel:
                this.Text = "Выбор модели монитора";
                break;

            case Operation.ChangeOS:
                this.Text = "Выбор операционной системы";
                break;

            case Operation.ChangeProcessor:
                this.Text = "Выбор процессора";
                break;

            default:
                this.comboBox1.DisplayMember = "FullName";
                break;
            }
        }
Ejemplo n.º 6
0
        public void ChangeDepartment(BindingSource BSTemp)
        {
            int SDeviceID = GetidCurrentSDevice(BSTemp);

            DS_NiheComputers.SimpleDeviceRow sdr = DS.SimpleDevice.FindByID(SDeviceID);
            //Computer comp = new Computer(DS, cr);
            SimpleDevice        sDevice = new SimpleDevice(DS, sdr);
            DialogListValueEdit D       = new DialogListValueEdit(Operation.ChangeDepartment);

            D.ValuesList = DS.Department.Select("name <> 'списан'", "Sort");
            D.StartValue = sDevice.DepartmentID;
            if (ChangeListValueEvent != null)
            {
                ChangeListValueEvent(this, D);
                if (D.Changed)
                {
                    ChangeDepartment(sDevice, D.EndValue, D.Date, D.ExtendedInfo);
                }
            }
            D       = null;
            sDevice = null;
        }
Ejemplo n.º 7
0
        public void ChangeOS(BindingSource BSTemp)
        {
            int ComputerID = GetidCurrentComputer(BSTemp);

            DS_NiheComputers.CompRow cr = DS.Comp.FindByID(ComputerID);
            Computer            comp    = new Computer(DS, cr);
            DialogListValueEdit D       = new DialogListValueEdit(Operation.ChangeOS);

            D.ValuesList = DS.OS.Select();
            D.StartValue = comp.OSID;
            if (ChangeListValueEvent != null)
            {
                ChangeListValueEvent(this, D);
                if (D.Changed)
                {
                    comp.OSID = D.EndValue;
                    WriteEvent("Изменение операционной системы компьютера", D.Date, comp, D.ExtendedInfo);
                }
            }
            D    = null;
            comp = null;
        }
Ejemplo n.º 8
0
        public void ChangeMonitor(BindingSource BSTemp)
        {
            int ComputerID = GetidCurrentComputer(BSTemp);

            DS_NiheComputers.CompRow cr = DS.Comp.FindByID(ComputerID);
            Computer            comp    = new Computer(DS, cr);
            DialogListValueEdit D       = new DialogListValueEdit(Operation.ChangeMonitor);

            //D.ValuesList = DS.Monitor.Select(string.Format("room = '{0}'", comp.Room));
            D.ValuesList = DS.Monitor.Select(string.Format("room = '{0}' and computerguid like '' ", comp.Room));

            D.StartValue = comp.MonitorID;
            if (ChangeListValueEvent != null)
            {
                ChangeListValueEvent(this, D);
                if (D.Changed)
                {
                    ChangeMonitor(comp.GUID, D.EndValue, D.Date, D.ExtendedInfo);
                }
            }
            D    = null;
            comp = null;
        }
Ejemplo n.º 9
0
        void ChangeListValue(object sender, DialogListValueEdit D)
        {
            Form05ChangeValue F = new Form05ChangeValue(D);

            F.ShowDialog();
        }