Ejemplo n.º 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( ));
        }
Ejemplo n.º 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 ( );
 }
Ejemplo n.º 3
0
        void QueryOne(string operate, string orderBy)
        {
            string whereEx = string.Empty;

            if (string.IsNullOrEmpty(strWhere))
            {
                whereEx = "1=1";
            }
            else
            {
                whereEx = strWhere;
            }
            if (_model != null)
            {
                whereEx = whereEx + " AND code " + operate + orderBy;
            }

            _model = _bll.getModel(whereEx);
            if (_model == null)
            {
                MessageBox.Show("已经没有记录了");
                _model = new FishEntity.BatchSheetEntity( );
                return;
            }
            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);
        }
Ejemplo n.º 4
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();
         }
     }
 }