Ejemplo n.º 1
0
        public void SetFish(FishEntity.ProductEntity entity)
        {
            txtweight.Text         = entity.weight.ToString();
            txtremainweight.Text   = entity.remainweight.ToString();
            txtquantity.Text       = entity.quantity.ToString();
            txtremainquantity.Text = entity.remainquantity.ToString();

            txthomemadecost.Text     = entity.homemadecost.ToString();
            txthomemadepackages.Text = entity.homemadepackages.ToString();
            //自制仓单价= 自制仓成本/自制仓重量
            decimal unitprice = entity.homemadeweight.Value == 0 ? 0: entity.homemadecost.Value / entity.homemadeweight.Value;

            txthomemadeunitprice.Text = unitprice.ToString("f2"); // entity.homemadeunitprice.ToString();
            txthomemadeweight.Text    = entity.homemadeweight.ToString();

            txtarriveportdate.Text = entity.arriveportdate;
            //txtbillofgoods.Text = entity.billofgoods;
            txtcustomsofcompany.Text = entity.customsofcompany;
            txtagentifcompany.Text   = entity.agentifcompany;
            txtowner.Text            = entity.ownername;
            txtownershort.Text       = entity.ownershortname;
            txtownershort.Tag        = entity.ownerCode;

            txtprice.Text           = entity.price.ToString();
            txtsailingschedule.Text = entity.sailingschedule;
        }
Ejemplo n.º 2
0
        private void txtcountry_DoubleClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtfishId.Text))
            {
                MessageBox.Show("请选择鱼粉ID");
                return;
            }
            FormFish form = new FormFish(txtfishId.Text);

            if (form.ShowDialog() == DialogResult.OK)
            {
                FishEntity.ProductEntity _fish = form.getEntity;
                if (_fish == null)
                {
                    return;
                }
                txtcountry.Text    = _fish.nature;
                txtbrand.Text      = _fish.brand;
                txtpileNum.Text    = _fish.cornerno;
                txtproName.Text    = _fish.name;
                txtqualitySpe.Text = _fish.specification;
                txtza.Text         = _fish.sgs_amine.ToString("f2");
                txttvn.Text        = _fish.sgs_tvn.ToString("f2");
                txtzf.Text         = _fish.sgs_fat.ToString();
                txthf.Text         = _fish.sgs_graypart.ToString();
                txtsand.Text       = _fish.sgs_sand.ToString();
                txtbillName.Text   = _fish.billofgoods;
                txtsf.Text         = _fish.sgs_water.ToString();
                txtdb.Text         = _fish.sgs_protein.ToString();
                txtshy.Text        = _fish.sgs_sandsalt.ToString();
            }
        }
Ejemplo n.º 3
0
        public void Getnum1(FishEntity.ProductEntity entity)
        {
            decimal temp2 = 0;

            entity.code          = txtCode.Text;
            entity.specification = entity.specification = cmbSpecification.SelectedValue == null ? string.Empty : cmbSpecification.SelectedValue.ToString();
            if (cmbBand.SelectedValue != null)
            {
                entity.brand = cmbBand.SelectedValue.ToString();
            }
            else
            {
                entity.brand = string.Empty;
            }
            entity.nature = cmbCountry.SelectedValue.ToString();
            entity.type   = cmbPort.SelectedValue == null ? string.Empty : cmbPort.SelectedValue.ToString();


            decimal.TryParse(txtquote_protein.Text, out temp2);
            entity.quote_protein = temp2;
            decimal.TryParse(txtquote_tvn.Text, out temp2);
            entity.quote_tvn = temp2;
            decimal.TryParse(txtquote_sand.Text, out temp2);
            entity.quote_sand = temp2;
            decimal.TryParse(txtquote_sandsalt.Text, out temp2);
            entity.quote_sandsalt = temp2;
            decimal.TryParse(txtquote_amine.Text, out temp2);
            entity.quote_amine = temp2;
            decimal.TryParse(txtquote_ffa.Text, out temp2);
            entity.quote_ffa = temp2;
            decimal.TryParse(txtquote_fat.Text, out temp2);
            entity.quote_fat = temp2;
            decimal.TryParse(txtquote_water.Text, out temp2);
            entity.quote_water = temp2;
        }
