Exemplo n.º 1
0
 private void InitStorageList()
 {
     Cursor.Current = Cursors.WaitCursor;
     try
     {
         cboStorage.Items.Clear();
         cboStorage.DisplayMember = "remark";
         cboStorage.ValueMember   = "storageName";
         List <ColdStorage> list = StorageServer.GetStorageList(null);
         foreach (ColdStorage item in list)
         {
             item.remark = string.Format("{0} [{1}] {2}", item.storageName, item.storageType == 1 ? "冷库" : "车载", item.driver);
             int index = cboStorage.Items.Add(item);
             if (item.storageName.Replace("[默认]", "") == Common._StorageName)
             {
                 cboStorage.SelectedIndex = index;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "加载失败", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
     }
     finally {
         Cursor.Current = Cursors.Default;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 加载载体信息
 /// </summary>
 private void LoadStorageInfo()
 {
     try
     {
         List <ColdStorage> list = StorageServer.GetStorageList(Common._StorageName);
         if (list.Count() == 0)
         {
             throw new Exception("本地数据不存在该冷藏载体!");
         }
         _StorageInfo = list[0];
     }
     catch (Exception ex)
     {
         throw new Exception("加载冷藏载体信息失败:" + ex.Message);
     }
 }
Exemplo n.º 3
0
        public UCMain()
        {
            InitializeComponent();
            Common.ValueChangeEvent += new Common.ValueChangeDelegate(Common_ValueChangeEvent);
            AddControlEvent();
            btnNumber.Text      = _numberTitle;
            btnDestination.Text = _destinationTitle;
            btnStorage.Text     = _storageTitle;
            Thread th = new Thread(InitPDALocalInfo);

            th.IsBackground = true;
            th.Start();
            List <ColdStorage> list = StorageServer.GetStorageList(Common._StorageName);

            if (list.Count() > 0)
            {
                btnNodeScan.Enabled = list[0].storageType == 2;
            }
        }