Example #1
0
        public WarehouseReceiptEdit(string text, MulaolaoLibrary.WarehouseReceiptWAREntity _war)
        {
            InitializeComponent( );

            this.Text = text;

            if (this.Text.Equals("编辑"))
            {
                this._war = _war;
            }


            comboBox1.DataSource                  = _bll.GetDataTableOnly("WAR001", "R_PQWAR");
            comboBox1.DisplayMember               = "WAR001";
            comboBox2.DataSource                  = _bll.GetDataTableOnly("WAR004", "R_PQWAR");
            comboBox2.DisplayMember               = "WAR004";
            comboBox3.DataSource                  = _bll.GetDataTableOnly("WAR005", "R_PQWAR");
            comboBox3.DisplayMember               = "WAR005";
            comboBox4.DataSource                  = _bll.GetDataTableOnly("WAR007", "R_PQWAR");
            comboBox4.DisplayMember               = "WAR007";
            comboBox5.DataSource                  = _bll.GetDataTableOnly("WAR010", "R_PQWAR");
            comboBox5.DisplayMember               = "WAR010";
            lookUpEdit12.Properties.DataSource    = _bll.GetDataTablePerson( );
            lookUpEdit12.Properties.DisplayMember = "DBA002";
            lookUpEdit12.Properties.ValueMember   = "DBA001";
            lookUpEdit2.Properties.DataSource     = _bll.GetDataTablePerson( );
            lookUpEdit2.Properties.DisplayMember  = "DBA002";
            lookUpEdit2.Properties.ValueMember    = "DBA001";
        }
