//追加补货信息
        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);
            }
        }
Example #2
0
        private void toolStripSave_Click(object sender, EventArgs e)
        {
            if (this.s_Person.Text == string.Empty)
            {
                MessageBoxEx.Show("入库人姓名不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_Person.Focus();
                return;
            }
            if (this.s_CID.Text == string.Empty)
            {
                MessageBoxEx.Show("厂内编号不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_CID.Focus();
                return;
            }
            if (this.s_Supplier.Text == string.Empty)
            {
                MessageBoxEx.Show("供应商名称不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_Supplier.Focus();
                return;
            }
            if (this.s_DDate.Text == "")
            {
                MessageBoxEx.Show("到货日期不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_DDate.Focus();
                return;
            }
            if (this.s_XDate.Text == "")
            {
                MessageBoxEx.Show("入库日期不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_XDate.Focus();
                return;
            }
            if (this.s_Price.Text == string.Empty)
            {
                MessageBoxEx.Show("产品单价不能为空", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_Price.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.Trim();
            hystormodel.S_Person         = this.s_Person.Text.Trim();
            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_Units          = this.s_Units.Text.Trim();
            hystormodel.S_Amount         = int.Parse(this.s_Amount.Text.Trim());
            hystormodel.S_Price          = float.Parse(this.s_Price.Text.Trim());
            hystormodel.S_Notes          = this.s_Notes.Text.Trim();
            hystormodel.S_Origin         = this.s_Origin.Text.Trim();
            hystormodel.S_Supplier       = this.s_Supplier.Text.Trim();

            if (intFalg == 1)
            {
                string sql = "insert into HY_Storage(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Units,s_Amount,s_Price,s_Notes,s_Origin,s_Supplier) 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_Units + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','" + hystormodel.S_Origin + "','" + hystormodel.S_Supplier + "')";
                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_Units,s_Amount,s_Price,s_Notes,s_Origin,s_Supplier) 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_Units + "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','" + hystormodel.S_Origin + "','" + hystormodel.S_Supplier + "')";
                    hystorbll.com_HY_HY_Storagelslist(sqllog);

                    MessageBoxEx.Show("产品入库成功,确定后可继续添加", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    requistionDate();
                    f_PID(); //品号
                    f_CID(); //单号
                    this.s_CID.Focus();
                    this.s_CID.Text            = "";
                    this.s_Person.Text         = "";
                    this.s_Class.Text          = "";
                    this.s_Warehouse.Text      = "";
                    this.s_Pname.Text          = "";
                    this.s_Specifications.Text = "";
                    this.s_Amount.Text         = "";
                    this.s_Price.Text          = "";
                    this.s_Notes.Text          = "";
                }
            }
            if (intFalg == 2)
            {
                string sql = "Update HY_Storage set s_DID='" + hystormodel.S_DID + "',s_CID='" + hystormodel.S_CID + "',s_Person='" + hystormodel.S_Person + "',s_Class='" + hystormodel.S_Class + "',s_Warehouse='" + hystormodel.S_Warehouse + "',s_XDate='" + Convert.ToDateTime(this.s_XDate.Value) + "',s_DDate='" + Convert.ToDateTime(this.s_DDate.Value) + "',s_Pname='" + hystormodel.S_Pname + "',s_Specifications='" + hystormodel.S_Specifications + "',s_Amount='" + hystormodel.S_Amount + "',s_Price='" + hystormodel.S_Price + "',s_Notes='" + hystormodel.S_Notes + "' where s_PID='" + hystormodel.S_PID + "'";
                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) 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, MessageBoxIcon.None);
                    f_Back();
                    requistionDate();
                    this.s_CID.Text            = "";
                    this.s_Person.Text         = "";
                    this.s_Class.Text          = "";
                    this.s_Warehouse.Text      = "";
                    this.s_Pname.Text          = "";
                    this.s_Specifications.Text = "";
                    this.s_Amount.Text         = "";
                    this.s_Price.Text          = "";
                    this.s_Notes.Text          = "";
                    this.groupBox1.Enabled     = false;
                    this.groupBox2.Enabled     = false;
                    this.groupBox3.Enabled     = true;
                }
            }
        }
Example #3
0
        private void toolStripSave_Click(object sender, EventArgs e)
        {
            if (this.s_Person.Text == string.Empty)
            {
                MessageBoxEx.Show("入库人姓名不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_Person.Focus();
                return;
            }
            if (this.s_CID.Text == string.Empty)
            {
                MessageBoxEx.Show("厂内编号不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_CID.Focus();
                return;
            }
            if (this.s_Supplier.Text == string.Empty)
            {
                MessageBoxEx.Show("供应商名称不能为空,请正确填写", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_Supplier.Focus();
                return;
            }
            if (this.s_DDate.Text == "")
            {
                MessageBoxEx.Show("到货日期不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_DDate.Focus();
                return;
            }
            if (this.s_XDate.Text == "")
            {
                MessageBoxEx.Show("入库日期不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_XDate.Focus();
                return;
            }
            if (this.s_Price.Text == string.Empty)
            {
                MessageBoxEx.Show("产品单价不能为空", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.s_Price.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.Trim();
            hystormodel.S_Person = this.s_Person.Text.Trim();
            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_Units = this.s_Units.Text.Trim();
            hystormodel.S_Amount = int.Parse(this.s_Amount.Text.Trim());
            hystormodel.S_Price = float.Parse(this.s_Price.Text.Trim());
            hystormodel.S_Notes = this.s_Notes.Text.Trim();
            hystormodel.S_Origin = this.s_Origin.Text.Trim();
            hystormodel.S_Supplier = this.s_Supplier.Text.Trim();

            if (intFalg == 1)
            {
                string sql = "insert into HY_Storage(s_DID,s_CID,s_Person,s_Class,s_Warehouse,s_XDate,s_DDate,s_PID,s_Pname,s_Specifications,s_Units,s_Amount,s_Price,s_Notes,s_Origin,s_Supplier) 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_Units+ "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','" + hystormodel.S_Origin + "','" + hystormodel.S_Supplier + "')";
                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_Units,s_Amount,s_Price,s_Notes,s_Origin,s_Supplier) 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_Units+ "','" + hystormodel.S_Amount + "','" + hystormodel.S_Price + "','" + hystormodel.S_Notes + "','" + hystormodel.S_Origin + "','" + hystormodel.S_Supplier + "')";
                    hystorbll.com_HY_HY_Storagelslist(sqllog);

                    MessageBoxEx.Show("产品入库成功,确定后可继续添加", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    requistionDate();
                    f_PID();//品号
                    f_CID();//单号
                    this.s_CID.Focus();
                    this.s_CID.Text = "";
                    this.s_Person.Text = "";
                    this.s_Class.Text = "";
                    this.s_Warehouse.Text = "";
                    this.s_Pname.Text = "";
                    this.s_Specifications.Text = "";
                    this.s_Amount.Text = "";
                    this.s_Price.Text = "";
                    this.s_Notes.Text = "";

                }
            }
            if (intFalg == 2)
            {
                string sql = "Update HY_Storage set s_DID='" + hystormodel.S_DID + "',s_CID='" + hystormodel.S_CID + "',s_Person='" + hystormodel.S_Person + "',s_Class='" + hystormodel.S_Class + "',s_Warehouse='" + hystormodel.S_Warehouse + "',s_XDate='" + Convert.ToDateTime(this.s_XDate.Value) + "',s_DDate='" + Convert.ToDateTime(this.s_DDate.Value) + "',s_Pname='" + hystormodel.S_Pname + "',s_Specifications='" + hystormodel.S_Specifications + "',s_Amount='" + hystormodel.S_Amount + "',s_Price='" + hystormodel.S_Price + "',s_Notes='" + hystormodel.S_Notes + "' where s_PID='" + hystormodel.S_PID + "'";
                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) 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, MessageBoxIcon.None);
                    f_Back();
                    requistionDate();
                    this.s_CID.Text = "";
                    this.s_Person.Text = "";
                    this.s_Class.Text = "";
                    this.s_Warehouse.Text = "";
                    this.s_Pname.Text = "";
                    this.s_Specifications.Text = "";
                    this.s_Amount.Text = "";
                    this.s_Price.Text = "";
                    this.s_Notes.Text = "";
                    this.groupBox1.Enabled = false;
                    this.groupBox2.Enabled = false;
                    this.groupBox3.Enabled = true;

                }

            }
        }
Example #4
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);
            }
        }