/// <summary> /// 批量删除数据 /// </summary> public bool DeleteList(string tidlist) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from deviceinfo "); strSql.Append(" where TID in (" + tidlist + ") "); int rows = SQLiteHelper.ExecuteSql(strSql.ToString()); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 批量删除一批数据 /// </summary> public bool DeleteList(string tidlist) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from AuxiliaryFasiaResult "); strSql.Append(" where tid in (" + tidlist + ") "); int rows = SQLiteHelper.ExecuteSql(strSql.ToString()); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 批量删除数据 /// </summary> public bool DeleteList(string TIDlist) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from productsort "); strSql.Append(" where productcode in (" + TIDlist + ") "); int rows = SQLiteHelper.ExecuteSql(strSql.ToString()); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MDL.ProductBomInfoMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update productbominfo set "); strSql.Append("ProductType=@ProductType,"); strSql.Append("ProductCode=@ProductCode,"); strSql.Append("ProductName=@ProductName,"); strSql.Append("MaterialCode=@MaterialCode,"); strSql.Append("MaterialName=@MaterialName,"); strSql.Append("MaterialNum=@MaterialNum,"); strSql.Append("FeatureIndex=@FeatureIndex,"); strSql.Append("FeatureCode=@FeatureCode,"); strSql.Append("BatchNum=@BatchNum,"); strSql.Append("ScannerID=@ScannerID,"); strSql.Append("TraceType=@TraceType,"); strSql.Append("Desc=@Desc"); strSql.Append(" where TID=@TID"); SQLiteParameter[] parameters = { new SQLiteParameter("@ProductType", model.ProductType), new SQLiteParameter("@ProductCode", model.ProductCode), new SQLiteParameter("@ProductName", model.ProductName), new SQLiteParameter("@MaterialCode", model.MaterialCode), new SQLiteParameter("@MaterialName", model.MaterialName), new SQLiteParameter("@MaterialNum", model.MaterialNum), new SQLiteParameter("@FeatureIndex", model.FeatureIndex), new SQLiteParameter("@FeatureCode", model.FeatureCode), new SQLiteParameter("@BatchNum", model.BatchNum), new SQLiteParameter("@ScannerID", model.ScannerID), new SQLiteParameter("@TraceType", model.TraceType), new SQLiteParameter("@Desc", model.Desc), new SQLiteParameter("@TID", model.TID) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(AuxiliaryFasiaResultMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update AuxiliaryFasiaResult set "); strSql.Append(" barcode = @barcode , "); strSql.Append(" productcode = @productcode , "); strSql.Append(" userid = @userid , "); strSql.Append(" stationid = @stationid , "); strSql.Append(" linecode = @linecode , "); strSql.Append(" completed = @completed , "); strSql.Append(" createtime = @createtime , "); strSql.Append(" completetime = @completetime , "); strSql.Append(" repairstate = @repairstate "); strSql.Append(" where tid=@tid "); SQLiteParameter[] parameters = { new SQLiteParameter("@tid", model.tid), new SQLiteParameter("@linecode", model.linecode), new SQLiteParameter("@completed", model.completed), new SQLiteParameter("@createtime", model.createtime), new SQLiteParameter("@completetime", model.completetime), new SQLiteParameter("@repairstate", model.repairstate), new SQLiteParameter("@barcode", model.barcode), new SQLiteParameter("@productcode", model.productcode), new SQLiteParameter("@userid", model.userid), new SQLiteParameter("@stationid", model.stationid) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(long tid) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from brakepumpresult "); strSql.Append(" where tid=@tid"); SQLiteParameter[] parameters = { new SQLiteParameter("@tid", tid) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(long TID) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from materialfield "); strSql.Append(" where TID=@TID"); SQLiteParameter[] parameters = { new SQLiteParameter("@TID", TID) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(FrontAxleResultMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into frontaxleresult("); strSql.Append("leftfrontcaliperbatchno,rightfrontcaliperbatchno,caliperboltbatchno,lowerballpinbatchno,completed,createtime,completetime,repairstate,barcode,productcode,userid,stationid,leftsteeringbatchno,rightsteeringbatchno,bearingbatchno,frontbrakediscbatchno"); strSql.Append(") values ("); strSql.Append("@leftfrontcaliperbatchno,@rightfrontcaliperbatchno,@caliperboltbatchno,@lowerballpinbatchno,@completed,@createtime,@completetime,@repairstate,@barcode,@productcode,@userid,@stationid,@leftsteeringbatchno,@rightsteeringbatchno,@bearingbatchno,@frontbrakediscbatchno"); strSql.Append(") "); SQLiteParameter[] parameters = { new SQLiteParameter("@leftfrontcaliperbatchno", model.leftfrontcaliperbatchno), new SQLiteParameter("@rightfrontcaliperbatchno", model.rightfrontcaliperbatchno), new SQLiteParameter("@caliperboltbatchno", model.caliperboltbatchno), new SQLiteParameter("@lowerballpinbatchno", model.lowerballpinbatchno), new SQLiteParameter("@completed", model.completed), new SQLiteParameter("@createtime", model.createtime), new SQLiteParameter("@completetime", model.completetime), new SQLiteParameter("@repairstate", model.repairstate), new SQLiteParameter("@barcode", model.barcode), new SQLiteParameter("@productcode", model.productcode), new SQLiteParameter("@userid", model.userid), new SQLiteParameter("@stationid", model.stationid), new SQLiteParameter("@leftsteeringbatchno", model.leftsteeringbatchno), new SQLiteParameter("@rightsteeringbatchno", model.rightsteeringbatchno), new SQLiteParameter("@bearingbatchno", model.bearingbatchno), new SQLiteParameter("@frontbrakediscbatchno", model.frontbrakediscbatchno) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(string code) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from productsort "); strSql.Append(" where productcode=@productcode"); SQLiteParameter[] parameters = { new SQLiteParameter("@productcode", code) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MDL.ProductInfoMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update ProductInfo set "); strSql.Append("ProductType=@ProductType,"); strSql.Append("ProductCode=@ProductCode,"); strSql.Append("ProductName=@ProductName,"); strSql.Append("FeatureIndex=@FeatureIndex,"); strSql.Append("FeatureCode=@FeatureCode,"); strSql.Append("BarCodeCount=@BarCodeCount,"); strSql.Append("HaveSub=@HaveSub,"); strSql.Append("Desc=@Desc"); strSql.Append(" where TID=@TID"); SQLiteParameter[] parameters = { new SQLiteParameter("@ProductType", model.ProductType), new SQLiteParameter("@ProductCode", model.ProductCode), new SQLiteParameter("@ProductName", model.ProductName), new SQLiteParameter("@FeatureIndex", model.FeatureIndex), new SQLiteParameter("@FeatureCode", model.FeatureCode), new SQLiteParameter("@BarCodeCount", model.BarCodeCount), new SQLiteParameter("@HaveSub", model.HaveSub), new SQLiteParameter("@Desc", model.Desc), new SQLiteParameter("@TID", model.TID) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MDL.UserInfoMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update userinfo set "); strSql.Append("UserID=@UserID,"); strSql.Append("UserName=@UserName,"); strSql.Append("UserSex=@UserSex,"); strSql.Append("UserPwd=@UserPwd,"); strSql.Append("PhoneNum=@PhoneNum,"); strSql.Append("Department=@Department,"); strSql.Append("RoleName=@RoleName,"); strSql.Append("CreateTime=@CreateTime"); strSql.Append(" where TID=@TID"); SQLiteParameter[] parameters = { new SQLiteParameter("@UserID", model.UserID), new SQLiteParameter("@UserName", model.UserName), new SQLiteParameter("@UserSex", model.UserSex), new SQLiteParameter("@UserPwd", model.UserPwd), new SQLiteParameter("@PhoneNum", model.PhoneNum), new SQLiteParameter("@Department", model.Department), new SQLiteParameter("@RoleName", model.RoleName), new SQLiteParameter("@CreateTime", model.CreateTime), new SQLiteParameter("@TID", model.TID) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MDL.DeviceInfoMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update deviceinfo set "); strSql.Append("DeviceType=@DeviceType,"); strSql.Append("DeviceID=@DeviceID,"); strSql.Append("DeviceName=@DeviceName,"); strSql.Append("DeviceIP=@DeviceIP,"); strSql.Append("ProductType=@ProductType,"); strSql.Append("DeviceState=@DeviceState,"); strSql.Append("StationID=@StationID,"); strSql.Append("Desc=@Desc"); strSql.Append(" where TID=@TID"); SQLiteParameter[] parameters = { new SQLiteParameter("@DeviceType", model.DeviceType), new SQLiteParameter("@DeviceID", model.DeviceID), new SQLiteParameter("@DeviceName", model.DeviceName), new SQLiteParameter("@DeviceIP", model.DeviceIP), new SQLiteParameter("@ProductType", model.ProductType), new SQLiteParameter("@DeviceState", model.DeviceState), new SQLiteParameter("@StationID", model.StationID), new SQLiteParameter("@Desc", model.Desc), new SQLiteParameter("@TID", model.TID) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(BatchNoMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update BatchNo set "); strSql.Append("ProductType=@ProductType,"); strSql.Append("MaterialCode=@MaterialCode,"); strSql.Append("MaterialName=@MaterialName,"); strSql.Append("BatchNo=@BatchNo,"); strSql.Append("BatchNum=@BatchNum,"); strSql.Append("StockNum=@StockNum,"); strSql.Append("Supplier=@Supplier,"); strSql.Append("CreateTime=@CreateTime"); strSql.Append(" where TID=@TID"); SQLiteParameter[] parameters = { new SQLiteParameter("@ProductType", model.ProductType), new SQLiteParameter("@MaterialCode", model.MaterialCode), new SQLiteParameter("@MaterialName", model.MaterialName), new SQLiteParameter("@BatchNo", model.BatchNo), new SQLiteParameter("@BatchNum", model.BatchNum), new SQLiteParameter("@StockNum", model.StockNum), new SQLiteParameter("@Supplier", model.Supplier), new SQLiteParameter("@CreateTime", model.CreateTime), new SQLiteParameter("@TID", model.TID) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(MDL.BrakepumpResultMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into brakepumpresult("); strSql.Append("barcode,productcode,userid,stationid,brakepumpcode,gasketbatchno,hexagonalnutbatchno,pressuresensorbatchno,silencerbatchno,connectingpipe,boosterbrakepumpbracket,completed,createtime,completetime)"); strSql.Append(" values ("); strSql.Append("@barcode,@productcode,@userid,@stationid,@brakepumpcode,@gasketbatchno,@hexagonalnutbatchno,@pressuresensorbatchno,@silencerbatchno,@connectingpipe,@boosterbrakepumpbracket,@completed,@createtime,@completetime)"); SQLiteParameter[] parameters = { new SQLiteParameter("@barcode", model.barcode), new SQLiteParameter("@productcode", model.productcode), new SQLiteParameter("@userid", model.userid), new SQLiteParameter("@stationid", model.stationid), new SQLiteParameter("@brakepumpcode", model.brakepumpcode), new SQLiteParameter("@gasketbatchno", model.gasketbatchno), new SQLiteParameter("@hexagonalnutbatchno", model.hexagonalnutbatchno), new SQLiteParameter("@pressuresensorbatchno", model.pressuresensorbatchno), new SQLiteParameter("@silencerbatchno", model.silencerbatchno), new SQLiteParameter("@connectingpipe", model.connectingpipe), new SQLiteParameter("@boosterbrakepumpbracket", model.boosterbrakepumpbracket), new SQLiteParameter("@completed", model.completed), new SQLiteParameter("@createtime", model.createtime), new SQLiteParameter("@completetime", model.completetime) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(MDL.PedalResultMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into pedalresult("); strSql.Append("barcode,productcode,userid,stationid,pedalassycode,accelpedalcode,cluthhandlebatchno,boltbatchno,nutbatchno,torque1,torque2,torque3,completed,createtime,completetime)"); strSql.Append(" values ("); strSql.Append("@barcode,@productcode,@userid,@stationid,@pedalassycode,@accelpedalcode,@cluthhandlebatchno,@boltbatchno,@nutbatchno,@torque1,@torque2,@torque3,@completed,@createtime,@completetime)"); SQLiteParameter[] parameters = { new SQLiteParameter("@barcode", model.barcode), new SQLiteParameter("@productcode", model.productcode), new SQLiteParameter("@userid", model.userid), new SQLiteParameter("@stationid", model.stationid), new SQLiteParameter("@pedalassycode", model.pedalassycode), new SQLiteParameter("@accelpedalcode", model.accelpedalcode), new SQLiteParameter("@cluthhandlebatchno", model.cluthhandlebatchno), new SQLiteParameter("@boltbatchno", model.boltbatchno), new SQLiteParameter("@nutbatchno", model.nutbatchno), new SQLiteParameter("@torque1", model.torque1), new SQLiteParameter("@torque2", model.torque2), new SQLiteParameter("@torque3", model.torque3), new SQLiteParameter("@completed", model.completed), new SQLiteParameter("@createtime", model.createtime), new SQLiteParameter("@completetime", model.completetime) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(MDL.ProductBomInfoMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into productbominfo("); strSql.Append("TID,ProductType,ProductCode,ProductName,MaterialCode,MaterialName,MaterialNum,FeatureIndex,FeatureCode,BatchNum,ScannerID,TraceType,`Desc` )"); strSql.Append(" values ("); strSql.Append("@TID,@ProductType,@ProductCode,@ProductName,@MaterialCode,@MaterialName,@MaterialNum,@FeatureIndex,@FeatureCode,@BatchNum,@ScannerID,@TraceType,@Desc)"); SQLiteParameter[] parameters = { new SQLiteParameter("@TID", model.TID), new SQLiteParameter("@ProductType", model.ProductType), new SQLiteParameter("@ProductCode", model.ProductCode), new SQLiteParameter("@ProductName", model.ProductName), new SQLiteParameter("@MaterialCode", model.MaterialCode), new SQLiteParameter("@MaterialName", model.MaterialName), new SQLiteParameter("@MaterialNum", model.MaterialNum), new SQLiteParameter("@FeatureIndex", model.FeatureIndex), new SQLiteParameter("@FeatureCode", model.FeatureCode), new SQLiteParameter("@BatchNum", model.BatchNum), new SQLiteParameter("@ScannerID", model.ScannerID), new SQLiteParameter("@TraceType", model.TraceType), new SQLiteParameter("@Desc", model.Desc) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(MDL.RadiatorResultMDL model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update radiatorresult set "); strSql.Append("barcode=@barcode,"); strSql.Append("productcode=@productcode,"); strSql.Append("userid=@userid,"); strSql.Append("stationid=@stationid,"); strSql.Append("radiatorcode=@radiatorcode,"); strSql.Append("condensercode=@condensercode,"); strSql.Append("fanassemblycode=@fanassemblycode,"); strSql.Append("intercoolercode=@intercoolercode,"); strSql.Append("torque1=@torque1,"); strSql.Append("angle1=@angle1,"); strSql.Append("torque2=@torque2,"); strSql.Append("angle2=@angle2,"); strSql.Append("torque3=@torque3,"); strSql.Append("angle3=@angle3,"); strSql.Append("torque4=@torque4,"); strSql.Append("angle4=@angle4,"); strSql.Append("torque5=@torque5,"); strSql.Append("angle5=@angle5,"); strSql.Append("torque6=@torque6,"); strSql.Append("angle6=@angle6,"); strSql.Append("completed=@completed,"); strSql.Append("createtime=@createtime,"); strSql.Append("completetime=@completetime"); strSql.Append(" where tid=@tid"); SQLiteParameter[] parameters = { new SQLiteParameter("@barcode", model.barcode), new SQLiteParameter("@productcode", model.productcode), new SQLiteParameter("@userid", model.userid), new SQLiteParameter("@stationid", model.stationid), new SQLiteParameter("@radiatorcode", model.radiatorcode), new SQLiteParameter("@condensercode", model.condensercode), new SQLiteParameter("@fanassemblycode", model.fanassemblycode), new SQLiteParameter("@intercoolercode", model.intercoolercode), new SQLiteParameter("@torque1", model.torque1), new SQLiteParameter("@angle1", model.angle1), new SQLiteParameter("@torque2", model.torque2), new SQLiteParameter("@angle2", model.angle2), new SQLiteParameter("@torque3", model.torque3), new SQLiteParameter("@angle3", model.angle3), new SQLiteParameter("@torque4", model.torque4), new SQLiteParameter("@angle4", model.angle4), new SQLiteParameter("@torque5", model.torque5), new SQLiteParameter("@angle5", model.angle5), new SQLiteParameter("@torque6", model.torque6), new SQLiteParameter("@angle6", model.angle6), new SQLiteParameter("@completed", model.completed), new SQLiteParameter("@createtime", model.createtime), new SQLiteParameter("@completetime", model.completetime), new SQLiteParameter("@tid", model.tid) }; int rows = SQLiteHelper.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 执行sql语句 /// </summary> /// <param name="sql"></param> /// <returns></returns> public static bool ExecuteSql(string sql) { int rs = SQLiteHelper.ExecuteSql(sql); return(rs > 0 ? true : false); }