Example #2
0
        /// <summary>
        /// 增加入库单记录
        /// </summary>
        /// <param name="_war"></param>
        /// <returns></returns>
        public bool AddS(MulaolaoLibrary.WarehouseReceiptWAREntity _war)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("INSERT INTO R_PQWAR (");
            strSql.Append("WAR001,WAR002,WAR003,WAR004,WAR005,WAR006,WAR007,WAR008,WAR009,WAR010,WAR011,WAR012) ");
            strSql.Append("VALUES (");
            strSql.Append("@WAR001,@WAR002,@WAR003,@WAR004,@WAR005,@WAR006,@WAR007,@WAR008,@WAR009,@WAR010,@WAR011,@WAR012) ");
            SqlParameter [] parameter =
            {
                new SqlParameter("@WAR001", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR002", SqlDbType.Date),
                new SqlParameter("@WAR003", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR004", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR005", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR006", SqlDbType.Decimal,   8),
                new SqlParameter("@WAR007", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR008", SqlDbType.Decimal,  11),
                new SqlParameter("@WAR009", SqlDbType.Decimal,  11),
                new SqlParameter("@WAR010", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR011", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR012", SqlDbType.NVarChar, 50)
            };
            parameter [0].Value  = _war.WAR001;
            parameter [1].Value  = _war.WAR002;
            parameter [2].Value  = _war.WAR003;
            parameter [3].Value  = _war.WAR004;
            parameter [4].Value  = _war.WAR005;
            parameter [5].Value  = _war.WAR006;
            parameter [6].Value  = _war.WAR007;
            parameter [7].Value  = _war.WAR008;
            parameter [8].Value  = _war.WAR009;
            parameter [9].Value  = _war.WAR010;
            parameter [10].Value = _war.WAR011;
            parameter [11].Value = _war.WAR012;

            int row = SqlHelper.ExecuteNonQuery(strSql.ToString( ), parameter);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        public FormWarehouseReceipt( )
        {
            InitializeComponent( );

            GridViewMoHuSelect.SetFilter(gridView1);
            GridViewMoHuSelect.SetFilter(gridView2);
            GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { gridView1, gridView2 });
            MulaolaoBll.UserInfoMation.tableName = this.Name;

            button3.Enabled = button4.Enabled = button5.Enabled = button6.Enabled = /*button7 . Enabled = button8 . Enabled =*/ false;

            _war     = new MulaolaoLibrary.WarehouseReceiptWAREntity( );
            _was     = new MulaolaoLibrary.WarehouseReceiptWASEntity( );
            _bll     = new MulaolaoBll.Bll.WarehouseReceiptBll( );
            tableOne = new DataTable( );
            tableTwo = new DataTable( );

            comboBox1.DataSource                 = _bll.GetDataTableOnly("WAR001", "R_PQWAR");
            comboBox1.DisplayMember              = "WAR001";
            comboBox2.DataSource                 = _bll.GetDataTableOnly("WAR004", "R_PQWAR");
            comboBox2.DisplayMember              = "WAR004";
            comboBox3.DataSource                 = _bll.GetDataTableOnly("WAR005", "R_PQWAR");
            comboBox3.DisplayMember              = "WAR005";
            comboBox4.DataSource                 = _bll.GetDataTableOnly("WAR010", "R_PQWAR");
            comboBox4.DisplayMember              = "WAR010";
            comboBox5.DataSource                 = _bll.GetDataTableOnly("WAR007", "R_PQWAR");
            comboBox5.DisplayMember              = "WAR007";
            lookUpEdit7.Properties.DataSource    = _bll.GetDataTablePerson( );
            lookUpEdit7.Properties.DisplayMember = "DBA002";
            lookUpEdit3.Properties.DataSource    = _bll.GetDataTablePerson( );
            lookUpEdit3.Properties.DisplayMember = "DBA002";

            tableQuery = _bll.GetDataTableOnly("idx,WAR001,WAR003,WAR004,WAR005,WAR007,WAR009,WAR010,WAR011", "R_PQWAR");
            //lookUpEdit14 . Properties . DataSource = tableQuery;
            //lookUpEdit14 . Properties . DisplayMember = "WAR001";
            //lookUpEdit14 . Properties . ValueMember = "idx";
            //lookUpEdit8 . Properties . DataSource = _bll . GetDataTablePerson ( );
            //lookUpEdit8 . Properties . DisplayMember = "DBA002";
        }
Example #4
0
 void getWar( )
 {
     _war = _bll.GetDataTableS(_war.idx);
     if (_war == null)
     {
         return;
     }
     comboBox1.Text = _war.WAR001;
     if (_war.WAR002 != null)
     {
         dateTimePicker1.Value = _war.WAR002;
     }
     lookUpEdit3.Text = _war.WAR003;
     comboBox2.Text   = _war.WAR004;
     comboBox3.Text   = _war.WAR005;
     comboBox4.Text   = _war.WAR010;
     lookUpEdit7.Text = _war.WAR011;
     textBox1.Text    = _war.WAR006.ToString( );
     textBox2.Text    = _war.WAR008.ToString( );
     textBox3.Text    = _war.WAR009.ToString( );
     comboBox5.Text   = _war.WAR007;
     textBox4.Text    = _war.WAR012;
 }
Example #5
0
        public MulaolaoLibrary.WarehouseReceiptWAREntity getModelS(DataRow row)
        {
            MulaolaoLibrary.WarehouseReceiptWAREntity model = new MulaolaoLibrary.WarehouseReceiptWAREntity( );

            if (row != null)
            {
                if (row ["idx"] != null && row ["idx"].ToString( ) != "")
                {
                    model.idx = int.Parse(row ["idx"].ToString( ));
                }
                if (row ["WAR001"] != null && row ["WAR001"].ToString( ) != "")
                {
                    model.WAR001 = row ["WAR001"].ToString( );
                }
                if (row ["WAR002"] != null && row ["WAR002"].ToString( ) != "")
                {
                    model.WAR002 = DateTime.Parse(row ["WAR002"].ToString( ));
                }
                if (row ["WAR003"] != null && row ["WAR003"].ToString( ) != "")
                {
                    model.WAR003 = row ["WAR003"].ToString( );
                }
                if (row ["WAR004"] != null && row ["WAR004"].ToString( ) != "")
                {
                    model.WAR004 = row ["WAR004"].ToString( );
                }
                if (row ["WAR005"] != null && row ["WAR005"].ToString( ) != "")
                {
                    model.WAR005 = row ["WAR005"].ToString( );
                }
                if (row ["WAR006"] != null && row ["WAR006"].ToString( ) != "")
                {
                    model.WAR006 = decimal.Parse(row ["WAR006"].ToString( ));
                }
                if (row ["WAR007"] != null && row ["WAR007"].ToString( ) != "")
                {
                    model.WAR007 = row ["WAR007"].ToString( );
                }
                if (row ["WAR008"] != null && row ["WAR008"].ToString( ) != "")
                {
                    model.WAR008 = decimal.Parse(row ["WAR008"].ToString( ));
                }
                if (row ["WAR009"] != null && row ["WAR009"].ToString( ) != "")
                {
                    model.WAR009 = decimal.Parse(row ["WAR009"].ToString( ));
                }
                if (row ["WAR010"] != null && row ["WAR010"].ToString( ) != "")
                {
                    model.WAR010 = row ["WAR010"].ToString( );
                }
                if (row ["WAR011"] != null && row ["WAR011"].ToString( ) != "")
                {
                    model.WAR011 = row ["WAR011"].ToString( );
                }
                if (row ["WAR012"] != null && row ["WAR012"].ToString( ) != "")
                {
                    model.WAR012 = row ["WAR012"].ToString( );
                }
            }

            return(model);
        }
Example #6
0
        /// <summary>
        /// 编辑入库单记录
        /// </summary>
        /// <param name="_war"></param>
        /// <returns></returns>
        public bool EditS(MulaolaoLibrary.WarehouseReceiptWAREntity _war)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            strSql.Append("UPDATE R_PQWAR SET ");
            strSql.Append("WAR001=@WAR001,");
            strSql.Append("WAR002=@WAR002,");
            strSql.Append("WAR003=@WAR003,");
            strSql.Append("WAR004=@WAR004,");
            strSql.Append("WAR005=@WAR005,");
            strSql.Append("WAR006=@WAR006,");
            strSql.Append("WAR007=@WAR007,");
            strSql.Append("WAR008=@WAR008,");
            strSql.Append("WAR009=@WAR009,");
            strSql.Append("WAR010=@WAR010,");
            strSql.Append("WAR011=@WAR011,");
            strSql.Append("WAR012=@WAR012 ");
            strSql.Append("WHERE idx=@idx");
            SqlParameter [] parameter =
            {
                new SqlParameter("@WAR001", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR002", SqlDbType.Date),
                new SqlParameter("@WAR003", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR004", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR005", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR006", SqlDbType.Decimal,   8),
                new SqlParameter("@WAR007", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR008", SqlDbType.Decimal,  11),
                new SqlParameter("@WAR009", SqlDbType.Decimal,  11),
                new SqlParameter("@WAR010", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR011", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAR012", SqlDbType.NVarChar, 50),
                new SqlParameter("@idx",    SqlDbType.Int)
            };
            parameter [0].Value  = _war.WAR001;
            parameter [1].Value  = _war.WAR002;
            parameter [2].Value  = _war.WAR003;
            parameter [3].Value  = _war.WAR004;
            parameter [4].Value  = _war.WAR005;
            parameter [5].Value  = _war.WAR006;
            parameter [6].Value  = _war.WAR007;
            parameter [7].Value  = _war.WAR008;
            parameter [8].Value  = _war.WAR009;
            parameter [9].Value  = _war.WAR010;
            parameter [10].Value = _war.WAR011;
            parameter [11].Value = _war.WAR012;
            parameter [12].Value = _war.idx;

            SQLString.Add(strSql, parameter);

            strSql = new StringBuilder( );
            strSql.Append("UPDATE R_PQWAS SET ");
            strSql.Append("WAS001=@WAS001,");
            strSql.Append("WAS004=@WAS004,");
            strSql.Append("WAS005=@WAS005 ");
            strSql.Append("WHERE WAS012=@WAS012");
            SqlParameter [] para =
            {
                new SqlParameter("@WAS001", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAS004", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAS005", SqlDbType.NVarChar, 20),
                new SqlParameter("@WAS012", SqlDbType.Int, 4)
            };
            para [0].Value = _war.WAR001;
            para [1].Value = _war.WAR004;
            para [2].Value = _war.WAR005;
            para [3].Value = _war.idx;

            SQLString.Add(strSql, para);

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Example #7
0
 /// <summary>
 /// 编辑入库单记录
 /// </summary>
 /// <param name="_war"></param>
 /// <returns></returns>
 public bool EditS(MulaolaoLibrary.WarehouseReceiptWAREntity _war)
 {
     return(_dao.EditS(_war));
 }
Example #8
0
        //确定
        private void button2_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(comboBox1.Text))
            {
                MessageBox.Show("物料类别不可为空");
                return;
            }
            if (string.IsNullOrEmpty(comboBox2.Text))
            {
                MessageBox.Show("物料名称不可为空");
                return;
            }
            if (string.IsNullOrEmpty(lookUpEdit12.Text))
            {
                MessageBox.Show("申购人不可为空");
                return;
            }
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("入库数量不可为空");
                return;
            }

            _war        = new MulaolaoLibrary.WarehouseReceiptWAREntity( );
            _war.WAR001 = comboBox1.Text;
            _war.WAR004 = comboBox2.Text;
            _war.WAR002 = dateTimePicker1.Value;
            _war.WAR005 = comboBox3.Text;
            _war.WAR003 = lookUpEdit12.Text;
            _war.WAR006 = string.IsNullOrEmpty(textBox1.Text) == true ? 0 : Convert.ToInt32(textBox1.Text);
            _war.WAR007 = comboBox4.Text;
            _war.WAR010 = comboBox5.Text;
            _war.WAR008 = string.IsNullOrEmpty(textBox2.Text) == true ? 0 : Convert.ToDecimal(textBox2.Text);
            _war.WAR009 = string.IsNullOrEmpty(textBox3.Text) == true ? 0 : Convert.ToDecimal(textBox3.Text);
            _war.WAR011 = lookUpEdit2.Text;
            _war.WAR012 = richTextBox1.Text;


            if (this.Text.Equals("新增"))
            {
                result = _bll.AddS(_war);
                if (result == true)
                {
                    MessageBox.Show("新增成功");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("新增失败");
                }
            }
            else
            {
                _war.idx = Convert.ToInt32(comboBox1.Tag);
                result   = _bll.EditS(_war);
                if (result == true)
                {
                    MessageBox.Show("编辑成功");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("编辑失败");
                }
            }
        }