Beispiel #1
0
        public FormBatchSheetQuery(string text)
        {
            InitializeComponent( );

            this.Text = text;
            _bll      = new FishBll.Bll.BatchSheetBll( );
        }
Beispiel #2
0
 public FormBatchSheet( )
 {
     InitializeComponent( );
     ReadColumnConfig(dataGridView1, "Set_101");
     ReadColumnConfig(dataGridView2, "Set_102");
     MenuCode = "M459"; ControlButtomRoles();
     _bll     = new FishBll.Bll.BatchSheetBll( );
     _model   = new FishEntity.BatchSheetEntity( );
     _models  = new FishEntity.BatchSheetsEntity( );
     //readonlyCol ( );
 }
 public override int Query()
 {
     _bll = new FishBll.Bll.BatchSheetBll();
     if (name != "" && name != null)
     {
         strWhere += " 1= 1 and codeNum='" + name + "' ";
         DataTable table = _bll.getTable(strWhere);
         strWhere = string.Empty;
         if (table != null && table.Rows.Count > 0)
         {
             dataGridView1.Rows.Clear();
             for (int i = 0; i < table.Rows.Count; i++)
             {
                 int             idx = dataGridView1.Rows.Add();
                 DataGridViewRow row = dataGridView1.Rows[idx];
                 row.Cells["id"].Value              = table.Rows[i]["id"].ToString();
                 row.Cells["id1"].Value             = table.Rows[i]["id1"].ToString();
                 row.Cells["CODE"].Value            = table.Rows[i]["CODE"].ToString();
                 row.Cells["productionDate"].Value  = table.Rows[i]["productionDate"].ToString();
                 row.Cells["fishId"].Value          = table.Rows[i]["fishId"].ToString();
                 row.Cells["codeNum"].Value         = table.Rows[i]["codeNum"].ToString();
                 row.Cells["codeNumContract"].Value = table.Rows[i]["codeNumContract"].ToString();
                 row.Cells["qualitySpe"].Value      = table.Rows[i]["qualitySpe"].ToString();
                 row.Cells["country"].Value         = table.Rows[i]["country"].ToString();
                 row.Cells["brand"].Value           = table.Rows[i]["brand"].ToString();
                 row.Cells["goods"].Value           = table.Rows[i]["goods"].ToString();
                 row.Cells["tons"].Value            = table.Rows[i]["tons"].ToString();
                 row.Cells["protein"].Value         = table.Rows[i]["protein"].ToString();
                 row.Cells["tvn"].Value             = table.Rows[i]["tvn"].ToString();
                 row.Cells["salt"].Value            = table.Rows[i]["salt"].ToString();
                 row.Cells["acid"].Value            = table.Rows[i]["acid"].ToString();
                 row.Cells["ash"].Value             = table.Rows[i]["ash"].ToString();
                 row.Cells["histamine"].Value       = table.Rows[i]["histamine"].ToString();
                 row.Cells["das"].Value             = table.Rows[i]["das"].ToString();
                 row.Cells["price"].Value           = table.Rows[i]["price"].ToString();
                 row.Cells["cost"].Value            = table.Rows[i]["cost"].ToString();
                 row.Cells["rkCode"].Value          = table.Rows[i]["rkCode"].ToString();
             }
         }
         else
         {
             MessageBox.Show("查无数据!");
         }
     }
     else
     {
         MessageBox.Show("采购编号没有带入!");
     }
     return(base.Query());
 }
