Exemplo n.º 1
0
 FishEntity.PicInfoAll getPic(DataRow row)
 {
     FishEntity.PicInfoAll model = new FishEntity.PicInfoAll( );
     if (row != null)
     {
         if (row ["id"] != null && row ["id"].ToString( ) != "")
         {
             model.id = int.Parse(row ["id"].ToString( ));
         }
         if (row ["tableId"] != null && row ["tableId"].ToString( ) != "")
         {
             model.tableId = int.Parse(row ["tableId"].ToString( ));
         }
         if (row ["tableName"] != null)
         {
             model.tableName = row ["tableName"].ToString( );
         }
         if (row ["picInfo"] != null && row ["picInfo"].ToString( ) != "")
         {
             model.picInfo = ( byte [] )row ["picInfo"];
         }
         else
         {
             model.picInfo = new byte [0];
         }
     }
     return(model);
 }
Exemplo n.º 2
0
        public override int Query( )
        {
            UIForms.PurchaseApplicationCondition form = new UIForms.PurchaseApplicationCondition(this.Text + "查询");
            if (form.ShowDialog( ) == DialogResult.OK)
            {
                strWhere = form.getStrWhere;
                _model   = _bll.getModel(strWhere);
                if (_model == null)
                {
                    MessageBox.Show("请重新查询");
                    return(0);
                }
                panel1.Enabled = true;
                setValue(_model);
                dicPic = _bll.getImages(_model.id, this.Name);
                if (dicPic != null && dicPic.Count > 0)
                {
                    _pic      = dicPic [0];
                    pic.Image = PictureOpreation.ReadPicture(_pic.picInfo);
                    pic.Tag   = 0;
                    num++;
                }
                //FishBll . Bll . PurchaseApplicationBll bll = new FishBll . Bll . PurchaseApplicationBll ( );
                //List<FishEntity . PurchaseOtherInfo> listOtherInfo = bll . getOtherInfoList ( _model . codeNum );
                //if ( listOtherInfo != null && listOtherInfo . Count > 0 )
                //    setValue ( listOtherInfo );
                //List<FishEntity . PurchaseContractFishInfo> listFishInfo = _bll . getFishInfoList ( _model . codeNum );
                //if ( listFishInfo != null && listFishInfo . Count > 0 )
                //    setValue ( listFishInfo );
            }

            return(base.Query( ));
        }
Exemplo n.º 3
0
        public FormPurcurementContract( )
        {
            InitializeComponent( );

            //InitDataUtil.BindComboBoxData(txtproName, FishEntity.Constant.Goods, true);
            _model = new FishEntity.PurcurementContractEntity( );
            _bll   = new FishBll.Bll.PurcurementContractBll( );
            _pic   = new FishEntity.PicInfoAll( );
            dicPic = new Dictionary <int, FishEntity.PicInfoAll> ( );
            AddShuiYin.SetWatermark(txtconProtein, "请选取指标或者填写");
        }
Exemplo n.º 4
0
 public FormWarehouseReceipt(string name)
 {
     InitializeComponent();
     getname = name;
     _model  = new FishEntity.WarehouseReceiptEntity();
     _bll    = new FishBll.Bll.WarehouseReceiptBll();
     _pic    = new FishEntity.PicInfoAll();
     InitDataUtil.BindComboBoxData(cmbStartingCountry, FishEntity.Constant.CountryType, true);
     InitDataUtil.BindComboBoxData(cmbDestinationCountry, FishEntity.Constant.CountryType, true);
     InitDataUtil.BindComboBoxData(cmbcountryOfOrigin, FishEntity.Constant.CountryType, true);
     InitDataUtil.BindComboBoxData(txtcommodityTons, FishEntity.Constant.Goods, true);
     InitDataUtil.BindComboBoxData(txtProductionProcess, FishEntity.Constant.TechClass, true);
 }
Exemplo n.º 5
0
 private void btnPrevious_Click(object sender, EventArgs e)
 {
     if (dicPic.Count > 0)
     {
         for (int i = 1; i <= dicPic.Count; i++)
         {
             if (dicPic.ContainsKey(Convert.ToInt32(this.pic.Tag) - i))
             {
                 _pic           = dicPic[Convert.ToInt32(this.pic.Tag) - i];
                 this.pic.Image = PictureOpreation.ReadPicture(_pic.picInfo);
                 this.pic.Tag   = Convert.ToInt32(this.pic.Tag) - i;
                 break;
             }
         }
     }
 }