Ejemplo n.º 4
0
        public override int Add()
        {
            tmiSave.Visible     = true;
            tmiCancel.Visible   = true;
            tmiAdd.Visible      = false;
            tmiModify.Visible   = false;
            tmiQuery.Visible    = false;
            tmiPrevious.Visible = false;
            tmiNext.Visible     = false;
            tmiDelete.Visible   = false;

            _fish = null;

            fishInfoControl1.Clear();
            fishSummaryControl1.Clear();
            fishCompositionControl1.Clear();

            fishQuoteControl1.Clear();
            fishComfirmControl1.Clear();
            fishSpotGoodsControl1.Clear();
            fishSelfControl1.Clear();
            fishSaleControl1.Clear();

            //txtman.Text = FishEntity.Variable.User.username;
            //txtmodifytime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            panelAll.Enabled = true;

            return(1);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public List <FishEntity.ProductEntity> Report(string strWhere, out decimal weight, out int package, out decimal homeweight, out int homepackage)
        {
            weight      = 0;
            package     = 0;
            homepackage = 0;
            homeweight  = 0;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * from t_product");
            if (string.IsNullOrEmpty(strWhere) == false)
            {
                strSql.Append(" where " + strWhere);
            }

            DataSet ds = MySqlHelper.Query(strSql.ToString());
            List <FishEntity.ProductEntity> list = new List <FishEntity.ProductEntity>();

            FishEntity.ProductEntity model = new FishEntity.ProductEntity();
            int rowcount = ds.Tables[0].Rows.Count;

            for (int i = 0; i < rowcount; i++)
            {
                DataRow row = ds.Tables[0].Rows[i];
                model = DataRowToModel(row);//
                list.Add(model);
                weight      += model.weight.Value;
                package     += model.quantity.Value;
                homeweight  += model.homemadeweight.Value;
                homepackage += model.homemadepackages.Value;
            }
            return(list);
        }
Ejemplo n.º 6
0
        protected void QueryOne(string operate, string orderBy)
        {
            string whereEx = string.Empty;

            if (string.IsNullOrEmpty(_where))
            {
                whereEx = " 1=1 ";
            }
            else
            {
                whereEx = _where;
            }

            if (_fish != null)
            {
                whereEx += " and code " + operate + _fish.code;
            }

            List <FishEntity.ProductEntity> list = _bll.GetModelList(whereEx + orderBy);

            if (list == null || list.Count < 1)
            {
                MessageBox.Show("已经没有记录了!");
                return;
            }

            _fish = list[0];
            //
            _fishex = _bllex.GetModel(_fish.id);

            SetFish();
        }
Ejemplo n.º 7
0
        public List <FishEntity.ContractPorductEntity> GetProducts(int contractid, int detailid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.id as cpid , b.* from t_contractproduct a inner join t_product b on a.productid=b.id where ");
            strSql.Append(" a.contractid=" + contractid + " and a.contractdetailid=" + detailid);

            DataSet dsData = MySqlHelper.Query(strSql.ToString());
            List <FishEntity.ContractPorductEntity> list = new List <FishEntity.ContractPorductEntity>();

            for (int i = 0; i < dsData.Tables[0].Rows.Count; i++)
            {
                FishEntity.ProductEntity entity = ProductDao.DataRowToModel(dsData.Tables[0].Rows[i]);

                FishEntity.ContractPorductEntity model = new FishEntity.ContractPorductEntity();
                if (dsData.Tables[0].Rows[i]["cpid"] != null)
                {
                    model.cpid = int.Parse(dsData.Tables[0].Rows[i]["cpid"].ToString());
                }
                model.id            = entity.id;
                model.code          = entity.code;
                model.name          = entity.name;
                model.specification = entity.specification;

                list.Add(model);
            }
            return(list);
        }
Ejemplo n.º 8
0
        public override void Save()
        {
            _fish = new FishEntity.ProductEntity();
            Getnum1(_fish);
            _fish.createman = FishEntity.Variable.User.username;
            _fish.modifyman = _fish.createman;
            _fish.code      = FishBll.Bll.SequenceUtil.GetFishSequence();
            bool isok = _bll.Exists(_fish.code);

            while (isok)
            {
                _fish.code = FishBll.Bll.SequenceUtil.GetFishSequence();
                isok       = _bll.Exists(_fish.code);
            }
            int id = _bll.Entry_Add(_fish);

            if (id > 0)
            {
                _fish.id = id;
                SaveEx(id);
                SetFish(_fish);
                tmiQuery.Visible  = false;
                tmiDelete.Visible = false;
                tmiModify.Visible = false;
                tmiAdd.Visible    = false;
                tmiSave.Visible   = true;
                tmiCancel.Visible = true;
                MessageBox.Show("添加成功。");
            }
            else
            {
                MessageBox.Show("添加失败。");
            }
        }
Ejemplo n.º 9
0
        public void Clear()
        {
            errorProvider1.Clear();
            _fish = null;

            txtdomestic_graypart.Text   = string.Empty;
            txtdomestic_lysine.Text     = string.Empty;
            txtdomestic_methionine.Text = string.Empty;
            txtdomestic_protein.Text    = string.Empty;
            txtdomestic_sandsalt.Text   = string.Empty;
            txtdomestic_sour.Text       = string.Empty;
            txtdomestic_tvn.Text        = string.Empty;
            txtdomestic_amine.Text      = string.Empty;
            txtdomestic_aminototal.Text = string.Empty;
            txtdomestic_fat.Text        = string.Empty;
            txtSampleingDate.Text       = string.Empty;

            txtlabe_water.Text       = string.Empty;
            txtlabel_amine.Text      = string.Empty;
            txtlabel_fat.Text        = string.Empty;
            txtlabel_ffa.Text        = string.Empty;
            txtlabel_graypart.Text   = string.Empty;
            txtlabel_lysine.Text     = string.Empty;
            txtlabel_methionine.Text = string.Empty;
            txtlabel_protein.Text    = string.Empty;
            txtlabel_sand.Text       = string.Empty;
            txtlabel_sandsalt.Text   = string.Empty;
            txtlabel_tvn.Text        = string.Empty;
            //txtLinkman.Text = string.Empty;
            //txtLinkManCode.Text = string.Empty;
            //txtLinkManCode.Tag = string.Empty;

            txtquote_amine.Text    = string.Empty;
            txtquote_fat.Text      = string.Empty;
            txtquote_ffa.Text      = string.Empty;
            txtquote_graypart.Text = string.Empty;
            txtquote_protein.Text  = string.Empty;
            txtquote_sand.Text     = string.Empty;
            txtquote_sandsalt.Text = string.Empty;
            txtquote_tvn.Text      = string.Empty;
            txtquote_water.Text    = string.Empty;
            txtsgs_amine.Text      = string.Empty;
            txtsgs_fat.Text        = string.Empty;
            txtsgs_ffa.Text        = string.Empty;
            txtsgs_graypart.Text   = string.Empty;
            txtsgs_protein.Text    = string.Empty;
            txtsgs_sand.Text       = string.Empty;
            txtsgs_sandsalt.Text   = string.Empty;
            txtsgs_tvn.Text        = string.Empty;
            txtsgs_water.Text      = string.Empty;
            //txtSupplier.Text = string.Empty;
            //txtSupplierCode.Text = string.Empty;
            //txtSupplierCode.Tag = string.Empty;

            _formSGS   = null;
            _formLabel = null;
            _formGJ    = null;
            _formQuote = null;
        }
Ejemplo n.º 10
0
        public override void Save()
        {
            if (Check() == false)
            {
                return;
            }

            _entity = new FishEntity.HomemadeStorageEntity();
            _en     = new FishEntity.ProductEntity();
            GetEntity();

            _entity.createman  = FishEntity.Variable.User.username;
            _entity.createtime = DateTime.Now;
            _entity.modifyman  = _entity.createman;
            _entity.modifytime = _entity.createtime;

            _entity.code = FishBll.Bll.SequenceUtil.GetHomemadeStorageSequence();
            while (_bll.Exists(_entity.code))
            {
                _entity.code = FishBll.Bll.SequenceUtil.GetHomemadeStorageSequence();
            }

            int id = _bll.Add(_entity);

            _bll.Add1(_en);
            if (id > 0)
            {
                _entity.id   = id;
                txtCode.Text = _entity.code;
                //更新 鱼粉资料 的自制仓 成本,数量 , 重量
                //FishBll.Bll.ProductBll productBll = new FishBll.Bll.ProductBll();
                //decimal cost = _entity.unitprice.Value * _entity.netweight.Value;
                //decimal weight = _entity.netweight.Value;
                //bool isok = productBll.UpdateHomemade(_entity.productid.Value , weight , cost, _entity.packages.Value);

                //更新 鱼粉资料的 自制仓 入库重量,数量,采购单价,销售单价,入库时间等信息
                FishBll.Bll.ProductExBll productExBll = new FishBll.Bll.ProductExBll();
                bool isok = productExBll.UpdateHomeMadeInfo(_entity.productid.Value, _entity.storageweight, _entity.storagequantity, _entity.selfprice, _entity.saleprice, _entity.storagetime.Value.ToString("yyyy/MM/dd"));

                //tmiCancel.Visible = false;
                //tmiSave.Visible = false;
                //tmiAdd.Visible = true;
                //tmiModify.Visible = true;
                //tmiDelete.Visible = true;
                //tmiQuery.Visible = true;
                //tmiPrevious.Visible = true;
                //tmiNext.Visible = true;
                //txtfishname.Enabled = false;
                //txtFishCode.Enabled = false;
                ControlButtomRoles();

                MessageBox.Show("新增成功。");
            }
            else
            {
                MessageBox.Show("新增失败。");
            }
            return;
        }
Ejemplo n.º 11
0
        public override void Save()
        {
            _fish = new FishEntity.ProductEntity();
            fishInfoControl1.GetFish(_fish);        //上
            fishCompositionControl1.GetFish(_fish); //中
            fishSummaryControl1.GetFish(_fish);     //下
            _fish.createman = FishEntity.Variable.User.username;
            _fish.modifyman = _fish.createman;

            if (Check() == false)
            {
                return;
            }

            _fish.code = FishBll.Bll.SequenceUtil.GetFishSequence();
            bool isok = _bll.Exists(_fish.code);

            while (isok)
            {
                _fish.code = FishBll.Bll.SequenceUtil.GetFishSequence();
                isok       = _bll.Exists(_fish.code);
            }

            int id = _bll.Add(_fish);

            if (id > 0)
            {
                _fish.id = id;

                AddImages(_fish);
                AddImages1(_fish);

                SaveEx(id);

                fishInfoControl1.SetFish(_fish);

                fishCompositionControl1.SetFish(_fish);

                //tmiAdd.Visible = true;
                //tmiModify.Visible = true;
                //tmiQuery.Visible = true;
                //tmiPrevious.Visible = true;
                //tmiNext.Visible = true;
                //tmiDelete.Visible = true;
                //tmiSave.Visible = false;
                //tmiCancel.Visible = false;
                ControlButtomRoles();

                MessageBox.Show("添加成功。");
            }
            else
            {
                MessageBox.Show("添加失败。");
            }

            return;
        }
Ejemplo n.º 12
0
        public void SetFish(FishEntity.ProductEntity entity)
        {
            _formLabel = null;
            _formSGS   = null;
            _formGJ    = null;
            _formQuote = null;
            _fish      = entity;
            if (_fish == null)
            {
                return;
            }

            txtsgs_amine.Text    = _fish.sgs_amine.ToString("f2");
            txtsgs_fat.Text      = _fish.sgs_fat.ToString();
            txtsgs_ffa.Text      = _fish.sgs_ffa.ToString();
            txtsgs_graypart.Text = _fish.sgs_graypart.ToString();
            txtsgs_protein.Text  = _fish.sgs_protein.ToString();
            txtsgs_sand.Text     = _fish.sgs_sand.ToString();
            txtsgs_sandsalt.Text = _fish.sgs_sandsalt.ToString();
            txtsgs_tvn.Text      = _fish.sgs_tvn.ToString("f2");
            txtsgs_water.Text    = _fish.sgs_water.ToString();

            txtlabe_water.Text       = _fish.labe_water.ToString();
            txtlabel_amine.Text      = _fish.label_amine.ToString("f2");
            txtlabel_fat.Text        = _fish.label_fat.ToString();
            txtlabel_ffa.Text        = _fish.label_ffa.ToString();
            txtlabel_graypart.Text   = _fish.label_graypart.ToString();
            txtlabel_lysine.Text     = _fish.label_lysine.ToString();
            txtlabel_methionine.Text = _fish.label_methionine.ToString();
            txtlabel_protein.Text    = _fish.label_protein.ToString();
            txtlabel_sand.Text       = _fish.label_sand.ToString();
            txtlabel_sandsalt.Text   = _fish.label_sandsalt.ToString();
            txtlabel_tvn.Text        = _fish.label_tvn.ToString();

            txtquote_amine.Text    = _fish.quote_amine.ToString("f2");
            txtquote_fat.Text      = _fish.quote_fat.ToString();
            txtquote_ffa.Text      = _fish.quote_ffa.ToString();
            txtquote_graypart.Text = _fish.quote_graypart.ToString();
            txtquote_protein.Text  = _fish.quote_protein.ToString();
            txtquote_sand.Text     = _fish.quote_sand.ToString();
            txtquote_sandsalt.Text = _fish.quote_sandsalt.ToString();
            txtquote_tvn.Text      = _fish.quote_tvn.ToString("f2");
            txtquote_water.Text    = _fish.quote_water.ToString();

            txtdomestic_graypart.Text   = _fish.domestic_graypart.ToString();
            txtdomestic_lysine.Text     = _fish.domestic_lysine.ToString();
            txtdomestic_methionine.Text = _fish.domestic_methionine.ToString();
            txtdomestic_protein.Text    = _fish.domestic_protein.ToString();
            txtdomestic_sandsalt.Text   = _fish.domestic_sandsalt.ToString();
            txtdomestic_sour.Text       = _fish.domestic_sour.ToString();
            txtdomestic_tvn.Text        = _fish.domestic_tvn.ToString();
            txtdomestic_fat.Text        = _fish.domestic_fat.ToString();
            txtdomestic_amine.Text      = _fish.domestic_amine.ToString();
            txtdomestic_aminototal.Text = _fish.domestic_aminototal.ToString();
            txtSampleingDate.Text       = _fish.samplingtime;
        }
Ejemplo n.º 13
0
        public void GetFish(FishEntity.ProductEntity entity)
        {
            decimal temp1 = 0;

            decimal.TryParse(txtweight.Text, out temp1);
            entity.weight = temp1;

            int temp2 = 0;

            int.TryParse(txtquantity.Text, out temp2);
            entity.quantity = temp2;

            decimal.TryParse(txtremainweight.Text, out temp1);
            entity.remainweight = temp1;

            int.TryParse(txtremainquantity.Text, out temp2);
            entity.remainquantity = temp2;

            decimal.TryParse(txthomemadeweight.Text, out temp1);
            entity.homemadeweight = temp1;

            decimal.TryParse(txthomemadecost.Text, out temp1);
            entity.homemadecost = temp1;

            int.TryParse(txthomemadepackages.Text, out temp2);
            entity.homemadepackages = temp2;

            decimal.TryParse(txthomemadeunitprice.Text, out temp1);
            entity.homemadeunitprice = temp1;

            decimal.TryParse(txtprice.Text, out temp1);
            entity.price = temp1;


            entity.arriveportdate = txtarriveportdate.Text;

            entity.sailingschedule = txtsailingschedule.Text;

            if (string.IsNullOrEmpty(txtownershort.Text) == false)
            {
                entity.ownerCode      = txtownershort.Tag.ToString();
                entity.ownershortname = txtownershort.Text;
                entity.ownername      = txtowner.Text;
            }
            else
            {
                entity.ownername      = string.Empty;
                entity.ownerCode      = string.Empty;
                entity.ownershortname = string.Empty;
            }

            //entity.billofgoods = txtbillofgoods.Text;

            entity.agentifcompany   = txtagentifcompany.Text;
            entity.customsofcompany = txtcustomsofcompany.Text;
        }
Ejemplo n.º 14
0
 private void dataGridView1_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (boolget == true)
     {
         if (e.ColumnIndex < 0 || e.RowIndex < 0)
         {
         }
         else
         {
         }
         if (dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString() == "分组小计")
         {
             return;
         }
         if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("isdelete4", StringComparison.OrdinalIgnoreCase) == true)
         {
             if (FishEntity.Variable.User.username == "admin" || FishEntity.Variable.User.username == "ceo" || FishEntity.Variable.User.username == "zd_lyk")
             {
                 FishEntity.ProductEntity _fish   = new FishEntity.ProductEntity();
                 FishBll.Bll.FinishBll    fishbll = new FishBll.Bll.FinishBll();
                 _fish.code = dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString();
                 System.Console.WriteLine(dataGridView1.Rows[e.RowIndex].Cells["isdelete4"].Value.ToString());
                 if (("0").Equals(dataGridView1.Rows[e.RowIndex].Cells["isdelete4"].Value.ToString()))
                 {
                     _fish.isdelete = 1;
                 }
                 else if (("1").Equals(dataGridView1.Rows[e.RowIndex].Cells["isdelete4"].Value.ToString()))
                 {
                     _fish.isdelete = 0;
                 }
                 string names = "isdelete4";
                 bool   idx   = fishbll.update(_fish, names);
                 if (idx)
                 {
                     MessageBox.Show("修改成功!");
                     boolget = false;
                 }
                 else
                 {
                     MessageBox.Show("修改失败!");
                     boolget = false;
                 }
             }
         }
     }
     else
     {
         return;
     }
 }
