Esempio n. 1
0
        public override int Query()
        {
            panel1.Enabled = true;
            if (_queryForm == null)
            {
                _queryForm = new UIForms.FormOnepoundCondition();
                _queryForm.StartPosition = FormStartPosition.CenterParent;
                _queryForm.ShowInTaskbar = false;
            }
            if (_queryForm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return(0);
            }

            _where = _queryForm.GetWhereCondition;
            List <FishEntity.OnepoundEntityVo> list = _bll.GetModelListVo(_where + _rolewhere + _orderBy);

            if (list == null || list.Count < 1)
            {
                _fish = null;
                MessageBox.Show("查无数据!");
                return(1);
            }
            else
            {
                _fish = list[0];
                SetOnepound();
                return(1);
            }
            //return base.Query();
        }
Esempio n. 2
0
        protected void AddImages(FishEntity.OnepoundEntity fish)
        {
            if (fish == null)
            {
                return;
            }

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

            if (fish.Id > 0)
            {
                bll.DeleteByRecordIdAndType(fish.Id, (int)FishEntity.ImageTypeEnum.Onepoundcode);
            }

            List <FishEntity.ImageEntity> images = GetSGSImages();

            images = 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);
                }
            }
        }
Esempio n. 3
0
 private void FormOnepound_Load(object sender, EventArgs e)
 {
     MenuCode = "M402"; ControlButtomRoles();
     if (Megres.oddNum != null && Megres.oddNum != "")
     {
         _rolewhere = " and code='" + Megres.oddNum + "'";
         getname    = Megres.oddNum;
         List <FishEntity.OnepoundEntityVo> list = _bll.GetModelListVo(_where + _rolewhere + _orderBy);
         Megres.oddNum = string.Empty;
         if (list == null || list.Count < 1)
         {
             _fish = null;
         }
         else
         {
             _fish = list[0];
             SetOnepound();
             this.panel1.Enabled = true;
             menuStrip1.Visible  = true;
             tmiQuery.Visible    = true;
             tmiPrevious.Visible = false;
             tmiExport.Visible   = false;
             tmiReview.Visible   = true;
             tmiAdd.Visible      = true;
             tmiModify.Visible   = true;
             tmiDelete.Visible   = false;
             tmiClose.Visible    = true;
             tmiCancel.Visible   = false;
             tmiSave.Visible     = false;
             tmiNext.Visible     = false;
             tmiprint.Visible    = false;
         }
     }
 }
Esempio n. 4
0
 public override int Add( )
 {
     clearControl( );
     txtcode.Text = _bll.getCode( );
     if (getname != null && getname != "")
     {
         FishEntity.SalesRequisitionEntity _model = new FishEntity.SalesRequisitionEntity();
         _bll   = new FishBll.Bll.ReturnReceiptBll();
         _model = _bll.getTHD(getname);
         if (_model != null)
         {//22
             txtcodeNumContract.Text = _model.code;
             txtreturnParty.Text     = _model.demand;
             txtreturnParty.Tag      = _model.demandId;
             txtreturnPartyJ.Text    = _model.DemandAbbreviation;
             txtreceive.Text         = _model.supplier;
             txtreceiveJ.Text        = _model.SupplierAbbreviation;
             txtreceive.Tag          = _model.supplierId;
             txtfishId.Text          = _model.Product_id;
             txtcodeNum.Text         = _model.Numbering;
             txtcountry.Text         = _model.Country;
             txtbrand.Text           = _model.pp;
             txtspeci.Text           = _model.Funit;
             txtproName.Text         = _model.Productname;
             txtcondb.Text           = _model.Db;
             txtconza.Text           = _model.Za;
             txtcons.Text            = _model.Sz;
             txtcontvn.Text          = _model.Tvn;
             txtconhf.Text           = _model.Hf;
             txtconsf.Text           = _model.Sf;
             txtconshy.Text          = _model.Shy;
             txtconzf.Text           = _model.Zf;
             txtprice.Text           = _model.HeTongDanJia;
             txtdeliAdd.Text         = _model.delivery;
             if (_model.RabZy == true)
             {
                 rabchengpin.Visible = false;
             }
             panel1.Enabled = true;
         }
         if (getname != null && getname != "")
         {
             FishEntity.OnepoundEntity _modeloo = new FishEntity.OnepoundEntity();
             _bll     = new FishBll.Bll.ReturnReceiptBll();
             _modeloo = _bll.getjingz(getname);
             if (_modeloo != null)
             {
                 txtShipmentsTons.Text = _modeloo.Competition;
             }
         }
     }
     tmiSave.Visible = true;
     return(base.Add( ));
 }
