Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            frmTop.FormBorderStyle = FormBorderStyle.None;
            frmTop.WindowState     = FormWindowState.Maximized;
            frmTop.BackColor       = Color.FromArgb(30, 110, 165);
            Label lbl = new Label();

            lbl.AutoSize  = false;
            lbl.ForeColor = Color.White;
            lbl.TextAlign = ContentAlignment.MiddleCenter;
            lbl.Font      = new Font("SimSun", 20);
            lbl.Text      = "正在初始数据……";
            lbl.Dock      = DockStyle.Fill;
            frmTop.Controls.Add(lbl);
            frmTop.Show();
            Application.DoEvents();
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                IBLL.IGoods goodsBLL = new BLL.Goods();
                clsList      = goodsBLL.GetClsList();
                goodsListAll = goodsBLL.GetList("", "");

                foreach (Model.bi_t_item_info item in goodsListAll)
                {
                    if (String.IsNullOrWhiteSpace(item.item_no))
                    {
                        continue;
                    }
                    goodsDic.Add(item.item_no, item);
                }

                foreach (Model.bi_t_item_cls cls in clsList)
                {
                    List <Model.bi_t_item_info> lst = new List <Model.bi_t_item_info>();
                    foreach (Model.bi_t_item_info gd in goodsListAll)
                    {
                        if (gd.item_clsno.Length >= 2 && gd.item_clsno.Substring(0, 2) == cls.item_clsno)
                        {
                            lst.Add(gd);
                        }
                    }

                    clsDic.Add(cls.item_clsno, lst);
                }

                if (clsList.Count != 0)
                {
                    clsDic.TryGetValue(clsList[0].item_clsno, out this.goodsList);
                }

                newOrder("销售退货");
                ShowBottom();
            }
            catch (Exception ex)
            {
                new MsgForm(ex.GetMessage()).ShowDialog();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }