Example #1
0
        bool Save( )
        {
            barCodeDao.Bll.barCodeReportBll   _bll  = new barCodeDao.Bll.barCodeReportBll( );
            barCodeEntity.barCodeReportEntity _mode = new barCodeEntity.barCodeReportEntity( );
            _mode.BAR001 = texProduct.Tag.ToString( ).Trim( );
            _mode.BAR002 = texProduct.Text;
            _mode.BAR003 = texType.Text;
            _mode.BAR004 = texSpec.Text;
            //_mode . BAR005 = texPack . Text;
            _mode.BAR005 = string.Empty;
            _mode.BAR006 = "RHT";
            _mode.BAR007 = comboBox1.Text;
            _mode.BAR012 = "F";
            _mode.BAR013 = "F";
            _mode.BAR008 = "RHT" + comboBox1.Text + "-" + textBox2.Text;
            _mode.BAR018 = textBox2.Text;
            _mode.BAR023 = Convert.ToInt32(textBox1.Text);

            bool result = false;

            if (_mode != null)
            {
                result = _bll.Save(_mode, Convert.ToInt64(textBox1.Text), textBox2.Text);
            }

            return(result);
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int x = 0;

            if (!string.IsNullOrEmpty(textBox5.Text) && int.TryParse(textBox5.Text, out x) == false)
            {
                errorProvider1.SetError(textBox5, "数量必须是整数");
                return;
            }
            x = 0;
            if (!string.IsNullOrEmpty(textBox4.Text) && int.TryParse(textBox4.Text, out x) == false)
            {
                errorProvider1.SetError(textBox4, "数量必须是整数");
                return;
            }

            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );

            bool result = _bll.Edit(id, richTextBox1.Text, textBox1.Text, cmbSao.Text, textBox4.Text, textBox5.Text, dtTime.Text, richBatch.Text);

            if (result == true)
            {
                MessageBox.Show("编辑成功");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                MessageBox.Show("编辑失败,请重试");
            }
        }
Example #3
0
        void getDataTable( )
        {
            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
            DataTable de = _bll.GetDataTablePrint(textBox2.Text, Convert.ToInt32(textBox1.Text));

            de.TableName = "Code";
            RDataSet.Tables.Add(de);
        }
Example #4
0
        public FormLibrary(List <int> idxList, DataTable table)
        {
            InitializeComponent( );
            _idxList   = idxList;
            this.table = table;

            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
            comboBox1.DataSource    = _bll.GetDataTableLaa( );
            comboBox1.DisplayMember = "LAA002";
            comboBox1.ValueMember   = "LAA001";
        }
Example #5
0
        public CheckProduct( )
        {
            InitializeComponent( );

            Utility.GridViewMoHuSelect.SetFilter(gridView1);
            FieldInfo fi = typeof(XPaint).GetField("graphics", BindingFlags.Static | BindingFlags.NonPublic);

            fi.SetValue(null, new DrawXPaint( ));

            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
            gridControl1.DataSource = _bll.GetDataTableOf( );
        }
Example #6
0
        public FormPrintBarCode( )
        {
            InitializeComponent( );

            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );

            DateTime dtOne = _bll.GetTime( );

            textBox3.Text = (Convert.ToInt32(dtOne.Year.ToString( ).Substring(2, 2)) + 50).ToString( ) + (dtOne.Month + 50).ToString( ) + (dtOne.Day).ToString( ).PadLeft(2, '0');
            //BarCodeUtility . GetDataSource ( comboBox4 ,"BAR006" );
            BarCodeUtility.GetDataSource(comboBox1, "BAR007");
            textBox1.Text = "1";
        }
Example #7
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear( );
            bool isOk = true;

            if (string.IsNullOrEmpty(comboBox1.Text))
            {
                errorProvider1.SetError(comboBox1, "请选择入库标记");
                isOk = false;
            }
            if (string.IsNullOrEmpty(comboBox2.Text))
            {
                errorProvider1.SetError(comboBox2, "请选择出库标记");
                isOk = false;
            }
            if (isOk == false)
            {
                return;
            }
            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
            string idxLi = "";

            foreach (int str in idxList)
            {
                if (idxLi == "")
                {
                    idxLi = str.ToString( );
                }
                else
                {
                    idxLi = idxLi + "," + str.ToString( );
                }
            }
            bool result = _bll.BatchEdit(idxLi, comboBox1.Text, comboBox2.Text);

            if (result == true)
            {
                MessageBox.Show("编辑成功");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                MessageBox.Show("编辑失败,请重试");
            }
        }
Example #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            int x = 0;

            if (!string.IsNullOrEmpty(textBox5.Text) && int.TryParse(textBox5.Text, out x) == false)
            {
                errorProvider1.SetError(textBox5, "数量必须是整数");
                return;
            }
            _model.BAR020 = x;
            x             = 0;
            if (!string.IsNullOrEmpty(textBox4.Text) && int.TryParse(textBox4.Text, out x) == false)
            {
                errorProvider1.SetError(textBox4, "数量必须是整数");
                return;
            }
            _model.BAR019 = x;
            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );

            _model.idx    = id;
            _model.BAR017 = richTextBox1.Text;
            _model.BAR009 = textBox1.Text;
            _model.BAR016 = cmbSao.Text;
            if (string.IsNullOrEmpty(dtTime.Text))
            {
                _model.BAR024 = null;
            }
            else
            {
                _model.BAR024 = Convert.ToDateTime(dtTime.Text);
            }
            _model.BAR025 = richBatch.Text;
            bool result = _bll.Edit(_model);

            if (result == true)
            {
                MessageBox.Show("编辑成功");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                MessageBox.Show("编辑失败,请重试");
            }
        }
