private void InitDictItem()
        {
            this.txtCreateDate.DateTime = DateTime.Now;
            //this.dtStart.DateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
            //this.dtEnd.DateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));

            this.txtManufacture.BindDictItems("供货商");
            this.txtSearchManufacture.BindDictItems("供货商");
            this.txtSearchDept.BindDictItems("部门");

            this.txtWareHouse.Properties.Items.Clear();
            this.txtWareHouse.Properties.Items.AddRange(WareHouseHelper.GetWareHouse(LoginUserInfo.ID, LoginUserInfo.Name).ToArray());
            this.txtWareHouse.SelectedIndex = 0;

            this.txtSearchWareHouse.Properties.Items.Clear();
            this.txtSearchWareHouse.Properties.Items.Add(new CListItem("所有仓库", ""));
            this.txtSearchWareHouse.Properties.Items.AddRange(WareHouseHelper.GetWareHouse(LoginUserInfo.ID, LoginUserInfo.Name).ToArray());
            this.txtSearchWareHouse.SelectedIndex = 0;

            this.txtCreator.Items.Clear();
            this.txtCreator.Items.Add(this.LoginUserInfo.FullName);
            this.txtCreator.SelectedIndex = this.txtCreator.FindString(this.LoginUserInfo.FullName);

            this.txtHandNo.Text = BLLFactory <PurchaseHeader> .Instance.GetHandNumber(true);//进货单号

            this.txtCreateDate.Enabled = false;
        }
Exemple #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string wareHouse = WareHouseHelper.GetWareHouse(LoginUserInfo.ID, LoginUserInfo.Name)[0].Value;

            //低库存预警检查
            bool lowWarning = BLLFactory <Stock> .Instance.CheckStockLowWarning(wareHouse);

            if (lowWarning)
            {
                string message = string.Format("{0} 库存已经处于低库存预警状态\r\n请及时补充库存", wareHouse);
                WareHouseHelper.Notify(string.Format("{0} 低库存预警", wareHouse), message);
            }

            //超库存预警检查
            bool highWarning = BLLFactory <Stock> .Instance.CheckStockHighWarning(wareHouse);

            if (highWarning)
            {
                string message = string.Format("{0} 库存量已经高过超预警库存量\r\n请注意减少库存积压", wareHouse);
                WareHouseHelper.Notify(string.Format("{0} 超库存预警", wareHouse), message);
            }

            if (!lowWarning && !highWarning)
            {
                string message = string.Format("暂无相关的系统提示信息");
                WareHouseHelper.Notify(message, message);
            }
        }
Exemple #3
0
        /// <summary>
        /// 初始化数据字典
        /// </summary>
        private void InitDictItem()
        {
            this.txtManufacture.BindDictItems("供货商");
            this.txtBigType.BindDictItems("备件属类");
            this.txtItemType.BindDictItems("备件类别");
            this.txtUnit.BindDictItems("单位");
            this.txtSource.BindDictItems("来源");
            this.txtUsagePos.BindDictItems("使用位置");
            this.txtUsagePos.SelectedIndex = 0;
            this.txtBelongDept.BindDictItems("部门");

            //其他绑定方式
            this.txtBelongWareHouse.Properties.Items.Clear();
            this.txtBelongWareHouse.Properties.Items.AddRange(WareHouseHelper.GetWareHouse(LoginUserInfo.ID, LoginUserInfo.Name).ToArray());
            this.txtBelongWareHouse.SelectedIndex = 0;
        }
        private void InitWareHouseInfo(TreeNode node)
        {
            List <CListItem> wareHouseList = WareHouseHelper.GetWareHouse(LoginUserInfo.ID, LoginUserInfo.Name);

            foreach (CListItem item in wareHouseList)
            {
                string condition = string.Format(" where t.WareHouse = '{0}' ", item.Value);
                int    count     = BLLFactory <Stock> .Instance.GetCurrentStockReportCount(condition);

                string displayText = string.Format("{0}({1})", item.Value, count);

                TreeNode subNode = new TreeNode(displayText, 1, 1);
                subNode.Tag = new CustomTreeData(CustomTreeType.Ware, item.Value);

                node.Nodes.Add(subNode);
            }
        }
        private void SetColumnAliasForm_Load(object sender, EventArgs e)
        {
            //SetColumnAliasForm form = new SetColumnAliasForm();
            const int heightEvery    = 25; //每行元素的高度
            const int reservedLength = 60; //最后按钮修改预留的高度
            int       elementsHeight = WareHouseDict.Count * heightEvery;

            int newHeight = Size.Height;

            if ((elementsHeight + reservedLength) > Size.Height)
            {
                newHeight = elementsHeight + reservedLength;
            }
            Size = new System.Drawing.Size(Size.Width, newHeight);

            foreach (string key in WareHouseDict.Keys)
            {
                Label lblColumName = new Label();
                lblColumName.Font      = new Font("宋体", 11f, FontStyle.Bold);
                lblColumName.ForeColor = Color.Blue;
                lblColumName.Anchor    = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top)
                                                                                | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
                lblColumName.Text = string.Format("库房编号:{0}", key);

                ComboBox txtWareHouse = new ComboBox();
                txtWareHouse.DropDownStyle = ComboBoxStyle.DropDownList;
                txtWareHouse.Name          = key;
                txtWareHouse.Tag           = key;
                txtWareHouse.Items.Clear();
                txtWareHouse.Items.AddRange(WareHouseHelper.GetWareHouse(LoginUserInfo.ID, LoginUserInfo.Name).ToArray());
                //txtWareHouse.SelectedIndex = 0;

                txtWareHouse.Size   = new System.Drawing.Size(200, 25);
                txtWareHouse.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top)
                                                                             | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));

                tableLayoutPanel1.Controls.Add(lblColumName);
                tableLayoutPanel1.Controls.Add(txtWareHouse);
            }
        }