Esempio n. 5
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex < 0 || e.RowIndex < 0)
     {
         return;
     }
     fish = new FishEntity.OnepoundEntity();
     if (dataGridView1.CurrentRow == null)
     {
         return;
     }
     if (dataGridView1.Rows[e.RowIndex].Cells["codeOne"].Value != null && dataGridView1.Columns[e.ColumnIndex].Name.Equals("codeOne", StringComparison.OrdinalIgnoreCase) == true)
     {
         fish.Competition  = dataGridView1.Rows[e.RowIndex].Cells["Competition"].Value.ToString();
         fish.Code         = dataGridView1.Rows[e.RowIndex].Cells["codeOne"].Value.ToString();
         fish.FishMealId   = dataGridView1.Rows[e.RowIndex].Cells["FishMealId"].Value.ToString();
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
     }
 }
Esempio n. 6
0
        public FishEntity.OnepoundEntity getjingz(string Numbering)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select SUM(Competition)as Competition from t_poundsalone ");
            strSql.Append("where Numbering= '" + Numbering + "'");
            DataSet ds = MySqlHelper.Query(strSql.ToString());

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                FishEntity.OnepoundEntity model = new FishEntity.OnepoundEntity();
                DataRow row = ds.Tables[0].Rows[0];
                if (row["Competition"] != null && row["Competition"].ToString() != "")
                {
                    model.Competition = row["Competition"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 7
0
        public bool Update(FishEntity.OnepoundEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update t_poundsalone set ");
            strSql.Append("Dateofmanufacture = @Dateofmanufacture,");
            strSql.Append("IntothefactoryDate = @IntothefactoryDate,");
            strSql.Append("Carnumber = @Carnumber,");
            strSql.Append("Grossweight = @Grossweight,");
            strSql.Append("Tareweight = @Tareweight,");
            strSql.Append("Competition = @Competition,");
            strSql.Append("Goods = @Goods,");
            strSql.Append("Remarks=@Remarks,");
            strSql.Append("Shipno=@Shipno,");
            strSql.Append("Owner = @Owner,");
            strSql.Append("OwnerId = @OwnerId,");
            strSql.Append("modifytime = @modifytime,");
            strSql.Append("modifyman = @modifyman,");
            strSql.Append("BuyersId = @BuyersId,");
            strSql.Append("Address = @Address,code = @code,");
            strSql.Append("Serialnumber = @Serialnumber,Buyers = @Buyers,");
            strSql.Append("Sellers = @Sellers,Country = @Country,");
            strSql.Append("PName = @PName,Qualit = @Qualit,");
            strSql.Append("Quantity = @Quantity,Pileangle = @Pileangle,");
            strSql.Append("BillOfLadingid = @BillOfLadingid,");
            strSql.Append("codeContract = @codeContract, ");
            strSql.Append("SellersId = @SellersId ");
            strSql.Append(" where id = @id");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Dateofmanufacture",  MySqlDbType.Timestamp),
                new MySqlParameter("@IntothefactoryDate", MySqlDbType.Timestamp),
                new MySqlParameter("@Carnumber",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Grossweight",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Tareweight",         MySqlDbType.VarChar,     45),
                new MySqlParameter("@Competition",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Goods",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Owner",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",         MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Address",            MySqlDbType.VarChar,    100),
                new MySqlParameter("@code",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@Serialnumber",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@Buyers",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@Sellers",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@Country",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@PName",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Qualit",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@Quantity",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Pileangle",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@BillOfLadingid",     MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",       MySqlDbType.VarChar,    200),
                new MySqlParameter("@id",                 MySqlDbType.Int16,       11),
                new MySqlParameter("@Remarks",            MySqlDbType.VarChar,    500),
                new MySqlParameter("@Shipno",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@OwnerId",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@BuyersId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@SellersId",          MySqlDbType.VarChar, 45)
            };
            parameters[0].Value  = model.Dateofmanufacture;
            parameters[1].Value  = model.IntothefactoryDate;
            parameters[2].Value  = model.Carnumber;
            parameters[3].Value  = model.Grossweight;
            parameters[4].Value  = model.Tareweight;
            parameters[5].Value  = model.Competition;
            parameters[6].Value  = model.Goods;
            parameters[7].Value  = model.Owner;
            parameters[8].Value  = model.Modifytime;
            parameters[9].Value  = model.Modifyman;
            parameters[10].Value = model.Address;
            parameters[11].Value = model.Code;
            parameters[12].Value = model.Serialnumber;
            parameters[13].Value = model.Buyers;
            parameters[14].Value = model.Sellers;
            parameters[15].Value = model.Country;
            parameters[16].Value = model.PName;
            parameters[17].Value = model.Qualit;
            parameters[18].Value = model.Quantity;
            parameters[19].Value = model.Pileangle;
            parameters[20].Value = model.BillOfLadingid;
            parameters[21].Value = model.codeContract;
            parameters[22].Value = model.Id;
            parameters[23].Value = model.Remarks;
            parameters[24].Value = model.Shipno;
            parameters[25].Value = model.OwnerId;
            parameters[26].Value = model.BuyersId;
            parameters[27].Value = model.SellersId;
            int rows = MySqlHelper.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 8
0
        public int Add(FishEntity.OnepoundEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into t_poundsalone(");
            strSql.Append("Numbering,code,Dateofmanufacture,IntothefactoryDate,Carnumber,Grossweight,Tareweight,Competition,Goods,Remarks,Shipno,Owner,OwnerId,createtime,createman,modifytime,modifyman,Address,Buyers,BuyersId,Sellers,SellersId,Country,PName,Qualit,Quantity,Pileangle,BillOfLadingid,Serialnumber,codeContract)");
            strSql.Append("values(");
            strSql.Append("@Numbering,@code,@Dateofmanufacture,@Intothefactorydate,@Carnumber,@Grossweight,@Tareweight,@Competition,@Goods,@Remarks,@Shipno,@Owner,@OwnerId,@createtime,@createman,@modifytime,@modifyman,@Address,@Buyers,@BuyersId,@Sellers,@SellersId,@Country,@PName,@Qualit,@Quantity,@Pileangle,@BillOfLadingid,@Serialnumber,@codeContract);");
            strSql.Append("select last_insert_id();");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@code",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@Dateofmanufacture",  MySqlDbType.Timestamp),
                new MySqlParameter("@IntothefactoryDate", MySqlDbType.Timestamp),
                new MySqlParameter("@Carnumber",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Grossweight",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Tareweight",         MySqlDbType.VarChar,     45),
                new MySqlParameter("@Competition",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Goods",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Owner",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@createtime",         MySqlDbType.Timestamp),
                new MySqlParameter("@createman",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",         MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Address",            MySqlDbType.VarChar,    100),
                new MySqlParameter("@Serialnumber",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@Buyers",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@Sellers",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@Country",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@PName",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Qualit",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@Quantity",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Pileangle",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@BillOfLadingid",     MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",       MySqlDbType.VarChar,    200),
                new MySqlParameter("@Remarks",            MySqlDbType.VarChar,    500),
                new MySqlParameter("@Shipno",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@OwnerId",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@BuyersId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@SellersId",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Numbering",          MySqlDbType.VarChar, 45)
            };
            parameters[0].Value  = model.Code;
            parameters[1].Value  = model.Dateofmanufacture;
            parameters[2].Value  = model.IntothefactoryDate;
            parameters[3].Value  = model.Carnumber;
            parameters[4].Value  = model.Grossweight;
            parameters[5].Value  = model.Tareweight;
            parameters[6].Value  = model.Competition;
            parameters[7].Value  = model.Goods;
            parameters[8].Value  = model.Owner;
            parameters[9].Value  = model.Createtime;
            parameters[10].Value = model.Createman;
            parameters[11].Value = model.Modifytime;
            parameters[12].Value = model.Modifyman;
            parameters[13].Value = model.Address;
            parameters[14].Value = model.Serialnumber;
            parameters[15].Value = model.Buyers;
            parameters[16].Value = model.Sellers;
            parameters[17].Value = model.Country;
            parameters[18].Value = model.PName;
            parameters[19].Value = model.Qualit;
            parameters[20].Value = model.Quantity;
            parameters[21].Value = model.Pileangle;
            parameters[22].Value = model.BillOfLadingid;
            parameters[23].Value = model.codeContract;
            parameters[24].Value = model.Remarks;
            parameters[25].Value = model.Shipno;
            parameters[26].Value = model.OwnerId;
            parameters[27].Value = model.BuyersId;
            parameters[28].Value = model.SellersId;
            parameters[29].Value = model.Numbering;
            int id = MySqlHelper.ExecuteSqlReturnId(strSql.ToString(), parameters); //MySqlHelper.ExecuteSql(strSql.ToString(), parameters);

            return(id);
        }
Esempio n. 9
0
        public override void Save()
        {
            FishEntity.OnepoundEntity _fish = new FishEntity.OnepoundEntity();
            _fish.Buyers = Buyers.Text;
            if (string.IsNullOrEmpty(Sellers.Text) == false)
            {
                FishEntity.CompanyEntity company = Sellers.Tag as FishEntity.CompanyEntity;
                _fish.Sellers = Sellers.Text.ToString();
            }
            else
            {
                MessageBox.Show("请选择销售商。");
                return;
            }
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return;
            }
            if (GetValue() == false)
            {
                return;
            }
            decimal temp = 0;

            _fish.Code               = FishBll.Bll.SequenceUtil.GerLadingNumber();
            _fish.OwnerId            = txtOwner.Tag.ToString();
            _fish.BuyersId           = Buyers.Tag.ToString();
            _fish.SellersId          = Sellers.Tag.ToString();
            _fish.Dateofmanufacture  = dtpfactureDate.Value;
            _fish.IntothefactoryDate = dtpfactoryDate.Value;
            _fish.Carnumber          = txtCarnumber.Text.Trim();
            _fish.Goods              = cmbspecies.SelectedValue == null ? string.Empty : cmbspecies.SelectedValue.ToString();
            _fish.Remarks            = txtRemarks.Text;
            _fish.Shipno             = txtshipno.Text;
            _fish.Grossweight        = txtGrossweight.Text;
            _fish.Tareweight         = txtTareweight.Text;
            _fish.Competition        = txtCompetition.Text;
            _fish.Owner              = txtOwner.Text.Trim();
            _fish.Quantity           = Quantity.Text.Trim();
            _fish.Pileangle          = Pileangle.Text.Trim();
            _fish.BillOfLadingid     = BillOfLadingid.Text.Trim();
            _fish.PName              = cmbName.SelectedValue == null ? string.Empty : cmbName.SelectedValue.ToString();
            _fish.Country            = cmbCountry.SelectedValue == null ? string.Empty : cmbCountry.SelectedValue.ToString();
            _fish.Qualit             = txtSpecification.Text;
            _fish.Serialnumber       = Serialnumber.Text.Trim();
            _fish.Address            = txtAddress.Text.Trim();
            _fish.Createtime         = DateTime.Now;
            _fish.Createman          = FishEntity.Variable.User.username;
            _fish.Modifytime         = DateTime.Now;
            _fish.Modifyman          = _fish.Createman;
            _fish.codeContract       = txtCodeOdd.Text;
            _fish.Numbering          = txtNumbering.Text;

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

            bool isok = bll.Exists(_fish.Code);

            while (isok)
            {
                _fish.Code = FishBll.Bll.SequenceUtil.GerLadingNumber();
                isok       = bll.Exists(_fish.Code);
            }
            int id = bll.Add(_fish);

            if (id > 0)
            {
                if (txtNumbering.Text != "")
                {
                    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                    _Refreshbll.GetFormOnepound(txtNumbering.Text);
                }
                _fish.Id = id;
                AddImages(_fish);
                tmiQuery.Visible  = false;
                tmiDelete.Visible = false;
                tmiModify.Visible = false;
                tmiAdd.Visible    = true;
                tmiSave.Visible   = false;
                tmiCancel.Visible = true;
                MessageBox.Show("添加成功。");
                txtCode.Text = _fish.Code.ToString();
            }
            else
            {
                // txtCode.Text = _fish.Code;
                MessageBox.Show("添加失败。");
            }
        }
Esempio n. 10
0
 public bool Update(FishEntity.OnepoundEntity model)
 {
     return dal.Update(model);
 }
Esempio n. 11
0
 public int Add(FishEntity.OnepoundEntity model,string name)
 {
     return dal . Add ( model ,name );
 }
Esempio n. 12
0
        public int Add(FishEntity.OnepoundEntity model, string name)
        {
            Hashtable SQLString = new Hashtable( );

            SQLString = ReviewInfo.getSQLString(name, model.Code, string.Empty, SQLString);

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into t_poundsalone(");
            strSql.Append("FishMealId,Numbering,code,Dateofmanufacture,IntothefactoryDate,Carnumber,Grossweight,Tareweight,Competition,TiDanCode,RedemptionWeight,Goods,Remarks,Shipno,Owner,OwnerId,createtime,createman,modifytime,modifyman,Address,Buyers,BuyersId,Sellers,SellersId,Country,PName,Qualit,Quantity,Pileangle,BillOfLadingid,Serialnumber,codeContract)");
            strSql.Append("values(");
            strSql.Append("@FishMealId,@Numbering,@code,@Dateofmanufacture,@Intothefactorydate,@Carnumber,@Grossweight,@Tareweight,@Competition,@TiDanCode,@RedemptionWeight,@Goods,@Remarks,@Shipno,@Owner,@OwnerId,@createtime,@createman,@modifytime,@modifyman,@Address,@Buyers,@BuyersId,@Sellers,@SellersId,@Country,@PName,@Qualit,@Quantity,@Pileangle,@BillOfLadingid,@Serialnumber,@codeContract);");
            //strSql.Append("select last_insert_id();");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@code",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@Dateofmanufacture",  MySqlDbType.Timestamp),
                new MySqlParameter("@IntothefactoryDate", MySqlDbType.Timestamp),
                new MySqlParameter("@Carnumber",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Grossweight",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Tareweight",         MySqlDbType.VarChar,     45),
                new MySqlParameter("@Competition",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Goods",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Owner",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@createtime",         MySqlDbType.Timestamp),
                new MySqlParameter("@createman",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",         MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Address",            MySqlDbType.VarChar,    100),
                new MySqlParameter("@Serialnumber",       MySqlDbType.VarChar,     45),
                new MySqlParameter("@Buyers",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@Sellers",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@Country",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@PName",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Qualit",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@Quantity",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Pileangle",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@BillOfLadingid",     MySqlDbType.VarChar,     45),
                new MySqlParameter("@codeContract",       MySqlDbType.VarChar,    200),
                new MySqlParameter("@Remarks",            MySqlDbType.VarChar,    500),
                new MySqlParameter("@Shipno",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@OwnerId",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@BuyersId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@SellersId",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Numbering",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@FishMealId",         MySqlDbType.VarChar,     50),
                new MySqlParameter("@TiDanCode",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@RedemptionWeight",   MySqlDbType.Decimal, 45)
            };
            parameters[0].Value  = model.Code;
            parameters[1].Value  = model.Dateofmanufacture;
            parameters[2].Value  = model.IntothefactoryDate;
            parameters[3].Value  = model.Carnumber;
            parameters[4].Value  = model.Grossweight;
            parameters[5].Value  = model.Tareweight;
            parameters[6].Value  = model.Competition;
            parameters[7].Value  = model.Goods;
            parameters[8].Value  = model.Owner;
            parameters[9].Value  = model.Createtime;
            parameters[10].Value = model.Createman;
            parameters[11].Value = model.Modifytime;
            parameters[12].Value = model.Modifyman;
            parameters[13].Value = model.Address;
            parameters[14].Value = model.Serialnumber;
            parameters[15].Value = model.Buyers;
            parameters[16].Value = model.Sellers;
            parameters[17].Value = model.Country;
            parameters[18].Value = model.PName;
            parameters[19].Value = model.Qualit;
            parameters[20].Value = model.Quantity;
            parameters[21].Value = model.Pileangle;
            parameters[22].Value = model.BillOfLadingid;
            parameters[23].Value = model.codeContract;
            parameters[24].Value = model.Remarks;
            parameters[25].Value = model.Shipno;
            parameters[26].Value = model.OwnerId;
            parameters[27].Value = model.BuyersId;
            parameters[28].Value = model.SellersId;
            parameters[29].Value = model.Numbering;
            parameters[30].Value = model.FishMealId;
            parameters[31].Value = model.TiDanCode;
            parameters[32].Value = model.RedemptionWeight;
            SQLString.Add(strSql, parameters);
            if (MySqlHelper.ExecuteSqlTran(SQLString))
            {
                strSql = new StringBuilder( );
                strSql.AppendFormat("select id from t_poundsalone where code='{0}'", model.Code);

                DataTable dt = MySqlHelper.Query(strSql.ToString( )).Tables [0];
                if (dt != null && dt.Rows.Count > 0)
                {
                    return(string.IsNullOrEmpty(dt.Rows [0] ["id"].ToString( )) == true ? 0 : Convert.ToInt32(dt.Rows [0] ["id"].ToString( )));
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(0);
            }
        }
Esempio n. 13
0
 public int Add(FishEntity.OnepoundEntity model)
 {
     return(dal.Add(model));
 }