Exemplo n.º 6
0
 private void btnPreview_Click(object sender, EventArgs e)
 {
     if (dicPic == null)
     {
         dicPic = new Dictionary <int, FishEntity.PicInfoAll> ( );
     }
     num++;
     _pic         = new FishEntity.PicInfoAll( );
     _pic.picInfo = PictureOpreation.ReadPicture(pic);
     if (_pic.picInfo.Length == 0)//是否有图片
     {
         return;
     }
     _pic.tableName = this.Name;
     dicPic.Add(num, _pic);
     pic.Tag = num;
 }
Exemplo n.º 7
0
        //void saveFishOtherInfo ( )
        //{
        //    dataGridView1 . EndEdit ( );
        //    List<FishEntity . PurchaseContractFishInfo> listFishInfo = new List<FishEntity . PurchaseContractFishInfo> ( );
        //    foreach ( DataGridViewRow row in dataGridView1 . Rows )
        //    {
        //        if ( row . IsNewRow )
        //            continue;
        //        _fishInfo = new FishEntity . PurchaseContractFishInfo ( );
        //        _fishInfo . code = _model . codeNum;
        //        _fishInfo . fishId = row . Cells [ "fishId" ] . Value . ToString ( );
        //        decimal outResult = 0;
        //        if ( row . Cells [ "price" ] . Value != null )
        //        {
        //            decimal . TryParse ( row . Cells [ "price" ] . Value . ToString ( ) ,out outResult );
        //        }
        //        _fishInfo . price = outResult;
        //        outResult = 0;
        //        if ( row . Cells [ "weight" ] . Value != null )
        //        {
        //            decimal . TryParse ( row . Cells [ "weight" ] . Value . ToString ( ) ,out outResult );
        //        }
        //        _fishInfo . weight = outResult;
        //        outResult = 0;
        //        if ( row . Cells [ "priceUSA" ] . Value != null )
        //        {
        //            decimal . TryParse ( row . Cells [ "priceUSA" ] . Value . ToString ( ) ,out outResult );
        //        }
        //        _fishInfo . priceUSA = outResult;
        //        _fishInfo . specifications = row . Cells [ "specifications" ] . Value . ToString ( );
        //        _fishInfo . brand = row . Cells [ "brand" ] . Value . ToString ( );
        //        _fishInfo . country = row . Cells [ "country" ] . Value . ToString ( );
        //        _fishInfo . shipName = row . Cells [ "shipName" ] . Value . ToString ( );
        //        _fishInfo . billName = row . Cells [ "billName" ] . Value . ToString ( );
        //        listFishInfo . Add ( _fishInfo );
        //    }

        //    bool result = false;
        //    if ( listFishInfo != null && listFishInfo . Count > 0 )
        //    {
        //        result = _bll . SaveFishInfo ( listFishInfo );
        //        if ( result == false )
        //            MessageBox . Show ( "鱼粉资料保存失败,请重试" );
        //    }
        //}
        void QueryOne(string operate, string orderBy)
        {
            string whereEx = string.Empty;

            if (string.IsNullOrEmpty(strWhere))
            {
                whereEx = "1=1";
            }
            else
            {
                whereEx = strWhere;
            }
            if (_model != null)
            {
                if (operate != null && operate != "" && orderBy != "" && orderBy != null)
                {
                    whereEx = whereEx + " AND codeNum " + operate + orderBy;
                }
            }
            _model = _bll.getModel(whereEx);
            if (_model == null)
            {
                //MessageBox . Show ( "已经没有记录了" );
                return;
            }
            setValue(_model);
            panel1.Enabled = true;
            dicPic         = new Dictionary <int, FishEntity.PicInfoAll>();
            dicPic         = _bll.getImages(_model.id, this.Name);
            if (dicPic != null)//dicPic.Count
            {
                _pic      = dicPic [0];
                pic.Image = PictureOpreation.ReadPicture(_pic.picInfo);
                pic.Tag   = 0;
            }
            //FishBll . Bll . PurchaseApplicationBll bll = new FishBll . Bll . PurchaseApplicationBll ( );
            //List<FishEntity . PurchaseOtherInfo> listOtherInfo = bll . getOtherInfoList ( _model . codeNum );
            //if ( listOtherInfo != null && listOtherInfo . Count > 0 )
            //    setValue ( listOtherInfo );
            //List<FishEntity.PurchaseContractFishInfo> listFishInfo = _bll.getFishInfoList(_model.codeNum);
            //if (listFishInfo != null && listFishInfo.Count > 0)
            //    setValue(listFishInfo);

            panel1.Enabled = true;
        }
