예제 #1
0
        public override int Query( )
        {
            FormBatchSheetQuery form = new FormBatchSheetQuery(this.Text + "查询");

            if (form.ShowDialog( ) == DialogResult.OK)
            {
                strWhere = form.getWhere;
                _model   = _bll.getModel(strWhere);
                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(0);
                    }
                    List <FishEntity.BatchSheetsEntity> modelList = _bll.modelList(_model.code);
                    if (modelList == null || modelList.Count < 0)
                    {
                        return(0);
                    }
                    readonlyCol();
                    setValue(modelList);
                }
                else
                {
                    _model = new FishEntity.BatchSheetEntity( );
                }
            }

            return(base.Query( ));
        }
예제 #2
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();
         }
     }
 }