public DeviceBindingEditControl(List <DeviceInfoDTO> source, Utils.DeviceTypes deviceType)
        {
            InitializeComponent();

            devicesBS.DataSource = source;
            _deviceType          = deviceType;

            if (_deviceType != Utils.DeviceTypes.Stacker)
            {
                storeLbl.Visible       = false;
                storeNamesEdit.Visible = false;
            }

            deviceEdit.Properties.DataSource    = devicesBS;
            deviceEdit.Properties.ValueMember   = "DeviceId";
            deviceEdit.Properties.DisplayMember = "Name";

            storeNamesService       = Program.kernel.Get <IStoreNamesService>();
            storeNamesBS.DataSource = storeNamesService.GetStoreNameWithFullHeader().Where(w => w.EnableAuthomatization > 0);
            storeNamesEdit.Properties.DataSource    = storeNamesBS;
            storeNamesEdit.Properties.ValueMember   = "StoreNameId";
            storeNamesEdit.Properties.DisplayMember = "Name";

            storeNamesEdit.ItemIndex = 1;
        }
Пример #2
0
        private bool SaveStoreName()
        {
            storeNamesService = Program.kernel.Get <IStoreNamesService>();

            if (FindStoreNameDuplicate((StoreNamesDTO)storeNamesBS.Current))
            {
                MessageBox.Show("Склад с таким наименование уже существует. Введите другое наименование.\n",
                                "Проверка уникальности наименования устройства", MessageBoxButtons.OK, MessageBoxIcon.Information);
                nameTBox.Focus();

                return(false);
            }

            try
            {
                if (_operation == Utils.Operation.Add)
                {
                    _storeNameId = storeNamesService.StoreNameCreate((StoreNamesDTO)Item);
                }
                else
                {
                    storeNamesService.StoreNameUpdate((StoreNamesDTO)Item);
                }

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ошибка при добавлении склада!\n" + ex.Message, "Сохранение", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
Пример #3
0
        private void LoadStoreNamesData()
        {
            storeNamesService = Program.kernel.Get <IStoreNamesService>();

            storeList       = storeNamesService.GetStoreNames();
            storeHeaderList = storeList.Where(s => s.ParentId == null);
        }
Пример #4
0
 private void LoadCellZonesData()
 {
     zoneNamesService         = Program.kernel.Get <IZoneNamesService>();
     storeNamesService        = Program.kernel.Get <IStoreNamesService>();
     wareHousesService        = Program.kernel.Get <IWareHousesService>();
     storageGroupsService     = Program.kernel.Get <IStorageGroupsService>();
     storageGroupZonesService = Program.kernel.Get <IStorageGroupZonesService>();
     cellZonesService         = Program.kernel.Get <ICellZonesService>();
 }
Пример #5
0
        private void LoadData()
        {
            storeNamesService = Program.kernel.Get <IStoreNamesService>();
            wareHousesService = Program.kernel.Get <IWareHousesService>();

            storeLoadList    = storeNamesService.GetStoreLoad().ToList();
            cellLoadList     = wareHousesService.GetWareHouses().ToList();
            cellPresenceList = wareHousesService.GetWareHousePresences().ToList();
        }
Пример #6
0
        private void LoadData()
        {
            storeNamesService = Program.kernel.Get <IStoreNamesService>();

            wareHousesService = Program.kernel.Get <IWareHousesService>();
            reportsService    = Program.kernel.Get <IReportsService>();
            zoneNamesService  = Program.kernel.Get <IZoneNamesService>();
            storeNamesBS.Clear();
            storeNamesBS.DataSource      = storeNamesService.GetStoreNames().Where(sn => sn.ParentId != null).OrderBy(o => o.ParentName);
            zoneNamesList                = zoneNamesService.GetZoneNameByStore();
            zoneUnspecifiedBS.DataSource = zoneNamesService.GetZonesUnspecified();
            zoneInfoList = zoneNamesService.GetCellQuantityByZones();
        }
Пример #7
0
        public StoreNameEditFm(Utils.Operation operation, StoreNamesDTO model)
        {
            InitializeComponent();

            _operation   = operation;
            _storeNameId = (operation == Utils.Operation.Add) ? -1 : model.StoreNameId;

            storeNamesBS.DataSource = Item = model;
            nameTBox.DataBindings.Add("EditValue", storeNamesBS, "Name");

            storeNamesService = Program.kernel.Get <IStoreNamesService>();

            storeTypeEdit.Properties.DataSource = storeNamesService.GetStoreTypes();
            storeTypeEdit.DataBindings.Add("EditValue", storeNamesBS, "StoreTypeId", true, DataSourceUpdateMode.OnPropertyChanged);
            storeTypeEdit.Properties.DisplayMember = "StoreTypeName";
            storeTypeEdit.Properties.ValueMember   = "StoreTypeId";

            enableAuthomatizationChk.DataBindings.Add("Checked", storeNamesBS, "EnableAuthomatization");
        }