Ejemplo n.º 1
0
        private void btnADD_Click(object sender, EventArgs e)
        {
            HY_BLL.HY_StorageBLL hystor = new HY_StorageBLL();
            string sql = "insert into HY_CPClass(c_Class) values('" + this.c_Class.Text.Trim() + "')";
            int    res = hystor.com_HY_HY_Storagelslist(sql);

            if (res > 0)
            {
                MessageBox.Show("产品类别添加成功,确定后可继续添加!");
                cp_Class();
                this.c_Class.Text = "";//清空输入框
            }
        }
Ejemplo n.º 2
0
        private void btnDEL_Click(object sender, EventArgs e)
        {
            int cid = int.Parse(this.listBoxClass.SelectedValue.ToString());//选择产品类别值

            HY_BLL.HY_StorageBLL hystorbll = new HY_StorageBLL();
            string sql = "delete from HY_CPClass where c_ID='" + cid + "'";
            int    res = hystorbll.com_HY_HY_Storagelslist(sql);

            if (res > 0)
            {
                MessageBox.Show("提示:成功删除产品类别!");
                cp_Class();
            }
        }
Ejemplo n.º 3
0
        //追加补货信息
        private void btnADDOK_Click(object sender, EventArgs e)
        {
            if (this.s_Specifications.Text.Trim() == string.Empty)
            {
                MessageBoxEx.Show("产品规格不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.s_Specifications.Focus();
                return;
            }
            if (this.s_Price.Text.Trim() == string.Empty)
            {
                MessageBoxEx.Show("产品单价不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.s_Price.Focus();
                return;
            }
            if (!IsNumber(this.s_Price.Text.Trim()))
            {
                MessageBoxEx.Show("产品单价只能为数字,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.s_Price.Focus();
                return;
            }
            if (this.s_Amount.Text.Trim() == string.Empty)
            {
                MessageBoxEx.Show("产品数量不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.s_Amount.Focus();
                return;
            }
            if (!IsNumber(this.s_Amount.Text.Trim()))
            {
                MessageBoxEx.Show("产品数量只能为数字,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.s_Amount.Focus();
                return;
            }
            HY_Model.HY_Storage hystormodel = new HY_Model.HY_Storage();
            hystormodel.S_DID            = this.s_DID.Text;
            hystormodel.S_CID            = this.s_CID.Text;
            hystormodel.S_Person         = this.s_Person.Text;
            hystormodel.S_Class          = this.s_Class.Text;
            hystormodel.S_Warehouse      = this.s_Warehouse.Text;
            hystormodel.S_XDate          = Convert.ToDateTime(this.s_XDate.Value);
            hystormodel.S_DDate          = Convert.ToDateTime(this.s_DDate.Value);
            hystormodel.S_PID            = this.s_PID.Text;
            hystormodel.S_Pname          = this.s_Pname.Text.Trim();
            hystormodel.S_Specifications = this.s_Specifications.Text.Trim();
            hystormodel.S_Amount         = int.Parse(this.s_Amount.Text.Trim());
            hystormodel.S_Price          = int.Parse(this.s_Price.Text.Trim());
            hystormodel.S_Notes          = this.s_Notes.Text.Trim();

            string str_DID = this.listView1.SelectedItems[0].SubItems[0].Text;

            HY_BLL.HY_StorageBLL hystorbll = new HY_StorageBLL();
            string sql = "update HY_Storage set s_Amount=s_Amount+'" + hystormodel.S_Amount + "',s_Price='" + hystormodel.S_Price + "' where s_PID='" + str_DID + "'";
            int    res = hystorbll.com_HY_HY_Storagelslist(sql);

            if (res > 0)
            {
                //写入log库存表
                string sqllog = "insert into HY_StorageLog(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Amount,s_Price,s_Notes,s_State) values('" + hystormodel.S_DID + "','" + hystormodel.S_CID + "','" + hystormodel.S_Person + "','" + hystormodel.S_Class + "','" + hystormodel.S_Warehouse + "','" + hystormodel.S_XDate + "','" + hystormodel.S_DDate + "','" + hystormodel.S_PID + "','" + hystormodel.S_Pname + "','" + hystormodel.S_Specifications + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','添加补货')";
                hystorbll.com_HY_HY_Storagelslist(sqllog);

                MessageBoxEx.Show("预警产品追加成功,确认后继续追加!", "操作提示", MessageBoxButtons.OK);
                string sql4 = "select * from HY_Storage order by s_ID desc";
                requistionDate(sql4);
            }
        }