Ejemplo n.º 15
0
        protected int QueryByWhere(string where, string orderBy)
        {
            List <FishEntity.ProductEntity> list = _bll.GetModelList(where + orderBy);

            if (list == null || list.Count < 1)
            {
                _fish   = null;
                _fishex = null;
                return(0);
            }
            else
            {
                _fish = list[0];

                _fishex = _bllex.GetModel(_fish.id);

                SetFish();
                return(1);
            }
        }
Ejemplo n.º 16
0
        public override int Delete()
        {
            if (_fish == null)
            {
                return(0);
            }

            if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan) &&
                false == FishEntity.Variable.User.username.Equals(_fish.createman))
            {
                MessageBox.Show("对不起,您不能删除别人创建的鱼粉资料!");
                return(0);
            }

            string fishid = _fish.code;

            if (MessageBox.Show("您确定要删除的【" + fishid + "】鱼粉信息吗?", "询问", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
            {
                return(0);
            }

            bool isok1 = _bll.Delete(_fish.id);
            bool isok2 = _bllex.Delete(_fish.id);

            if (isok1 == false || isok2 == false)
            {
                MessageBox.Show("删除鱼粉信息失败。");
            }
            else
            {
                MessageBox.Show("删除鱼粉信息成功。");

                _fish = null;

                Next();
            }

            return(base.Delete());
        }
Ejemplo n.º 17
0
        public bool upde(FishEntity.ProductEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update t_product set ");
            strSql.Append("isdelete4=5 ");
            strSql.Append(" where code=@code");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@code", MySqlDbType.VarChar, 45)
            };
            int rows = MySqlHelper.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 18
0
        public void SetFish(FishEntity.ProductEntity entity)
        {
            if (entity == null)
            {
                return;
            }
            txtCode.Text = entity.code;
            cmbSpecification.SelectedValue = entity.specification;
            cmbCountry.SelectedValue       = entity.nature;
            cmbBand.SelectedValue          = entity.brand;
            cmbPort.SelectedValue          = entity.type;
            _fish = entity;

            txtquote_amine.Text    = _fish.quote_amine.ToString();
            txtquote_fat.Text      = _fish.quote_fat.ToString();
            txtquote_ffa.Text      = _fish.quote_ffa.ToString();
            txtquote_protein.Text  = _fish.quote_protein.ToString();
            txtquote_sand.Text     = _fish.quote_sand.ToString();
            txtquote_sandsalt.Text = _fish.quote_sandsalt.ToString();
            txtquote_tvn.Text      = _fish.quote_tvn.ToString();
            txtquote_water.Text    = _fish.quote_water.ToString();
        }
Ejemplo n.º 19
0
        public bool update(FishEntity.ProductEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update t_product set  ");
            strSql.Append(" Display=@Display  ");
            strSql.Append("  where code=@code ");
            MySqlParameter[] parameter =
            {
                new MySqlParameter("@Display", model.Display),
                new MySqlParameter("@code",    model.code)
            };
            int rows = MySqlHelper.ExecuteSql(strSql.ToString(), parameter);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        //鱼粉ID
        private void txtfishId_MouseClick(object sender, MouseEventArgs e)
        {
            FormFish form = new FormFish( );

            if (form.ShowDialog( ) == DialogResult.OK)
            {
                FishEntity.ProductEntity _fish = form.getEntity;
                txtfishId.Text    = _fish.code;
                txtvarieties.Text = _fish.name;
                txtquaSpe.Text    = _fish.specification;
                txtconutry.Text   = _fish.nature;
                txtbrand.Text     = _fish.brand;
                txtSGSDB.Text     = _fish.sgs_protein.ToString( );
                txtSGSTVN.Text    = _fish.sgs_tvn.ToString( );
                txtSGSZA.Text     = _fish.sgs_amine.ToString( );
                txtSGSFFA.Text    = _fish.sgs_ffa.ToString( );
                txtSGSZF.Text     = _fish.sgs_fat.ToString( );
                txtSGSSF.Text     = _fish.sgs_water.ToString( );
                txtSGSSHY.Text    = _fish.sgs_sandsalt.ToString( );
                txtSGSS.Text      = _fish.sgs_sand.ToString( );
                txtSGSSJ.Text     = _fish.domestic_sour.ToString( );
                txtSGSHF.Text     = _fish.sgs_graypart.ToString( );
            }
        }
Ejemplo n.º 21
0
        protected void SetEntity()
        {
            if (_entity == null)
            {
                return;
            }

            txtCode.Text        = _entity.code;
            txtFishCode.Text    = _entity.productcode;
            txtFishCode.Tag     = _entity.productid;
            txtfishname.Text    = _entity.productname;
            txtgrossweight.Text = _entity.grossweight.ToString();
            txtnetweight.Text   = _entity.netweight.ToString();
            txtpackagenum.Text  = _entity.packages.ToString();
            txtSeq.Text         = _entity.seq;
            txttureweight.Text  = _entity.tareweight.ToString();
            txtunitprice.Text   = _entity.unitprice.ToString();
            dtpIntime.Value     = _entity.intime.Value;
            dtpOuttime.Value    = _entity.outtime.Value;

            dtpStorageDate.Value = _entity.storagetime.Value;
            txtweight.Text       = _entity.storageweight.ToString();
            txtquantity.Text     = _entity.storagequantity.ToString();
            txtselfprice.Text    = _entity.selfprice.ToString();
            txtsaleprice.Text    = _entity.saleprice.ToString();
            txtpurposeman.Text   = _entity.purchaseman;
            txtpurposeman.Tag    = _entity.purchasemanid;
            txtdeliveryman.Text  = _entity.storageman;
            txtdeliveryman.Tag   = _entity.storagemanid;


            FishBll.Bll.ProductBll   productBll = new FishBll.Bll.ProductBll();
            FishEntity.ProductEntity fish       = productBll.GetModel(_entity.productid.Value);
            if (fish == null)
            {
                return;
            }

            txtsgs_amine.Text    = fish.sgs_amine.ToString();
            txtsgs_fat.Text      = fish.sgs_fat.ToString();
            txtsgs_ffa.Text      = fish.sgs_ffa.ToString();
            txtsgs_graypart.Text = fish.sgs_graypart.ToString();
            txtsgs_protein.Text  = fish.sgs_protein.ToString();
            txtsgs_sand.Text     = fish.sgs_sand.ToString();
            txtsgs_sandsalt.Text = fish.sgs_sandsalt.ToString();
            txtsgs_tvn.Text      = fish.sgs_tvn.ToString();
            txtsgs_water.Text    = fish.sgs_water.ToString();

            txtlabel_lysine.Text     = fish.label_lysine.ToString();
            txtlabel_methionine.Text = fish.label_methionine.ToString();

            txtdomestic_graypart.Text   = fish.domestic_graypart.ToString();
            txtdomestic_lysine.Text     = fish.domestic_lysine.ToString();
            txtdomestic_methionine.Text = fish.domestic_methionine.ToString();
            txtdomestic_protein.Text    = fish.domestic_protein.ToString();
            txtdomestic_sandsalt.Text   = fish.domestic_sandsalt.ToString();
            txtdomestic_sour.Text       = fish.domestic_sour.ToString();
            txtdomestic_tvn.Text        = fish.domestic_tvn.ToString();

            dtpStorageDate.Value = _entity.storagetime.Value;
            txtweight.Text       = _entity.storageweight.ToString();
            txtquantity.Text     = _entity.storagequantity.ToString();
            txtselfprice.Text    = _entity.selfprice.ToString();
            txtsaleprice.Text    = _entity.saleprice.ToString();
            txtpurposeman.Text   = _entity.purchaseman;
            txtpurposeman.Tag    = _entity.purchasemanid;
            txtdeliveryman.Text  = _entity.storageman;
            txtdeliveryman.Tag   = _entity.storagemanid;

            txtFishCode.Enabled = false;
            txtfishname.Enabled = false;
        }
Ejemplo n.º 22
0
 public bool update(FishEntity.ProductEntity model)
 {
     return(dal.update(model));
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 有效性
 /// </summary>
 /// <param name="Numbering"></param>
 /// <param name="effect"></param>
 /// <returns></returns>
 public bool update(FishEntity.ProductEntity model, string names)
 {
     return(dal.update(model, names));
 }
Ejemplo n.º 24
0
 public bool Add1(FishEntity.ProductEntity model)
 {
     return(da.upde(model));
 }
Ejemplo n.º 25
0
        public void GetFish(FishEntity.ProductEntity entity)
        {
            //int temp1 = 0;
            decimal temp2 = 0;

            decimal.TryParse(txtquote_amine.Text, out temp2);
            entity.quote_amine = temp2;
            decimal.TryParse(txtquote_fat.Text, out temp2);
            entity.quote_fat = temp2;
            decimal.TryParse(txtquote_ffa.Text, out temp2);
            entity.quote_ffa = temp2;
            decimal.TryParse(txtquote_graypart.Text, out temp2);
            entity.quote_graypart = temp2;
            decimal.TryParse(txtquote_protein.Text, out temp2);
            entity.quote_protein = temp2;
            decimal.TryParse(txtquote_sand.Text, out temp2);
            entity.quote_sand = temp2;
            decimal.TryParse(txtquote_sandsalt.Text, out temp2);
            entity.quote_sandsalt = temp2;
            decimal.TryParse(txtquote_tvn.Text, out temp2);
            entity.quote_tvn = temp2;
            decimal.TryParse(txtquote_water.Text, out temp2);
            entity.quote_water = temp2;

            //--------------------------------------------------
            decimal.TryParse(txtsgs_amine.Text, out temp2);
            entity.sgs_amine = temp2;

            decimal.TryParse(txtsgs_ffa.Text, out temp2);
            entity.sgs_ffa = temp2;

            decimal.TryParse(txtsgs_fat.Text, out temp2);
            entity.sgs_fat = temp2;

            decimal.TryParse(txtsgs_graypart.Text, out temp2);
            entity.sgs_graypart = temp2;

            decimal.TryParse(txtsgs_protein.Text, out temp2);
            entity.sgs_protein = temp2;

            decimal.TryParse(txtsgs_sand.Text, out temp2);
            entity.sgs_sand = temp2;

            decimal.TryParse(txtsgs_sandsalt.Text, out temp2);
            entity.sgs_sandsalt = temp2;

            decimal.TryParse(txtsgs_tvn.Text, out temp2);
            entity.sgs_tvn = temp2;

            decimal.TryParse(txtsgs_water.Text, out temp2);
            entity.sgs_water = temp2;

            //----------------------------------------------------

            decimal.TryParse(txtlabe_water.Text, out temp2);
            entity.labe_water = temp2;

            decimal.TryParse(txtlabel_amine.Text, out temp2);
            entity.label_amine = temp2;

            decimal.TryParse(txtlabel_fat.Text, out temp2);
            entity.label_fat = temp2;

            decimal.TryParse(txtlabel_ffa.Text, out temp2);
            entity.label_ffa = temp2;

            decimal.TryParse(txtlabel_graypart.Text, out temp2);
            entity.label_graypart = temp2;

            decimal.TryParse(txtlabel_lysine.Text, out temp2);
            entity.label_lysine = temp2;

            decimal.TryParse(txtlabel_methionine.Text, out temp2);
            entity.label_methionine = temp2;

            decimal.TryParse(txtlabel_protein.Text, out temp2);
            entity.label_protein = temp2;

            decimal.TryParse(txtlabel_sand.Text, out temp2);
            entity.label_sand = temp2;

            decimal.TryParse(txtlabel_sandsalt.Text, out temp2);
            entity.label_sandsalt = temp2;

            decimal.TryParse(txtlabel_tvn.Text, out temp2);
            entity.label_tvn = temp2;

            //----------------------------------------------------

            decimal.TryParse(txtdomestic_graypart.Text, out temp2);
            entity.domestic_graypart = temp2;

            decimal.TryParse(txtdomestic_lysine.Text, out temp2);
            entity.domestic_lysine = temp2;

            decimal.TryParse(txtdomestic_methionine.Text, out temp2);
            entity.domestic_methionine = temp2;

            decimal.TryParse(txtdomestic_protein.Text, out temp2);
            entity.domestic_protein = temp2;

            decimal.TryParse(txtdomestic_sandsalt.Text, out temp2);
            entity.domestic_sandsalt = temp2;

            decimal.TryParse(txtdomestic_sour.Text, out temp2);
            entity.domestic_sour = temp2;

            decimal.TryParse(txtdomestic_tvn.Text, out temp2);
            entity.domestic_tvn = temp2;

            decimal.TryParse(txtdomestic_amine.Text, out temp2);
            entity.domestic_amine = temp2;

            decimal.TryParse(txtdomestic_aminototal.Text, out temp2);
            entity.domestic_aminototal = temp2;

            decimal.TryParse(txtdomestic_fat.Text, out temp2);
            entity.domestic_fat   = temp2;
            txtSampleingDate.Text = string.Empty;
        }
Ejemplo n.º 26
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            if (dataGridView1.CurrentRow == null)
            {
                return;
            }
            //this . _model = dataGridView1 . CurrentRow . DataBoundItem as FishEntity . ProductEntity;
            _model = new FishEntity.ProductEntity( );
            if (dataGridView1.Rows [e.RowIndex].Cells ["code"].Value != null)
            {
                _model.code = dataGridView1.Rows [e.RowIndex].Cells ["code"].Value.ToString( );
            }
            else
            {
                _model.code = string.Empty;
            }
            if (dataGridView1.Rows [e.RowIndex].Cells ["name"].Value != null)
            {
                _model.name = dataGridView1.Rows [e.RowIndex].Cells ["name"].Value.ToString( );
            }
            else
            {
                _model.name = string.Empty;
            }
            if (dataGridView1.Rows [e.RowIndex].Cells ["specification"].Value != null)
            {
                _model.specification = dataGridView1.Rows [e.RowIndex].Cells ["specification"].Value.ToString( );
            }
            else
            {
                _model.specification = string.Empty;
            }
            if (dataGridView1.Rows [e.RowIndex].Cells ["brand"].Value != null)
            {
                _model.brand = dataGridView1.Rows [e.RowIndex].Cells ["brand"].Value.ToString( );
            }
            else
            {
                _model.brand = string.Empty;
            }
            if (dataGridView1.Rows [e.RowIndex].Cells ["nature"].Value != null)
            {
                _model.nature = dataGridView1.Rows [e.RowIndex].Cells ["nature"].Value.ToString( );
            }
            else
            {
                _model.nature = string.Empty;
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["brand"].Value != null)
            {
                _model.brand = dataGridView1.Rows[e.RowIndex].Cells["brand"].Value.ToString();
            }
            else
            {
                _model.brand = string.Empty;
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_protein"].Value != null)
            {
                _model.sgs_protein = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_protein"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_tvn"].Value != null)
            {
                _model.sgs_tvn = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_tvn"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_sandsalt"].Value != null)
            {
                _model.sgs_sandsalt = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_sandsalt"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_amine"].Value != null)
            {
                _model.sgs_amine = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_amine"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_ffa"].Value != null)
            {
                _model.sgs_ffa = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_ffa"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_fat"].Value != null)
            {
                _model.sgs_fat = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_fat"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_water"].Value != null)
            {
                _model.sgs_water = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_water"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["sgs_sand"].Value != null)
            {
                _model.sgs_sand = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_sand"].Value.ToString());
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["shipno"].Value != null)
            {
                _model.shipno = dataGridView1.Rows[e.RowIndex].Cells["shipno"].Value.ToString();
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["billofgoods"].Value != null)
            {
                _model.billofgoods = dataGridView1.Rows[e.RowIndex].Cells["billofgoods"].Value.ToString();
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["cornerno"].Value != null)
            {
                _model.cornerno = dataGridView1.Rows[e.RowIndex].Cells["cornerno"].Value.ToString();
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["warehouse"].Value != null)
            {
                _model.warehouse = dataGridView1.Rows[e.RowIndex].Cells["warehouse"].Value.ToString();
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Ejemplo n.º 27
0
 public int Entry_Add(FishEntity.ProductEntity model)
 {
     return(dal.Entry_Add(model));
 }
Ejemplo n.º 28
0
 public bool Entry_Update(FishEntity.ProductEntity model)
 {
     return(dal.Entry_Update(model));
 }
Ejemplo n.º 29
0
        protected void AddImages1(FishEntity.ProductEntity fish)
        {
            if (fish == null)
            {
                return;
            }

            FishBll.Bll.ImageS_Bll bll = new FishBll.Bll.ImageS_Bll();

            //if (fish.id > 0)
            //{
            //    bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.SGS);
            //    bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.Label);
            //    bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.GJ);
            //    bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.QUOTE);
            //}

            List <FishEntity.t_image_S> images = fishCompositionControl1.GetQuoteImages1();

            if (images != null)
            {
                foreach (FishEntity.t_image_S item in images)
                {
                    item.Fid1 = fish.id;

                    //item.createman = fish.createman;
                    item.Date_ = fish.createtime;
                    bll.Add(item);
                }
            }

            images = fishCompositionControl1.GetSGSImages1();
            if (images != null)
            {
                foreach (FishEntity.t_image_S item in images)
                {
                    item.Fid1 = fish.id;
                    //item.createman = fish.createman;
                    item.Date_ = fish.createtime;
                    bll.Add(item);
                }
            }

            images = fishCompositionControl1.GetLabelImages1();
            if (images != null)
            {
                foreach (FishEntity.t_image_S item in images)
                {
                    item.Fid1  = fish.id;
                    item.Date_ = fish.createtime;
                    bll.Add(item);
                }
            }

            images = fishCompositionControl1.GetGJImages1();
            if (images != null)
            {
                foreach (FishEntity.t_image_S item in images)
                {
                    item.Fid1 = fish.id;
                    //item.createman = fish.createman;
                    item.Date_ = fish.createtime;
                    bll.Add(item);
                }
            }
        }
Ejemplo n.º 30
0
        protected void AddImages(FishEntity.ProductEntity fish)
        {
            if (fish == null)
            {
                return;
            }

            FishBll.Bll.ImageBll bll = new FishBll.Bll.ImageBll();

            if (fish.id > 0)
            {
                bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.SGS);
                bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.Label);
                bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.GJ);
                bll.DeleteByRecordIdAndType(fish.id, (int)FishEntity.ImageTypeEnum.QUOTE);
            }

            List <FishEntity.ImageEntity> images = fishCompositionControl1.GetQuoteImages();

            if (images != null)
            {
                foreach (FishEntity.ImageEntity item in images)
                {
                    item.recordid   = fish.id;
                    item.createman  = fish.createman;
                    item.createtime = fish.createtime;
                    bll.Add(item);
                }
            }

            images = fishCompositionControl1.GetSGSImages();
            if (images != null)
            {
                foreach (FishEntity.ImageEntity item in images)
                {
                    item.recordid   = fish.id;
                    item.createman  = fish.createman;
                    item.createtime = fish.createtime;
                    bll.Add(item);
                }
            }

            images = fishCompositionControl1.GetLabelImages();
            if (images != null)
            {
                foreach (FishEntity.ImageEntity item in images)
                {
                    item.recordid   = fish.id;
                    item.createman  = fish.createman;
                    item.createtime = fish.createtime;
                    bll.Add(item);
                }
            }

            images = fishCompositionControl1.GetGJImages();
            if (images != null)
            {
                foreach (FishEntity.ImageEntity item in images)
                {
                    item.recordid   = fish.id;
                    item.createman  = fish.createman;
                    item.createtime = fish.createtime;
                    bll.Add(item);
                }
            }
        }