protected void QueryOne(string operate, string orderBy) { string whereEx = string.Empty; if (string.IsNullOrEmpty(_where)) { whereEx = " 1=1 "; } else { whereEx = _where; } if (_entity != null) { whereEx += " and code " + operate + _entity.code; } List <FishEntity.HomemadeStorageEntity> list = _bll.GetModelList(whereEx + orderBy); if (list == null || list.Count < 1) { MessageBox.Show("已经没有记录了!"); return; } panel1.Enabled = true; _entity = list[0]; SetEntity(); }
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; }
protected void ClearContent() { _entity = null; errorProvider1.Clear(); txtCode.Text = string.Empty; txtFishCode.Text = string.Empty; txtFishCode.Tag = string.Empty; txtfishname.Text = string.Empty; txtgrossweight.Text = "0.00"; txttureweight.Text = "0.00"; txtnetweight.Text = "0.00"; dtpIntime.Value = DateTime.Now; dtpOuttime.Value = DateTime.Now; txtSeq.Text = string.Empty; txtpackagenum.Text = "0"; txtunitprice.Text = "0.00"; txtsgs_amine.Text = "0"; txtsgs_fat.Text = "0.00"; txtsgs_ffa.Text = "0.00"; txtsgs_graypart.Text = "0.00"; txtsgs_protein.Text = "0.00"; txtsgs_sand.Text = "0.00"; txtsgs_sandsalt.Text = "0.00"; txtsgs_tvn.Text = "0"; txtsgs_water.Text = "0.00"; txtlabel_lysine.Text = "0.00"; txtlabel_methionine.Text = "0.00"; txtdomestic_graypart.Text = "0.00"; txtdomestic_lysine.Text = "0.00"; txtdomestic_methionine.Text = "0.00"; txtdomestic_protein.Text = "0.00"; txtdomestic_sandsalt.Text = "0.00"; txtdomestic_sour.Text = "0.00"; txtdomestic_tvn.Text = "0"; dtpStorageDate.Value = DateTime.Now; txtweight.Text = "0.00"; txtquantity.Text = "0"; txtsaleprice.Text = "0.00"; txtselfprice.Text = "0.00"; txtpurposeman.Text = string.Empty; txtpurposeman.Tag = "0"; txtdeliveryman.Text = string.Empty; txtdeliveryman.Tag = "0"; }
public override int Delete() { if (_entity == null) { return(0); } string msg = string.Format("你确定要删除自制仓入库单号为【{0}】的记录吗?", _entity.code); if (MessageBox.Show(msg, "询问", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return(0); } bool isok = _bll.Delete(_entity.id); if (isok) { //更新 鱼粉 的自制仓 成本,数量 , 重量 //FishBll.Bll.ProductBll productBll = new FishBll.Bll.ProductBll(); //decimal cost = - _entity.packages.Value * _entity.unitprice.Value; //decimal weight = - _entity.netweight.Value; //int number = -_entity.packages.Value; //isok = productBll.UpdateHomemade(_entity.productid.Value, weight , cost, number); //更新鱼粉资料 的自制仓入库重量数量,采购单价=0,销售单价=0,入库时间="" FishBll.Bll.ProductExBll productexBll = new FishBll.Bll.ProductExBll(); decimal storageweight = -_entity.storageweight; int storagequantity = -_entity.storagequantity; decimal selfprice = 0.00m; decimal saleprice = 0.00m; string storagetime = string.Empty; productexBll.UpdateHomeMadeInfo(_entity.productid.Value, storageweight, storagequantity, selfprice, saleprice, storagetime); // // _entity = null; ClearContent(); Query(); } else { } return(1); }
/// <summary> /// 得到一个对象实体 /// </summary> public FishEntity.HomemadeStorageEntity GetModel(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select id,code,seq,productid,productcode,productname,intime,outtime,grossweight,tareweight,netweight,packages,unitprice,sgs_protein,sgs_tvn,sgs_graypart,sgs_sandsalt,sgs_amine,sgs_ffa,sgs_fat,sgs_water,sgs_sand,label_lysine,label_methionine,domestic_protein,domestic_tvn,domestic_graypart,domestic_sandsalt,domestic_sour,domestic_lysine,domestic_methionine,createman,createtime,modifyman,modifytime,isdelete,selfprice,saleprice,purchasemanid,purchaseman,storagemanid,storageman,storageweight,storagequantity,storagetime from t_homemadestorage "); strSql.Append(" where id=@id"); MySqlParameter[] parameters = { new MySqlParameter("@id", MySqlDbType.Int32) }; parameters[0].Value = id; FishEntity.HomemadeStorageEntity model = new FishEntity.HomemadeStorageEntity(); DataSet ds = MySqlHelper.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(FishEntity.HomemadeStorageEntity model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into t_homemadestorage("); strSql.Append("code,seq,productid,productcode,productname,intime,outtime,grossweight,tareweight,netweight,packages,unitprice,sgs_protein,sgs_tvn,sgs_graypart,sgs_sandsalt,sgs_amine,sgs_ffa,sgs_fat,sgs_water,sgs_sand,label_lysine,label_methionine,domestic_protein,domestic_tvn,domestic_graypart,domestic_sandsalt,domestic_sour,domestic_lysine,domestic_methionine,createman,createtime,modifyman,modifytime,isdelete,selfprice,saleprice,purchasemanid,purchaseman,storagemanid,storageman,storageweight,storagequantity,storagetime )"); strSql.Append(" values ("); strSql.Append("@code,@seq,@productid,@productcode,@productname,@intime,@outtime,@grossweight,@tareweight,@netweight,@packages,@unitprice,@sgs_protein,@sgs_tvn,@sgs_graypart,@sgs_sandsalt,@sgs_amine,@sgs_ffa,@sgs_fat,@sgs_water,@sgs_sand,@label_lysine,@label_methionine,@domestic_protein,@domestic_tvn,@domestic_graypart,@domestic_sandsalt,@domestic_sour,@domestic_lysine,@domestic_methionine,@createman,@createtime,@modifyman,@modifytime,@isdelete,@selfprice,@saleprice,@purchasemanid,@purchaseman,@storagemanid,@storageman,@storageweight,@storagequantity,@storagetime);"); strSql.Append("select LAST_INSERT_ID();"); MySqlParameter[] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@seq", MySqlDbType.VarChar, 45), new MySqlParameter("@productid", MySqlDbType.Int32, 11), new MySqlParameter("@productcode", MySqlDbType.VarChar, 45), new MySqlParameter("@productname", MySqlDbType.VarChar, 45), new MySqlParameter("@intime", MySqlDbType.Timestamp), new MySqlParameter("@outtime", MySqlDbType.Timestamp), new MySqlParameter("@grossweight", MySqlDbType.Decimal, 12), new MySqlParameter("@tareweight", MySqlDbType.Decimal, 12), new MySqlParameter("@netweight", MySqlDbType.Decimal, 12), new MySqlParameter("@packages", MySqlDbType.Int32, 11), new MySqlParameter("@unitprice", MySqlDbType.Decimal, 12), new MySqlParameter("@sgs_protein", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_tvn", MySqlDbType.Int32, 8), new MySqlParameter("@sgs_graypart", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_sandsalt", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_amine", MySqlDbType.Int32, 8), new MySqlParameter("@sgs_ffa", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_fat", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_water", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_sand", MySqlDbType.Decimal, 6), new MySqlParameter("@label_lysine", MySqlDbType.Decimal, 6), new MySqlParameter("@label_methionine", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_protein", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_tvn", MySqlDbType.Int32, 8), new MySqlParameter("@domestic_graypart", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_sandsalt", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_sour", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_lysine", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_methionine", MySqlDbType.Decimal, 6), new MySqlParameter("@createman", MySqlDbType.VarChar, 45), new MySqlParameter("@createtime", MySqlDbType.Timestamp), new MySqlParameter("@modifyman", MySqlDbType.VarChar, 45), new MySqlParameter("@modifytime", MySqlDbType.Timestamp), new MySqlParameter("@isdelete", MySqlDbType.Int16, 2), new MySqlParameter("@selfprice", MySqlDbType.Decimal, 20), new MySqlParameter("@saleprice", MySqlDbType.Decimal, 20), new MySqlParameter("@purchasemanid", MySqlDbType.Int32, 11), new MySqlParameter("@purchaseman", MySqlDbType.VarChar, 45), new MySqlParameter("@storagemanid", MySqlDbType.Int32, 11), new MySqlParameter("@storageman", MySqlDbType.VarChar, 45), new MySqlParameter("@storageweight", MySqlDbType.Decimal, 12), new MySqlParameter("@storagequantity", MySqlDbType.Int32, 11), new MySqlParameter("@storagetime", MySqlDbType.Timestamp) }; parameters[0].Value = model.code; parameters[1].Value = model.seq; parameters[2].Value = model.productid; parameters[3].Value = model.productcode; parameters[4].Value = model.productname; parameters[5].Value = model.intime; parameters[6].Value = model.outtime; parameters[7].Value = model.grossweight; parameters[8].Value = model.tareweight; parameters[9].Value = model.netweight; parameters[10].Value = model.packages; parameters[11].Value = model.unitprice; parameters[12].Value = model.sgs_protein; parameters[13].Value = model.sgs_tvn; parameters[14].Value = model.sgs_graypart; parameters[15].Value = model.sgs_sandsalt; parameters[16].Value = model.sgs_amine; parameters[17].Value = model.sgs_ffa; parameters[18].Value = model.sgs_fat; parameters[19].Value = model.sgs_water; parameters[20].Value = model.sgs_sand; parameters[21].Value = model.label_lysine; parameters[22].Value = model.label_methionine; parameters[23].Value = model.domestic_protein; parameters[24].Value = model.domestic_tvn; parameters[25].Value = model.domestic_graypart; parameters[26].Value = model.domestic_sandsalt; parameters[27].Value = model.domestic_sour; parameters[28].Value = model.domestic_lysine; parameters[29].Value = model.domestic_methionine; parameters[30].Value = model.createman; parameters[31].Value = model.createtime; parameters[32].Value = model.modifyman; parameters[33].Value = model.modifytime; parameters[34].Value = model.isdelete; parameters[35].Value = model.selfprice; parameters[36].Value = model.saleprice; parameters[37].Value = model.purchasemanid; parameters[38].Value = model.purchaseman; parameters[39].Value = model.storagemanid; parameters[40].Value = model.storageman; parameters[41].Value = model.storageweight; parameters[42].Value = model.storagequantity; parameters[43].Value = model.storagetime; int id = MySqlHelper.ExecuteSqlReturnId(strSql.ToString(), parameters); return(id); }
/// <summary> /// 得到一个对象实体 /// </summary> public FishEntity.HomemadeStorageEntity DataRowToModel(DataRow row) { FishEntity.HomemadeStorageEntity model = new FishEntity.HomemadeStorageEntity(); if (row != null) { if (row["id"] != null && row["id"].ToString() != "") { model.id = int.Parse(row["id"].ToString()); } if (row["code"] != null) { model.code = row["code"].ToString(); } if (row["seq"] != null) { model.seq = row["seq"].ToString(); } if (row["productid"] != null && row["productid"].ToString() != "") { model.productid = int.Parse(row["productid"].ToString()); } if (row["productcode"] != null) { model.productcode = row["productcode"].ToString(); } if (row["productname"] != null) { model.productname = row["productname"].ToString(); } if (row["intime"] != null && row["intime"].ToString() != "") { model.intime = DateTime.Parse(row["intime"].ToString()); } if (row["outtime"] != null && row["outtime"].ToString() != "") { model.outtime = DateTime.Parse(row["outtime"].ToString()); } if (row["grossweight"] != null && row["grossweight"].ToString() != "") { model.grossweight = decimal.Parse(row["grossweight"].ToString()); } if (row["tareweight"] != null && row["tareweight"].ToString() != "") { model.tareweight = decimal.Parse(row["tareweight"].ToString()); } if (row["netweight"] != null && row["netweight"].ToString() != "") { model.netweight = decimal.Parse(row["netweight"].ToString()); } if (row["packages"] != null && row["packages"].ToString() != "") { model.packages = int.Parse(row["packages"].ToString()); } if (row["unitprice"] != null && row["unitprice"].ToString() != "") { model.unitprice = decimal.Parse(row["unitprice"].ToString()); } if (row["sgs_protein"] != null && row["sgs_protein"].ToString() != "") { model.sgs_protein = decimal.Parse(row["sgs_protein"].ToString()); } if (row["sgs_tvn"] != null && row["sgs_tvn"].ToString() != "") { model.sgs_tvn = int.Parse(row["sgs_tvn"].ToString()); } if (row["sgs_graypart"] != null && row["sgs_graypart"].ToString() != "") { model.sgs_graypart = decimal.Parse(row["sgs_graypart"].ToString()); } if (row["sgs_sandsalt"] != null && row["sgs_sandsalt"].ToString() != "") { model.sgs_sandsalt = decimal.Parse(row["sgs_sandsalt"].ToString()); } if (row["sgs_amine"] != null && row["sgs_amine"].ToString() != "") { model.sgs_amine = int.Parse(row["sgs_amine"].ToString()); } if (row["sgs_ffa"] != null && row["sgs_ffa"].ToString() != "") { model.sgs_ffa = decimal.Parse(row["sgs_ffa"].ToString()); } if (row["sgs_fat"] != null && row["sgs_fat"].ToString() != "") { model.sgs_fat = decimal.Parse(row["sgs_fat"].ToString()); } if (row["sgs_water"] != null && row["sgs_water"].ToString() != "") { model.sgs_water = decimal.Parse(row["sgs_water"].ToString()); } if (row["sgs_sand"] != null && row["sgs_sand"].ToString() != "") { model.sgs_sand = decimal.Parse(row["sgs_sand"].ToString()); } if (row["label_lysine"] != null && row["label_lysine"].ToString() != "") { model.label_lysine = decimal.Parse(row["label_lysine"].ToString()); } if (row["label_methionine"] != null && row["label_methionine"].ToString() != "") { model.label_methionine = decimal.Parse(row["label_methionine"].ToString()); } if (row["domestic_protein"] != null && row["domestic_protein"].ToString() != "") { model.domestic_protein = decimal.Parse(row["domestic_protein"].ToString()); } if (row["domestic_tvn"] != null && row["domestic_tvn"].ToString() != "") { model.domestic_tvn = int.Parse(row["domestic_tvn"].ToString()); } if (row["domestic_graypart"] != null && row["domestic_graypart"].ToString() != "") { model.domestic_graypart = decimal.Parse(row["domestic_graypart"].ToString()); } if (row["domestic_sandsalt"] != null && row["domestic_sandsalt"].ToString() != "") { model.domestic_sandsalt = decimal.Parse(row["domestic_sandsalt"].ToString()); } if (row["domestic_sour"] != null && row["domestic_sour"].ToString() != "") { model.domestic_sour = decimal.Parse(row["domestic_sour"].ToString()); } if (row["domestic_lysine"] != null && row["domestic_lysine"].ToString() != "") { model.domestic_lysine = decimal.Parse(row["domestic_lysine"].ToString()); } if (row["domestic_methionine"] != null && row["domestic_methionine"].ToString() != "") { model.domestic_methionine = decimal.Parse(row["domestic_methionine"].ToString()); } if (row["createman"] != null) { model.createman = row["createman"].ToString(); } if (row["createtime"] != null && row["createtime"].ToString() != "") { model.createtime = DateTime.Parse(row["createtime"].ToString()); } if (row["modifyman"] != null) { model.modifyman = row["modifyman"].ToString(); } if (row["modifytime"] != null && row["modifytime"].ToString() != "") { model.modifytime = DateTime.Parse(row["modifytime"].ToString()); } if (row["isdelete"] != null && row["isdelete"].ToString() != "") { model.isdelete = int.Parse(row["isdelete"].ToString()); } if (row["selfprice"] != null && row["selfprice"].ToString() != "") { model.selfprice = decimal.Parse(row["selfprice"].ToString()); } if (row["saleprice"] != null && row["saleprice"].ToString() != "") { model.saleprice = decimal.Parse(row["saleprice"].ToString()); } if (row["purchasemanid"] != null && row["purchasemanid"].ToString() != "") { model.purchasemanid = int.Parse(row["purchasemanid"].ToString()); } if (row["purchaseman"] != null) { model.purchaseman = row["purchaseman"].ToString(); } if (row["storagemanid"] != null && row["storagemanid"].ToString() != "") { model.storagemanid = int.Parse(row["storagemanid"].ToString()); } if (row["storageman"] != null) { model.storageman = row["storageman"].ToString(); } if (row["storageweight"] != null && row["storageweight"].ToString() != "") { model.storageweight = decimal.Parse(row["storageweight"].ToString()); } if (row["storagequantity"] != null && row["storagequantity"].ToString() != "") { model.storagequantity = int.Parse(row["storagequantity"].ToString()); } if (row["storagetime"] != null && row["storagetime"].ToString() != "") { model.storagetime = DateTime.Parse(row["storagetime"].ToString()); } } return(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(FishEntity.HomemadeStorageEntity model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update t_homemadestorage set "); strSql.Append("code=@code,"); strSql.Append("seq=@seq,"); strSql.Append("productid=@productid,"); strSql.Append("productcode=@productcode,"); strSql.Append("productname=@productname,"); strSql.Append("grossweight=@grossweight,"); strSql.Append("tareweight=@tareweight,"); strSql.Append("netweight=@netweight,"); strSql.Append("packages=@packages,"); strSql.Append("unitprice=@unitprice,"); strSql.Append("sgs_protein=@sgs_protein,"); strSql.Append("sgs_tvn=@sgs_tvn,"); strSql.Append("sgs_graypart=@sgs_graypart,"); strSql.Append("sgs_sandsalt=@sgs_sandsalt,"); strSql.Append("sgs_amine=@sgs_amine,"); strSql.Append("sgs_ffa=@sgs_ffa,"); strSql.Append("sgs_fat=@sgs_fat,"); strSql.Append("sgs_water=@sgs_water,"); strSql.Append("sgs_sand=@sgs_sand,"); strSql.Append("label_lysine=@label_lysine,"); strSql.Append("label_methionine=@label_methionine,"); strSql.Append("domestic_protein=@domestic_protein,"); strSql.Append("domestic_tvn=@domestic_tvn,"); strSql.Append("domestic_graypart=@domestic_graypart,"); strSql.Append("domestic_sandsalt=@domestic_sandsalt,"); strSql.Append("domestic_sour=@domestic_sour,"); strSql.Append("domestic_lysine=@domestic_lysine,"); strSql.Append("domestic_methionine=@domestic_methionine,"); strSql.Append("createman=@createman,"); strSql.Append("modifyman=@modifyman,"); strSql.Append("isdelete=@isdelete,"); strSql.Append("selfprice=@selfprice,"); strSql.Append("saleprice=@saleprice,"); strSql.Append("purchasemanid=@purchasemanid,"); strSql.Append("purchaseman=@purchaseman,"); strSql.Append("storagemanid=@storagemanid,"); strSql.Append("storageman=@storageman,"); strSql.Append("storageweight=@storageweight,"); strSql.Append("storagequantity=@storagequantity,"); strSql.Append("storagetime=@storagetime"); strSql.Append(" where id=@id"); MySqlParameter[] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@seq", MySqlDbType.VarChar, 45), new MySqlParameter("@productid", MySqlDbType.Int32, 11), new MySqlParameter("@productcode", MySqlDbType.VarChar, 45), new MySqlParameter("@productname", MySqlDbType.VarChar, 45), new MySqlParameter("@grossweight", MySqlDbType.Decimal, 12), new MySqlParameter("@tareweight", MySqlDbType.Decimal, 12), new MySqlParameter("@netweight", MySqlDbType.Decimal, 12), new MySqlParameter("@packages", MySqlDbType.Int32, 11), new MySqlParameter("@unitprice", MySqlDbType.Decimal, 12), new MySqlParameter("@sgs_protein", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_tvn", MySqlDbType.Int32, 8), new MySqlParameter("@sgs_graypart", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_sandsalt", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_amine", MySqlDbType.Int32, 8), new MySqlParameter("@sgs_ffa", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_fat", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_water", MySqlDbType.Decimal, 6), new MySqlParameter("@sgs_sand", MySqlDbType.Decimal, 6), new MySqlParameter("@label_lysine", MySqlDbType.Decimal, 6), new MySqlParameter("@label_methionine", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_protein", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_tvn", MySqlDbType.Int32, 8), new MySqlParameter("@domestic_graypart", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_sandsalt", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_sour", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_lysine", MySqlDbType.Decimal, 6), new MySqlParameter("@domestic_methionine", MySqlDbType.Decimal, 6), new MySqlParameter("@createman", MySqlDbType.VarChar, 45), new MySqlParameter("@modifyman", MySqlDbType.VarChar, 45), new MySqlParameter("@isdelete", MySqlDbType.Int16, 2), new MySqlParameter("@selfprice", MySqlDbType.Decimal, 10), new MySqlParameter("@saleprice", MySqlDbType.Decimal, 6), new MySqlParameter("@purchasemanid", MySqlDbType.Int32, 11), new MySqlParameter("@purchaseman", MySqlDbType.VarChar, 45), new MySqlParameter("@storagemanid", MySqlDbType.Int32, 11), new MySqlParameter("@storageman", MySqlDbType.VarChar, 45), new MySqlParameter("@storageweight", MySqlDbType.Decimal, 12), new MySqlParameter("@storagequantity", MySqlDbType.Int32, 11), new MySqlParameter("@storagetime", MySqlDbType.Timestamp), new MySqlParameter("@id", MySqlDbType.Int32, 11) }; parameters[0].Value = model.code; parameters[1].Value = model.seq; parameters[2].Value = model.productid; parameters[3].Value = model.productcode; parameters[4].Value = model.productname; parameters[5].Value = model.grossweight; parameters[6].Value = model.tareweight; parameters[7].Value = model.netweight; parameters[8].Value = model.packages; parameters[9].Value = model.unitprice; parameters[10].Value = model.sgs_protein; parameters[11].Value = model.sgs_tvn; parameters[12].Value = model.sgs_graypart; parameters[13].Value = model.sgs_sandsalt; parameters[14].Value = model.sgs_amine; parameters[15].Value = model.sgs_ffa; parameters[16].Value = model.sgs_fat; parameters[17].Value = model.sgs_water; parameters[18].Value = model.sgs_sand; parameters[19].Value = model.label_lysine; parameters[20].Value = model.label_methionine; parameters[21].Value = model.domestic_protein; parameters[22].Value = model.domestic_tvn; parameters[23].Value = model.domestic_graypart; parameters[24].Value = model.domestic_sandsalt; parameters[25].Value = model.domestic_sour; parameters[26].Value = model.domestic_lysine; parameters[27].Value = model.domestic_methionine; parameters[28].Value = model.createman; parameters[29].Value = model.modifyman; parameters[30].Value = model.isdelete; parameters[31].Value = model.selfprice; parameters[32].Value = model.saleprice; parameters[33].Value = model.purchasemanid; parameters[34].Value = model.purchaseman; parameters[35].Value = model.storagemanid; parameters[36].Value = model.storageman; parameters[37].Value = model.storageweight; parameters[38].Value = model.storagequantity; parameters[39].Value = model.storagetime; parameters[40].Value = model.id; int rows = MySqlHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(FishEntity.HomemadeStorageEntity model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(FishEntity.HomemadeStorageEntity model) { return(dal.Add(model)); }