Beispiel #4
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     if (dataGridView1.CurrentRow == null)
     {
         return;
     }
     if (dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString() != null)
     {
         getcode = " isSum = 0 and a.code=" + dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString();
         _bll    = new FishBll.Bll.BatchSheetBll();
         DataTable table = _bll.getTable(getcode);
         strWhere = string.Empty;
         if (table != null && table.Rows.Count > 0)
         {
             dataGridView2.Rows.Clear();
             for (int i = 0; i < table.Rows.Count; i++)
             {
                 int             idx = dataGridView2.Rows.Add();
                 DataGridViewRow row = dataGridView2.Rows[idx];
                 row.Cells["id2"].Value              = table.Rows[i]["id"].ToString();
                 row.Cells["id12"].Value             = table.Rows[i]["id1"].ToString();
                 row.Cells["CODE2"].Value            = table.Rows[i]["CODE"].ToString();
                 row.Cells["productionDate2"].Value  = table.Rows[i]["productionDate"].ToString();
                 row.Cells["fishId2"].Value          = table.Rows[i]["fishId"].ToString();
                 row.Cells["codeNum2"].Value         = table.Rows[i]["codeNum"].ToString();
                 row.Cells["codeNumContract2"].Value = table.Rows[i]["codeNumContract"].ToString();
                 row.Cells["qualitySpe2"].Value      = table.Rows[i]["qualitySpe"].ToString();
                 row.Cells["country2"].Value         = table.Rows[i]["country"].ToString();
                 row.Cells["brand2"].Value           = table.Rows[i]["brand"].ToString();
                 row.Cells["goods2"].Value           = table.Rows[i]["goods"].ToString();
                 row.Cells["tons2"].Value            = table.Rows[i]["tons"].ToString();
                 row.Cells["protein2"].Value         = table.Rows[i]["protein"].ToString();
                 row.Cells["tvn2"].Value             = table.Rows[i]["tvn"].ToString();
                 row.Cells["salt2"].Value            = table.Rows[i]["salt"].ToString();
                 row.Cells["acid2"].Value            = table.Rows[i]["acid"].ToString();
                 row.Cells["ash2"].Value             = table.Rows[i]["ash"].ToString();
                 row.Cells["histamine2"].Value       = table.Rows[i]["histamine"].ToString();
                 row.Cells["das2"].Value             = table.Rows[i]["das"].ToString();
                 row.Cells["price2"].Value           = table.Rows[i]["price"].ToString();
                 row.Cells["cost2"].Value            = table.Rows[i]["cost"].ToString();
                 row.Cells["rkCode2"].Value          = table.Rows[i]["rkCode"].ToString();
             }
         }
     }
 }
Beispiel #5
0
        //fishid
        public string fishid()
        {
            _models = new FishEntity.BatchSheetsEntity();
            FishBll.Bll.BatchSheetBll bll = new FishBll.Bll.BatchSheetBll();
            _models.fishId = bll.fishid();
            string str = string.Empty;
            int    sum = 0;

            if (_models.fishId == string.Empty)
            {
                str = "CP" + "10000001";
            }
            else
            {
                sum = int.Parse(_models.fishId) + 1;
                str = "CP" + sum;
            }
            return(str);
        }
Beispiel #6
0
 public FormBatchSheet(string code)
 {
     InitializeComponent();
     ReadColumnConfig(dataGridView1, "Set_101");
     ReadColumnConfig(dataGridView2, "Set_102");
     MenuCode = "M459"; ControlButtomRoles();
     _bll     = new FishBll.Bll.BatchSheetBll();
     _model   = new FishEntity.BatchSheetEntity();
     _models  = new FishEntity.BatchSheetsEntity();
     readonlyCol();
     if (code != null && code != "")
     {
         _model = _bll.getModel(" code='" + code + "' ");
         code   = string.Empty;
         if (_model != null)
         {
             txtCode.Text = _model.code;
             if (_model.productionDate < DateTime.MaxValue && _model.productionDate > DateTime.MinValue)
             {
                 datePro.Value = Convert.ToDateTime(_model.productionDate);
             }
             if (string.IsNullOrEmpty(_model.code))
             {
                 return;
             }
             List <FishEntity.BatchSheetsEntity> modelList = _bll.modelList(_model.code);
             if (modelList == null || modelList.Count < 0)
             {
                 return;
             }
             setValue(modelList);
         }
         else
         {
             _model = new FishEntity.BatchSheetEntity();
         }
     }
 }
Beispiel #7
0
        public string Numbering()
        {
            _models = new FishEntity.BatchSheetsEntity();
            FishBll.Bll.BatchSheetBll bll = new FishBll.Bll.BatchSheetBll();
            _models.codeNum = bll.Numbering();
            string str = string.Empty;
            int    sum = 0;

            if (_models.codeNum == string.Empty)
            {
                str = DateTime.Now.Year.ToString() + "P" + "0001001";
            }
            else
            {
                sum             = int.Parse(_models.codeNum) + 1000;
                _models.codeNum = sum.ToString();
                while (_models.codeNum.Length != 7)
                {
                    _models.codeNum = "0" + _models.codeNum;
                }
                str = DateTime.Now.Year.ToString() + "P" + _models.codeNum;
            }
            return(str);
        }