Beispiel #1
0
 public void ChangeRoom(SimpleDevice SDevice, string Room, DateTime Date, string ExtendInfo)
 {
     if (SDevice.Room != Room)
     {
         SDevice.Room = Room;
         WriteEvent("Изменение кабинета", Date, SDevice, ExtendInfo);
     }
 }
Beispiel #2
0
 public void ChangeDepartment(SimpleDevice sDevice, int NewDepartmentID, DateTime Date, string ExtendInfo)
 {
     if (sDevice.DepartmentID != NewDepartmentID)
     {
         sDevice.DepartmentID = NewDepartmentID;
         WriteEvent("Изменение отдела компьютера", Date, sDevice, ExtendInfo);
     }
 }
Beispiel #3
0
 public void ChangeNumber(SimpleDevice SDevice, string NewNumber, DateTime Date, string ExtendInfo)
 {
     if (SDevice.Number != NewNumber)
     {
         SDevice.Number = NewNumber;
         WriteEvent("Изменение инвентарника", Date, SDevice, ExtendInfo);
     }
 }
Beispiel #4
0
 public void ChangeDescription(SimpleDevice SDevice, string Description, DateTime Date, string ExtendInfo)
 {
     if (SDevice.Description != Description)
     {
         SDevice.Description = Description;
         WriteEvent("Изменение описания", Date, SDevice, ExtendInfo);
     }
 }
Beispiel #5
0
 public void ChangeUser(SimpleDevice SDevice, string User, DateTime Date, string ExtendInfo)
 {
     if (SDevice.Username != User)
     {
         SDevice.Username = User;
         WriteEvent("Изменение пользователя", Date, SDevice, ExtendInfo);
     }
 }
Beispiel #6
0
        public void ChangeRoom(BindingSource BSTemp)
        {
            int SDeviceID = GetidCurrentSDevice(BSTemp);

            DS_NiheComputers.SimpleDeviceRow sdr = DS.SimpleDevice.FindByID(SDeviceID);
            SimpleDevice SDevice = new SimpleDevice(DS, sdr);

            DialogStringValueEdit D = new DialogStringValueEdit();

            D.StartText = SDevice.Room;
            if (ChangeStringValueEvent != null)
            {
                ChangeStringValueEvent(this, D);
                if (D.Changed)
                {
                    ChangeRoom(SDevice, D.EndText, D.Date, D.ExtendedInfo);
                }
            }
            D       = null;
            SDevice = null;
        }
Beispiel #7
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;
        }
Beispiel #8
0
 public DialogSimpleDevice(SimpleDevice SDevice)
 {
     this.SDevice = SDevice;
     this.DS      = SDevice.DS;
 }
Beispiel #9
0
 private void WriteEvent(string S1, DateTime D, SimpleDevice SDevice, string ExtendedInfo)
 {
     WriteEvent(S1, D, SDevice.ID, SDevice.ResultMessage, ExtendedInfo);
 }
Beispiel #10
0
        public void Add()
        {
            DS_NiheComputers.SimpleDeviceRow sr = null;
            DialogSimpleDeviceAdd            D  = new DialogSimpleDeviceAdd();
            string infoString = null;

            if (SimpleDeviceAddEvent != null)
            {
                SimpleDeviceAddEvent(this, D);
                if (D.Changed)
                {
                    sr              = DS.SimpleDevice.NewSimpleDeviceRow();
                    sr.Name         = D.Name;
                    sr.DepartmentID = D.DepartmentID;
                    sr.Number       = D.Number;
                    sr.PurchaseDate = D.PurchaseDate;
                    sr.WarantyDate  = D.PurchaseDate.AddYears((int)D.WarantyDate);
                    sr.Room         = D.Room;
                    sr.UserName     = D.Username;
                    sr.VendorID     = D.VendorID;
                    sr.Description  = D.Description;
                    sr.DeviceTypeID = D.SimpleDeviceTypeID;
                    DS.SimpleDevice.AddSimpleDeviceRow(sr);
                    infoString = sr.FullName;
                    EventWriterSimpleDevice ewc = new EventWriterSimpleDevice(D);
                    ewc.SimpleDeviceID   = sr.ID;
                    ewc.SimpleDeviceText = sr.FullName;
                    ewc.DS = DS;
                    SimpleDevice SDevice = new SimpleDevice(DS, sr);
                    ewc.EventName = "Поступление оборудования";
                    ewc.Info      = SDevice.FullName;
                    if (SDevice.Number != null & SDevice.Number != "")
                    {
                        ewc.Info = string.Format("{0}\r\nИнв. №: {1}", ewc.Info, SDevice.Number);
                    }
                    if (SDevice.Vendor != null & SDevice.Vendor != " ")
                    {
                        ewc.Info = string.Format("{0}\r\nПроизвод.: {1}", ewc.Info, SDevice.Vendor);
                    }
                    if (SDevice.Department != null & SDevice.Department != "")
                    {
                        ewc.Info = string.Format("{0}\r\nСтрукт подразд.: {1}", ewc.Info, SDevice.Department);
                    }
                    if (SDevice.Name != null & SDevice.Name != "")
                    {
                        ewc.Info = string.Format("{0}\r\nМодель.: {1}", ewc.Info, SDevice.Name);
                    }
                    if (SDevice.Room != null & SDevice.Room != "")
                    {
                        ewc.Info = string.Format("{0}\r\nКабинет: {1}", ewc.Info, SDevice.Room);
                    }
                    if (SDevice.Username != null & SDevice.Username != "")
                    {
                        ewc.Info = string.Format("{0}\r\nИмя польз.: {1}", ewc.Info, SDevice.Username);
                    }
                    ewc.Write();
                    SDevice = null;
                }
            }
            D = null;
        }