/// <summary> /// 增加数据 /// </summary> /// <param name="_model"></param> /// <param name="_modelsList"></param> /// <returns></returns> public bool Add(FishEntity.BatchSheetEntity _model, List <FishEntity.BatchSheetsEntity> _modelsList, string name) { Hashtable SQLString = new Hashtable( ); SQLString = ReviewInfo.getSQLString(name, _model.code, string.Empty, SQLString); StringBuilder strSql = new StringBuilder( ); strSql.Append("insert into t_batchsheet("); strSql.Append("code,productionDate)"); strSql.Append(" values ("); strSql.Append("@code,@productionDate)"); MySqlParameter [] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@productionDate", MySqlDbType.Date) }; parameters [0].Value = _model.code; parameters [1].Value = _model.productionDate; SQLString.Add(strSql, parameters); foreach (FishEntity.BatchSheetsEntity model in _modelsList) { add(SQLString, strSql, model); } return(MySqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(FishEntity.OutboundOrderEntity 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_outboundorder("); strSql.Append("seNumber,code,unit,type,shipName,weight,pileNum,codeNum,codeNumContract,date,waseHouse,speci,billName,pageNum,remark,notice,ware,receive,FishMealId,Country,Brands)"); strSql.Append(" values ("); strSql.Append("@seNumber,@code,@unit,@type,@shipName,@weight,@pileNum,@codeNum,@codeNumContract,@date,@waseHouse,@speci,@billName,@pageNum,@remark,@notice,@ware,@receive,@FishMealId,@Country,@Brands)"); MySqlParameter [] parameters = { new MySqlParameter("@seNumber", MySqlDbType.VarChar, 45), new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@unit", MySqlDbType.VarChar, 45), new MySqlParameter("@type", MySqlDbType.VarChar, 45), new MySqlParameter("@shipName", MySqlDbType.VarChar, 45), new MySqlParameter("@weight", MySqlDbType.Decimal, 10), new MySqlParameter("@pileNum", MySqlDbType.VarChar, 45), new MySqlParameter("@codeNum", MySqlDbType.VarChar, 45), new MySqlParameter("@codeNumContract", MySqlDbType.VarChar, 45), new MySqlParameter("@date", MySqlDbType.Date), new MySqlParameter("@waseHouse", MySqlDbType.VarChar, 45), new MySqlParameter("@speci", MySqlDbType.VarChar, 45), new MySqlParameter("@billName", MySqlDbType.VarChar, 45), new MySqlParameter("@pageNum", MySqlDbType.Int32, 11), new MySqlParameter("@remark", MySqlDbType.VarChar, 225), new MySqlParameter("@notice", MySqlDbType.VarChar, 45), new MySqlParameter("@ware", MySqlDbType.Decimal, 10), new MySqlParameter("@receive", MySqlDbType.VarChar, 45), new MySqlParameter("@FishMealId", MySqlDbType.VarChar, 50), new MySqlParameter("@Country", MySqlDbType.VarChar, 50), new MySqlParameter("@Brands", MySqlDbType.VarChar, 50) }; parameters [0].Value = model.seNumber; parameters [1].Value = model.code; parameters [2].Value = model.unit; parameters [3].Value = model.type; parameters [4].Value = model.shipName; parameters [5].Value = model.weight; parameters [6].Value = model.pileNum; parameters [7].Value = model.codeNum; parameters [8].Value = model.codeNumContract; parameters [9].Value = model.date; parameters [10].Value = model.waseHouse; parameters [11].Value = model.speci; parameters [12].Value = model.billName; parameters [13].Value = model.pageNum; parameters [14].Value = model.remark; parameters [15].Value = model.notice; parameters [16].Value = model.ware; parameters [17].Value = model.receive; parameters [18].Value = model.FishMealId; parameters [19].Value = model.Country; parameters [20].Value = model.Brands; SQLString.Add(strSql, parameters); return(MySqlHelper.ExecuteSqlTran(SQLString)); }
/// <summary> /// 保存一条记录 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Save(FishEntity.CustomStandardTableEntity 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_customstandardtable("); strSql.Append("code,ash,protein,xd,fat,ffa,water,histamine,shy,level,fishId,xsCode,TVN)"); strSql.Append(" values ("); strSql.Append("@code,@ash,@protein,@xd,@fat,@ffa,@water,@histamine,@shy,@level,@fishId,@xsCode,@TVN)"); MySqlParameter [] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@ash", MySqlDbType.VarChar, 45), new MySqlParameter("@protein", MySqlDbType.VarChar, 45), new MySqlParameter("@xd", MySqlDbType.VarChar, 45), new MySqlParameter("@fat", MySqlDbType.VarChar, 45), new MySqlParameter("@ffa", MySqlDbType.VarChar, 45), new MySqlParameter("@water", MySqlDbType.VarChar, 45), new MySqlParameter("@histamine", MySqlDbType.VarChar, 45), new MySqlParameter("@shy", MySqlDbType.VarChar, 45), new MySqlParameter("@level", MySqlDbType.VarChar, 45), new MySqlParameter("@fishId", MySqlDbType.VarChar, 45), new MySqlParameter("@xsCode", MySqlDbType.VarChar, 45), new MySqlParameter("@TVN", MySqlDbType.VarChar, 45) }; parameters [0].Value = model.code; parameters [1].Value = model.ash; parameters [2].Value = model.protein; parameters [3].Value = model.xd; parameters [4].Value = model.fat; parameters [5].Value = model.ffa; parameters [6].Value = model.water; parameters [7].Value = model.histamine; parameters [8].Value = model.shy; parameters [9].Value = model.level; parameters [10].Value = model.fishId; parameters [11].Value = model.xsCode; parameters[12].Value = model.TVN; SQLString.Add(strSql, parameters); return(MySqlHelper.ExecuteSqlTran(SQLString)); }
public int Add(FishEntity.TheproblemsheetEntity 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_theproblemsheet(Numbering,code, ContractNo, occurDate, EventName, SolvTtheProblem, Remarks, createtime, createman, modifytime, modifyman,codeContract,Chargeback,FishMealId) "); strSql.Append("values(@Numbering,@code, @ContractNo, @occurDate, @EventName, @SolvTtheProblem, @Remarks, @createtime, @createman, @modifytime, @modifyman,@codeContract,@Chargeback,@FishMealId); "); //select last_insert_id(); MySqlParameter [] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@ContractNo", MySqlDbType.VarChar, 45), new MySqlParameter("@occurDate", MySqlDbType.DateTime), new MySqlParameter("@EventName", MySqlDbType.VarChar, 500), new MySqlParameter("@SolvTtheProblem", MySqlDbType.VarChar, 500), new MySqlParameter("@Remarks", MySqlDbType.VarChar, 500), new MySqlParameter("@createtime", MySqlDbType.Timestamp), new MySqlParameter("@createman", MySqlDbType.VarChar, 45), new MySqlParameter("@modifytime", MySqlDbType.Timestamp), new MySqlParameter("@modifyman", MySqlDbType.VarChar, 45), new MySqlParameter("@codeContract", MySqlDbType.VarChar, 200), new MySqlParameter("@Chargeback", MySqlDbType.Decimal, 45), new MySqlParameter("@Numbering", MySqlDbType.VarChar, 45), new MySqlParameter("@FishMealId", MySqlDbType.VarChar, 50) }; parameters [0].Value = model.Code; parameters [1].Value = model.ContractNo; parameters [2].Value = model.OccurDate; parameters [3].Value = model.EventName; parameters [4].Value = model.SolvTtheProblem; parameters [5].Value = model.Remarks; parameters [6].Value = model.Createtime; parameters [7].Value = model.Createman; parameters [8].Value = model.Modifytime; parameters [9].Value = model.Modifyman; parameters [10].Value = model.codeContract; parameters [11].Value = model.Chargeback; parameters [12].Value = model.Numbering; parameters [13].Value = model.FishMealId; SQLString.Add(strSql, parameters); if (MySqlHelper.ExecuteSqlTran(SQLString)) { strSql = new StringBuilder( ); strSql.AppendFormat("select id,code from t_theproblemsheet where code='{0}'", model.Code); DataTable dt = MySqlHelper.Query(strSql.ToString( )).Tables [0]; if (model.Chargeback == 0 && dt.Rows[0]["code"].ToString() != "") { StringBuilder strSql1 = new StringBuilder(); strSql1.AppendFormat("insert into t_review (userName,programId,SingleNumber,date,content,state,userNameReview,Numbering) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", FishEntity.Variable.User.username, name, dt.Rows[0]["code"].ToString(), DateTime.Now, "自动审核", "审核", "自动审核", model.Numbering); MySqlHelper.ExecuteSqlReturnId(strSql1.ToString(), null); } 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); } }
/// <summary> /// 增加数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Add(FishEntity.FinishedProListEntity model, string name) { Hashtable SQLString = new Hashtable( ); Hashtable SQLStringone = new Hashtable(); SQLString = ReviewInfo.getSQLString(name, model.code, string.Empty, SQLString); StringBuilder strSql = new StringBuilder( ); strSql.Append("insert into t_finishedprolist("); strSql.Append("code,plCode,date,country,brand,fishId,price,qualitySpe,goods,tons,protein,tvn,salt,acid,ash,histamine,las,das,remark,zf,shipname,zjh,billName,CkCode,FFA,ajs,Number,zidingyi,saleCompany,saleLinkman)"); strSql.Append(" values ("); strSql.Append("@code,@plCode,@date,@country,@brand,@fishId,@price,@qualitySpe,@goods,@tons,@protein,@tvn,@salt,@acid,@ash,@histamine,@las,@das,@remark,@zf,@shipname,@zjh,@billName,@CkCode,@FFA,@ajs,@Number,@zidingyi,@saleCompany,@saleLinkman)"); MySqlParameter [] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@plCode", MySqlDbType.VarChar, 45), new MySqlParameter("@date", MySqlDbType.Date), new MySqlParameter("@country", MySqlDbType.VarChar, 45), new MySqlParameter("@brand", MySqlDbType.VarChar, 45), new MySqlParameter("@fishId", MySqlDbType.VarChar, 45), new MySqlParameter("@price", MySqlDbType.Decimal), new MySqlParameter("@qualitySpe", MySqlDbType.VarChar, 45), new MySqlParameter("@goods", MySqlDbType.VarChar, 45), new MySqlParameter("@tons", MySqlDbType.Decimal, 10), new MySqlParameter("@protein", MySqlDbType.VarChar, 45), new MySqlParameter("@tvn", MySqlDbType.VarChar, 45), new MySqlParameter("@salt", MySqlDbType.VarChar, 45), new MySqlParameter("@acid", MySqlDbType.VarChar, 45), new MySqlParameter("@ash", MySqlDbType.VarChar, 45), new MySqlParameter("@histamine", MySqlDbType.VarChar, 45), new MySqlParameter("@las", MySqlDbType.VarChar, 45), new MySqlParameter("@das", MySqlDbType.VarChar, 45), new MySqlParameter("@remark", MySqlDbType.VarChar, 255), new MySqlParameter("@zf", MySqlDbType.VarChar, 45), new MySqlParameter("@shipname", MySqlDbType.VarChar, 45), new MySqlParameter("@zjh", MySqlDbType.VarChar, 45), new MySqlParameter("@billName", MySqlDbType.VarChar, 45), new MySqlParameter("@CkCode", MySqlDbType.VarChar, 60), new MySqlParameter("@FFA", MySqlDbType.VarChar, 45), new MySqlParameter("@ajs", MySqlDbType.VarChar, 10), new MySqlParameter("@Number", MySqlDbType.VarChar, 45), new MySqlParameter("@zidingyi", MySqlDbType.VarChar, 45), new MySqlParameter("@saleCompany", MySqlDbType.VarChar, 45), new MySqlParameter("@saleLinkman", MySqlDbType.VarChar, 45) }; parameters [0].Value = model.code; parameters [1].Value = model.plCode; parameters [2].Value = model.date; parameters [3].Value = model.country; parameters [4].Value = model.brand; parameters [5].Value = model.fishId; parameters [6].Value = model.price; parameters [7].Value = model.qualitySpe; parameters [8].Value = model.goods; parameters [9].Value = model.tons; parameters [10].Value = model.protein; parameters [11].Value = model.tvn; parameters [12].Value = model.salt; parameters [13].Value = model.acid; parameters [14].Value = model.ash; parameters [15].Value = model.histamine; parameters [16].Value = model.las; parameters [17].Value = model.das; parameters [18].Value = model.remark; parameters [19].Value = model.zf; parameters [20].Value = model.Shipname; parameters [21].Value = model.Zjh; parameters [22].Value = model.BillName; parameters[23].Value = model.CkCode; parameters[24].Value = model.FFA; parameters[25].Value = model.Ajs; parameters[26].Value = model.Number; parameters[27].Value = model.Zidingyi; parameters[28].Value = model.saleCompany; parameters[29].Value = model.saleLinkman; SQLString.Add(strSql, parameters); if (!string.IsNullOrEmpty(model.fishId)) { string xsCode = Exists_xs(model.fishId); if (!string.IsNullOrEmpty(xsCode)) { edit_xs(SQLString, strSql, model, xsCode); } } bool xid = MySqlHelper.ExecuteSqlTran(SQLString); if (xid) { if (Exists_fish(model.fishId) == false) { int one = add_fish(model); if (one > 1) { if (AddEx(model, one)) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } } else { return(false); } }
/// <summary> /// 新增数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Add(FishEntity.StorageOfRequisitionEntity 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_storageofrequisition("); strSql.Append("code,fishId,liWeight,LiNumber,price,shipName,country,billName,proName,za,zf,sand,db,applyDate,thCodeNum,supply,saWeight,brand,pileNum,qualitySpe,tvn,hf,sf,shy,remark,codeNum,codeNumContract,jcCode)"); strSql.Append(" values ("); strSql.Append("@code,@fishId,@liWeight,@LiNumber,@price,@shipName,@country,@billName,@proName,@za,@zf,@sand,@db,@applyDate,@thCodeNum,@supply,@saWeight,@brand,@pileNum,@qualitySpe,@tvn,@hf,@sf,@shy,@remark,@codeNum,@codeNumContract,@jcCode);");//select LAST_INSERT_ID(); MySqlParameter[] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@fishId", MySqlDbType.VarChar, 45), new MySqlParameter("@liWeight", MySqlDbType.Decimal, 10), new MySqlParameter("@price", MySqlDbType.Decimal, 10), new MySqlParameter("@shipName", MySqlDbType.VarChar, 45), new MySqlParameter("@country", MySqlDbType.VarChar, 45), new MySqlParameter("@billName", MySqlDbType.VarChar, 45), new MySqlParameter("@proName", MySqlDbType.VarChar, 45), new MySqlParameter("@za", MySqlDbType.VarChar, 45), new MySqlParameter("@zf", MySqlDbType.VarChar, 45), new MySqlParameter("@sand", MySqlDbType.VarChar, 45), new MySqlParameter("@db", MySqlDbType.VarChar, 45), new MySqlParameter("@applyDate", MySqlDbType.DateTime), new MySqlParameter("@thCodeNum", MySqlDbType.VarChar, 45), new MySqlParameter("@supply", MySqlDbType.VarChar, 45), new MySqlParameter("@saWeight", MySqlDbType.Decimal, 10), new MySqlParameter("@brand", MySqlDbType.VarChar, 45), new MySqlParameter("@pileNum", MySqlDbType.VarChar, 45), new MySqlParameter("@qualitySpe", MySqlDbType.VarChar, 45), new MySqlParameter("@tvn", MySqlDbType.VarChar, 45), new MySqlParameter("@hf", MySqlDbType.VarChar, 45), new MySqlParameter("@sf", MySqlDbType.VarChar, 45), new MySqlParameter("@shy", MySqlDbType.VarChar, 45), new MySqlParameter("@remark", MySqlDbType.VarChar, 255), new MySqlParameter("@codeNum", MySqlDbType.VarChar, 45), new MySqlParameter("@codeNumContract", MySqlDbType.VarChar, 45), new MySqlParameter("@jcCode", MySqlDbType.VarChar, 45), new MySqlParameter("@LiNumber", MySqlDbType.Decimal, 45) }; parameters[0].Value = model.code; parameters[1].Value = model.fishId; parameters[2].Value = model.liWeight; parameters[3].Value = model.price; parameters[4].Value = model.shipName; parameters[5].Value = model.country; parameters[6].Value = model.billName; parameters[7].Value = model.proName; parameters[8].Value = model.za; parameters[9].Value = model.zf; parameters[10].Value = model.sand; parameters[11].Value = model.db; parameters[12].Value = model.applyDate; parameters[13].Value = model.thCodeNum; parameters[14].Value = model.supply; parameters[15].Value = model.saWeight; parameters[16].Value = model.brand; parameters[17].Value = model.pileNum; parameters[18].Value = model.qualitySpe; parameters[19].Value = model.tvn; parameters[20].Value = model.hf; parameters[21].Value = model.sf; parameters[22].Value = model.shy; parameters[23].Value = model.remark; parameters[24].Value = model.codeNum; parameters[25].Value = model.codeNumContract; parameters[26].Value = model.jcCode; parameters[27].Value = model.LiNumber; SQLString.Add(strSql, parameters); if (MySqlHelper.ExecuteSqlTran(SQLString)) { strSql = new StringBuilder(); strSql.AppendFormat("SELECT id FROM t_storageofrequisition 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); } }
public int Add(FishEntity.BillofladingEntity 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_billoflading(Numbering,code,Issuingtime,contactsunit,ContactsunitId,warehouse,species,specification,ferryname,listname,cornerno,Ton,RedemptionWeight,packagenumber,Remarks,ShipNotice,Storagecosts,createtime,createman,modifytime,modifyman,codeContract,Recipient,SerialNumber,FishMealId,Country,Brands )"); strSql.Append("values(@Numbering,@code,@Issuingtime,@contactsunit,@ContactsunitId,@warehouse,@species,@specification,@ferryname,@listname,@cornerno,@Ton,@RedemptionWeight,@packagenumber,@Remarks,@ShipNotice,@Storagecosts,@createtime,@createman,@modifytime,@modifyman,@codeContract,@Recipient,@SerialNumber,@FishMealId,@Country,@Brands );select last_insert_id();"); MySqlParameter[] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@Issuingtime", MySqlDbType.Timestamp), new MySqlParameter("@contactsunit", MySqlDbType.VarChar, 100), new MySqlParameter("@warehouse", MySqlDbType.VarChar, 100), new MySqlParameter("@species", MySqlDbType.VarChar, 45), new MySqlParameter("@specification", MySqlDbType.VarChar, 45), new MySqlParameter("@ferryname", MySqlDbType.VarChar, 45), new MySqlParameter("@listname", MySqlDbType.VarChar, 45), new MySqlParameter("@Ton", MySqlDbType.VarChar, 45), new MySqlParameter("@packagenumber", MySqlDbType.VarChar, 45), new MySqlParameter("@Remarks", MySqlDbType.VarChar, 500), new MySqlParameter("@ShipNotice", MySqlDbType.VarChar, 200), new MySqlParameter("@Storagecosts", 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("@codeContract", MySqlDbType.VarChar, 200), new MySqlParameter("@Recipient", MySqlDbType.VarChar, 445), new MySqlParameter("@cornerno", MySqlDbType.VarChar, 45), new MySqlParameter("@ContactsunitId", MySqlDbType.VarChar, 100), new MySqlParameter("@SerialNumber", MySqlDbType.VarBinary, 100), new MySqlParameter("@Numbering", MySqlDbType.VarChar, 45), new MySqlParameter("@FishMealId", MySqlDbType.VarChar, 50), new MySqlParameter("@Country", MySqlDbType.VarChar, 50), new MySqlParameter("@Brands", MySqlDbType.VarChar, 50), new MySqlParameter("@RedemptionWeight", MySqlDbType.Decimal, 45) }; parameters[0].Value = model.Code; parameters[1].Value = model.Issuingtime; parameters[2].Value = model.Contactsunit; parameters[3].Value = model.Warehouse; parameters[4].Value = model.Species; parameters[5].Value = model.Specification; parameters[6].Value = model.Ferryname; parameters[7].Value = model.Listname; parameters[8].Value = model.Ton; parameters[9].Value = model.Packagenumber; parameters[10].Value = model.Remarks; parameters[11].Value = model.ShipNotice; parameters[12].Value = model.Storagecosts; parameters[13].Value = model.Createtime; parameters[14].Value = model.Createman; parameters[15].Value = model.Modifytime; parameters[16].Value = model.Modifyman; parameters [17].Value = model.codeContract; parameters[18].Value = model.Recipient; parameters[19].Value = model.Cornerno; parameters[20].Value = model.ContactsunitId; parameters[21].Value = model.SerialNumber; parameters[22].Value = model.Numbering; parameters[23].Value = model.FishMealId; parameters[24].Value = model.Country; parameters[25].Value = model.Brands; parameters[26].Value = model.RedemptionWeight; SQLString.Add(strSql, parameters); if (MySqlHelper.ExecuteSqlTran(SQLString)) { strSql = new StringBuilder( ); strSql.AppendFormat("select id from t_billoflading 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); } }
public int Add(FishEntity.CargoFeedbackSheetEntity model, string name) { Hashtable SQLString = new Hashtable( ); SQLString = ReviewInfo.getSQLString(name, model.codeContract, string.Empty, SQLString); StringBuilder Strsql = new StringBuilder( ); Strsql.Append("insert into t_CargoFeedbackSheet(Numbering,code,sponsor,acceptor,processresult,evaluation,attendance,review,remarks,modifytime,modifyman,createtime,createman,ConfirmTheWeight,FishMealId,PoundDifference,NetWeight,PoundBillNumber,codeContract)"); Strsql.Append("values(@Numbering,@code,@sponsor,@acceptor,@processresult,@evaluation,@attendance,@review,@remarks,@modifytime,@modifyman,@createtime,@createman,@ConfirmTheWeight,@FishMealId,@PoundDifference,@NetWeight,@PoundBillNumber,@codeContract);"); //Strsql . Append ( "select last_insert_id();" ); MySqlParameter [] parameter = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@sponsor", MySqlDbType.VarChar, 45), new MySqlParameter("@acceptor", MySqlDbType.VarChar, 45), new MySqlParameter("@processresult", MySqlDbType.VarChar, 200), new MySqlParameter("@evaluation", MySqlDbType.VarChar, 200), new MySqlParameter("@attendance", MySqlDbType.VarChar, 120), new MySqlParameter("@review", MySqlDbType.VarChar, 45), new MySqlParameter("@remarks", MySqlDbType.VarChar, 200), new MySqlParameter("@modifytime", MySqlDbType.Timestamp), new MySqlParameter("@modifyman", MySqlDbType.VarChar, 45), new MySqlParameter("@createtime", MySqlDbType.Timestamp), new MySqlParameter("@createman", MySqlDbType.VarChar, 45), new MySqlParameter("@ConfirmTheWeight", MySqlDbType.VarChar, 45), new MySqlParameter("@codeContract", MySqlDbType.VarChar, 200), new MySqlParameter("@Numbering", MySqlDbType.VarChar, 45), new MySqlParameter("@FishMealId", MySqlDbType.VarChar, 50), new MySqlParameter("@PoundDifference", MySqlDbType.VarChar, 50), new MySqlParameter("@NetWeight", MySqlDbType.VarChar, 50), new MySqlParameter("@PoundBillNumber", MySqlDbType.VarChar, 50) }; parameter [0].Value = model.Code; parameter [1].Value = model.Sponsor; parameter [2].Value = model.Acceptor; parameter [3].Value = model.Processresult; parameter [4].Value = model.Evaluation; parameter [5].Value = model.Attendance; parameter [6].Value = model.Review; parameter [7].Value = model.Remarks; parameter [8].Value = model.Modifytime; parameter [9].Value = model.Modifyman; parameter [10].Value = model.Createtime; parameter [11].Value = model.Createman; parameter [12].Value = model.ConfirmTheWeight; parameter [13].Value = model.codeContract; parameter [14].Value = model.Numbering; parameter [15].Value = model.FishMealId; parameter [16].Value = model.PoundDifference; parameter [17].Value = model.NetWeight; parameter [18].Value = model.PoundBillNumber; SQLString.Add(Strsql, parameter); if (MySqlHelper.ExecuteSqlTran(SQLString)) { Strsql = new StringBuilder( ); Strsql.AppendFormat("select id from t_CargoFeedbackSheet where code='{0}'", model.Code); if (Convert.ToDecimal(model.NetWeight.ToString()) == Convert.ToDecimal(model.ConfirmTheWeight.ToString()) && model.Code != "") { StringBuilder strSql1 = new StringBuilder(); strSql1.AppendFormat("insert into t_review (userName,programId,SingleNumber,date,content,state,userNameReview,Numbering) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", FishEntity.Variable.User.username, name, model.Code, DateTime.Now, "自动审核", "审核", "自动审核", model.Numbering); int qq = MySqlHelper.ExecuteSqlReturnId(strSql1.ToString(), null); } 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); } }
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); } }
/// <summary> /// 新增数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Add(FishEntity.QuotationPriceListEntity 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_quotationpricelist("); strSql.Append("code,fishId,priceMY,price,unit,country,brand,qualitySpe,weight,contract,date,tvn,acid,salt,protein,ash,histamine,las,das,remark,dataForm,codeNumSales,XNfishId,ffa)"); strSql.Append(" values ("); strSql.Append("@code,@fishId,@priceMY,@price,@unit,@country,@brand,@qualitySpe,@weight,@contract,@date,@tvn,@acid,@salt,@protein,@ash,@histamine,@las,@das,@remark,@dataForm,@codeNumSales,@XNfishId,@ffa)"); MySqlParameter [] parameters = { new MySqlParameter("@code", MySqlDbType.VarChar, 45), new MySqlParameter("@fishId", MySqlDbType.VarChar, 45), new MySqlParameter("@priceMY", MySqlDbType.Decimal, 10), new MySqlParameter("@price", MySqlDbType.Decimal, 10), new MySqlParameter("@unit", MySqlDbType.VarChar, 45), new MySqlParameter("@country", MySqlDbType.VarChar, 45), new MySqlParameter("@brand", MySqlDbType.VarChar, 45), new MySqlParameter("@qualitySpe", MySqlDbType.VarChar, 45), new MySqlParameter("@weight", MySqlDbType.Decimal, 10), new MySqlParameter("@contract", MySqlDbType.VarChar, 45), new MySqlParameter("@date", MySqlDbType.Date), new MySqlParameter("@tvn", MySqlDbType.VarChar, 45), new MySqlParameter("@acid", MySqlDbType.VarChar, 45), new MySqlParameter("@salt", MySqlDbType.VarChar, 45), new MySqlParameter("@protein", MySqlDbType.VarChar, 45), new MySqlParameter("@ash", MySqlDbType.VarChar, 45), new MySqlParameter("@histamine", MySqlDbType.VarChar, 45), new MySqlParameter("@las", MySqlDbType.VarChar, 45), new MySqlParameter("@das", MySqlDbType.VarChar, 45), new MySqlParameter("@remark", MySqlDbType.VarChar, 225), new MySqlParameter("@dataForm", MySqlDbType.VarChar, 45), new MySqlParameter("@codeNumSales", MySqlDbType.VarChar, 45), new MySqlParameter("@XNfishId", MySqlDbType.VarChar, 45), new MySqlParameter("@ffa", MySqlDbType.VarChar, 45) }; parameters [0].Value = model.code; parameters [1].Value = model.fishId; parameters [2].Value = model.priceMY; parameters [3].Value = model.price; parameters [4].Value = model.unit; parameters [5].Value = model.country; parameters [6].Value = model.brand; parameters [7].Value = model.qualitySpe; parameters [8].Value = model.weight; parameters [9].Value = model.contract; parameters [10].Value = model.date; parameters [11].Value = model.tvn; parameters [12].Value = model.acid; parameters [13].Value = model.salt; parameters [14].Value = model.protein; parameters [15].Value = model.ash; parameters [16].Value = model.histamine; parameters [17].Value = model.las; parameters [18].Value = model.das; parameters [19].Value = model.remark; parameters [20].Value = model.dataForm; parameters [21].Value = model.CodeNumSales; parameters[22].Value = model.XNfishId; parameters[23].Value = model.FFA; SQLString.Add(strSql, parameters); return(MySqlHelper.ExecuteSqlTran(SQLString)); }