Exemplo n.º 8
0
 void addImage(Hashtable SQLSing, StringBuilder strSql, FishEntity.PicInfoAll model)
 {
     strSql = new StringBuilder( );
     strSql.Append("insert into t_picinfoall(");
     strSql.Append("tableId,tableName,picInfo)");
     strSql.Append(" values (");
     strSql.Append("@tableId,@tableName,@picInfo)");
     MySqlParameter [] parameters =
     {
         new MySqlParameter("@tableId",   MySqlDbType.Int32,    11),
         new MySqlParameter("@tableName", MySqlDbType.VarChar, 255),
         new MySqlParameter("@picInfo",   MySqlDbType.LongBlob)
     };
     parameters [0].Value = model.tableId;
     parameters [1].Value = model.tableName;
     parameters [2].Value = model.picInfo;
     SQLSing.Add(strSql, parameters);
 }
Exemplo n.º 9
0
        List <FishEntity.PicInfoAll> getValueView()
        {
            List <FishEntity.PicInfoAll> dicpic = new List <FishEntity.PicInfoAll>();

            dataGridView1.EndEdit();
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                FishEntity.PicInfoAll entity = new FishEntity.PicInfoAll();
                entity.tableId   = txtcode.Tag == null ? 0 : Convert.ToInt32(txtcode.Tag);
                entity.tableName = this.Name;
                entity.picInfo   = dataGridView1.Rows[i].Cells["picInfo"].Value == null ? new byte[0] : (byte[])dataGridView1.Rows[i].Cells["picInfo"].Value;
                entity.categroy  = dataGridView1.Rows[i].Cells["categroy"].Value == null ? string.Empty : dataGridView1.Rows[i].Cells["categroy"].Value.ToString();
                entity.remark    = dataGridView1.Rows[i].Cells["remark"].Value == null ? string.Empty : dataGridView1.Rows[i].Cells["remark"].Value.ToString();
                dicpic.Add(entity);
            }

            return(dicpic);
        }
Exemplo n.º 10
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     PictureOpreation.ClearPicture(pic);
     dicPic.Remove(Convert.ToInt32(pic.Tag));
     if (dicPic.Count > 0)
     {
         for (int i = 1; i <= dicPic.Count; i++)
         {
             if (dicPic.ContainsKey(Convert.ToInt32(this.pic.Tag) + i))
             {
                 _pic           = dicPic[Convert.ToInt32(this.pic.Tag) + i];
                 this.pic.Image = PictureOpreation.ReadPicture(_pic.picInfo);
                 this.pic.Tag   = Convert.ToInt32(this.pic.Tag) + i;
                 break;
             }
         }
     }
 }
Exemplo n.º 11
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear();
            if (string.IsNullOrEmpty(txtLeiBie.Text))
            {
                errorProvider1.SetError(txtLeiBie, "请选择类别");
                return;
            }
            _pic           = new FishEntity.PicInfoAll();
            _pic.tableId   = txtcode.Tag == null ? 0 : Convert.ToInt32(txtcode.Tag);
            _pic.picInfo   = PictureOpreation.ReadPictureToByte(pic);
            _pic.tableName = this.Name;
            _pic.categroy  = txtLeiBie.Text;
            //_pic.remark = txtBeiZhu.Text;

            dataGridView1.Rows[selectIdx].Cells["picInfo"].Value  = _pic.picInfo;
            dataGridView1.Rows[selectIdx].Cells["categroy"].Value = _pic.categroy;
            //dataGridView1.Rows[selectIdx].Cells["remark"].Value = _pic.remark;
        }
Exemplo n.º 12
0
        public FormWarehouseReceipt()
        {
            InitializeComponent( );

            _model = new FishEntity.WarehouseReceiptEntity( );
            _bll   = new FishBll.Bll.WarehouseReceiptBll( );
            _pic   = new FishEntity.PicInfoAll( );
            InitDataUtil.BindComboBoxData(cmbStartingCountry, FishEntity.Constant.CountryType, true);
            InitDataUtil.BindComboBoxData(cmbDestinationCountry, FishEntity.Constant.CountryType, true);
            InitDataUtil.BindComboBoxData(cmbcountryOfOrigin, FishEntity.Constant.CountryType, true);
            InitDataUtil.BindComboBoxData(txtcommodityTons, FishEntity.Constant.Goods, true);
            InitDataUtil.BindComboBoxData(txtProductionProcess, FishEntity.Constant.TechClass, true);
            this.dtpReportingTime.Format        = System.Windows.Forms.DateTimePickerFormat.Custom;
            this.dtpReportingTime.CustomFormat  = "  ";
            this.dtpTestTime.Format             = System.Windows.Forms.DateTimePickerFormat.Custom;
            this.dtpTestTime.CustomFormat       = "  ";
            this.dtpFumigationDate.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
            this.dtpFumigationDate.CustomFormat = "  ";
        }