Example #9
0
        void numOf( )
        {
            barCodeDao.Bll.barCodeReportBll   _bll  = new barCodeDao.Bll.barCodeReportBll( );
            barCodeEntity.barCodeReportEntity _mode = new barCodeEntity.barCodeReportEntity( );
            _mode.BAR007 = comboBox1.Text;
            DateTime dt = _bll.GetTime( );
            string   x  = string.Empty;

            x = texProduct.Tag.ToString( ).Substring(texProduct.Tag.ToString( ).Length - 4);
            x = x + " ";
            foreach (char c in _mode.BAR007)
            {
                if (c >= 48 && c <= 57)
                {
                    x = x + c.ToString( );
                }
                else if (c.ToString( ).Equals("-"))
                {
                    x = x + " " + 0.ToString( );
                }
                else if (c >= 65 && c <= 90)
                {
                    x = x + (( int )c).ToString( );
                }
            }
            _mode.BAR004 = texSpec.Text;
            string [] str = _mode.BAR004.Split('*');
            if (str.Length > 2)
            {
                x = x + " ";
                for (int i = 0; i < 2; i++)
                {
                    foreach (char c in str[i])
                    {
                        if (c >= 48 && c <= 57)
                        {
                            x = x + c.ToString( );
                        }
                    }
                }
            }
            textBox2.Text = x;
        }
Example #10
0
        protected override int Query( )
        {
            string strWhere = "1=1";

            barCodeEntity.barCodeReportEntity _model = new barCodeEntity.barCodeReportEntity( );
            if (!string.IsNullOrEmpty(texbar001.Text))
            {
                _model.BAR001 = texbar001.Text;
                strWhere     += " AND BAR001='" + _model.BAR001 + "'";
            }
            if (!string.IsNullOrEmpty(texbar002.Text))
            {
                _model.BAR002 = texbar002.Text;
                strWhere     += " AND BAR002='" + _model.BAR002 + "'";
            }
            if (!string.IsNullOrEmpty(combar009.Text))
            {
                _model.BAR009 = combar009.Text;
                strWhere     += " AND BAR009='" + _model.BAR009 + "'";
            }
            if (!string.IsNullOrEmpty(combar010.Text))
            {
                _model.BAR010 = combar010.Text;
                strWhere     += " AND BAR010='" + _model.BAR010 + "'";
            }
            if (!string.IsNullOrEmpty(combar011.Text))
            {
                _model.BAR011 = combar011.Text;
                strWhere     += " AND BAR011='" + _model.BAR011 + "'";
            }

            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
            tableQuery = _bll.GetDataTable(strWhere);
            tableQuery.Columns.Add("check", typeof(System.Boolean));
            gridControl1.DataSource = tableQuery;
            idxList.Clear( );
            DataTable countDt = _bll.GetDataTableCount(strWhere);

            assignMent(countDt);

            BAR002.SummaryItem.SetSummary(DevExpress.Data.SummaryItemType.Custom, "选中:" + 0.ToString( ));
            return(0);
        }
Example #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear( );
            if (string.IsNullOrEmpty(comboBox1.Text))
            {
                errorProvider1.SetError(comboBox1, "请选择单据类型");
                return;
            }
            if (comboBox1.SelectedValue.ToString( ).Trim( ) != "002")
            {
                errorProvider1.SetError(comboBox1, "请选择入库,否则不予生成入库单");
                return;
            }
            //int x = 0;
            //if ( string . IsNullOrEmpty ( texbar002 . Text . Trim ( ) ) )
            //{
            //    errorProvider1 . SetError ( texbar002 ,"请填写入库数量" );
            //    return;
            //}
            //if ( int . TryParse ( texbar002 . Text ,out x ) == false )
            //{
            //    errorProvider1 . SetError ( texbar002 ,"入库数量必须为整数" );
            //    return;
            //}

            barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
            bool result = _bll.InsertToLibrary(_idxList, comboBox1.SelectedValue.ToString( ), this.table);

            if (result == true)
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                MessageBox.Show("入库失败,请重试");
            }
        }
Example #12
0
        protected override int Delete( )
        {
            if (idxList.Count < 1)
            {
                MessageBox.Show("请选择需要删除的记录");
                return(0);
            }

            if (MessageBox.Show("删除记录!", "确定删除选中的记录?", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                barCodeDao.Bll.barCodeReportBll _bll = new barCodeDao.Bll.barCodeReportBll( );
                string idxAll = "";
                foreach (int id in idxList)
                {
                    if (idxAll == "")
                    {
                        idxAll = id.ToString( );
                    }
                    else
                    {
                        idxAll = idxAll + "," + id.ToString( );
                    }
                }
                if (_bll.Delete(idxAll))
                {
                    MessageBox.Show("成功删除");
                    Query( );
                }
                else
                {
                    MessageBox.Show("删除失败,请重试");
                }
            }

            return(0);
        }