/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.V_Company model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into V_Company("); strSql.Append("AreaCode,areaname,companycode,companyname,CompanyType,CompanyIndustry,CompanyAddress,CompanyPhone,CompanyLegal,CompanyLegalNo,CompanyIsStop,是否运维,town,Street,remark,UpdateTime,UpdatePerson,AreaID)"); strSql.Append(" values ("); strSql.Append("@AreaCode,@areaname,@companycode,@companyname,@CompanyType,@CompanyIndustry,@CompanyAddress,@CompanyPhone,@CompanyLegal,@CompanyLegalNo,@CompanyIsStop,@是否运维,@town,@Street,@remark,@UpdateTime,@UpdatePerson,@AreaID)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@AreaCode", SqlDbType.NVarChar, 15), new SqlParameter("@areaname", SqlDbType.NVarChar, 255), new SqlParameter("@companycode", SqlDbType.NVarChar, 255), new SqlParameter("@companyname", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyType", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyIndustry", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyAddress", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyPhone", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyLegal", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyLegalNo", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyIsStop", SqlDbType.Bit, 1), new SqlParameter("@是否运维", SqlDbType.VarChar, 2), new SqlParameter("@town", SqlDbType.NVarChar, 255), new SqlParameter("@Street", SqlDbType.NVarChar, 255), new SqlParameter("@remark", SqlDbType.NVarChar, 255), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@UpdatePerson", SqlDbType.NVarChar, 255), new SqlParameter("@AreaID", SqlDbType.Int, 4) }; parameters[0].Value = model.AreaCode; parameters[1].Value = model.areaname; parameters[2].Value = model.companycode; parameters[3].Value = model.companyname; parameters[4].Value = model.CompanyType; parameters[5].Value = model.CompanyIndustry; parameters[6].Value = model.CompanyAddress; parameters[7].Value = model.CompanyPhone; parameters[8].Value = model.CompanyLegal; parameters[9].Value = model.CompanyLegalNo; parameters[10].Value = model.CompanyIsStop; parameters[11].Value = model.是否运维; parameters[12].Value = model.town; parameters[13].Value = model.Street; parameters[14].Value = model.remark; parameters[15].Value = model.UpdateTime; parameters[16].Value = model.UpdatePerson; parameters[17].Value = model.AreaID; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_Contractor model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_Contractor("); strSql.Append("ContractorID,CompanyCode,Name,cellphone,telephone,remark,qq,email,fax,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG,RecordFlag)"); strSql.Append(" values ("); strSql.Append("@ContractorID,@CompanyCode,@Name,@cellphone,@telephone,@remark,@qq,@email,@fax,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG,@RecordFlag)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@ContractorID", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyCode", SqlDbType.NVarChar, 255), new SqlParameter("@Name", SqlDbType.NVarChar, 255), new SqlParameter("@cellphone", SqlDbType.NVarChar, 255), new SqlParameter("@telephone", SqlDbType.NVarChar, 255), new SqlParameter("@remark", SqlDbType.NVarChar, 255), new SqlParameter("@qq", SqlDbType.NVarChar, 255), new SqlParameter("@email", SqlDbType.NVarChar, 255), new SqlParameter("@fax", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4), new SqlParameter("@RecordFlag", SqlDbType.NVarChar, 25) }; parameters[0].Value = model.ContractorID; parameters[1].Value = model.CompanyCode; parameters[2].Value = model.Name; parameters[3].Value = model.cellphone; parameters[4].Value = model.telephone; parameters[5].Value = model.remark; parameters[6].Value = model.qq; parameters[7].Value = model.email; parameters[8].Value = model.fax; parameters[9].Value = model.ExcelServerRCID; parameters[10].Value = model.ExcelServerRN; parameters[11].Value = model.ExcelServerCN; parameters[12].Value = model.ExcelServerRC1; parameters[13].Value = model.ExcelServerWIID; parameters[14].Value = model.ExcelServerRTID; parameters[15].Value = model.ExcelServerCHG; parameters[16].Value = model.RecordFlag; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_Geneset model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_Geneset("); strSql.Append("genename,genecode,genecodeExpand,geneT212,unit,m_decimal,DataType,ZS,remark,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG,GeneType)"); strSql.Append(" values ("); strSql.Append("@genename,@genecode,@genecodeExpand,@geneT212,@unit,@m_decimal,@DataType,@ZS,@remark,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG,@GeneType)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@genename", SqlDbType.NVarChar, 255), new SqlParameter("@genecode", SqlDbType.NVarChar, 50), new SqlParameter("@genecodeExpand", SqlDbType.NVarChar, 50), new SqlParameter("@geneT212", SqlDbType.NVarChar, 50), new SqlParameter("@unit", SqlDbType.VarChar, 50), new SqlParameter("@m_decimal", SqlDbType.Int, 4), new SqlParameter("@DataType", SqlDbType.Int, 4), new SqlParameter("@ZS", SqlDbType.Bit, 1), new SqlParameter("@remark", SqlDbType.NVarChar, 500), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4), new SqlParameter("@GeneType", SqlDbType.Int, 4) }; parameters[0].Value = model.genename; parameters[1].Value = model.genecode; parameters[2].Value = model.genecodeExpand; parameters[3].Value = model.geneT212; parameters[4].Value = model.unit; parameters[5].Value = model.m_decimal; parameters[6].Value = model.DataType; parameters[7].Value = model.ZS; parameters[8].Value = model.remark; parameters[9].Value = model.ExcelServerRCID; parameters[10].Value = model.ExcelServerRN; parameters[11].Value = model.ExcelServerCN; parameters[12].Value = model.ExcelServerRC1; parameters[13].Value = model.ExcelServerWIID; parameters[14].Value = model.ExcelServerRTID; parameters[15].Value = model.ExcelServerCHG; parameters[16].Value = model.GeneType; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_Area model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_Area("); strSql.Append("AreaCode,AreaName,province,city,distinguish,town,remark,reportno,realtimeaddress,historyaddress,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG)"); strSql.Append(" values ("); strSql.Append("@AreaCode,@AreaName,@province,@city,@distinguish,@town,@remark,@reportno,@realtimeaddress,@historyaddress,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@AreaCode", SqlDbType.NVarChar, 15), new SqlParameter("@AreaName", SqlDbType.NVarChar, 255), new SqlParameter("@province", SqlDbType.NVarChar, 50), new SqlParameter("@city", SqlDbType.NVarChar, 50), new SqlParameter("@distinguish", SqlDbType.NVarChar, 50), new SqlParameter("@town", SqlDbType.NVarChar, 50), new SqlParameter("@remark", SqlDbType.NVarChar, 255), new SqlParameter("@reportno", SqlDbType.NVarChar, 50), new SqlParameter("@realtimeaddress", SqlDbType.NVarChar, 100), new SqlParameter("@historyaddress", SqlDbType.NVarChar, 100), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4) }; parameters[0].Value = model.AreaCode; parameters[1].Value = model.AreaName; parameters[2].Value = model.province; parameters[3].Value = model.city; parameters[4].Value = model.distinguish; parameters[5].Value = model.town; parameters[6].Value = model.remark; parameters[7].Value = model.reportno; parameters[8].Value = model.realtimeaddress; parameters[9].Value = model.historyaddress; parameters[10].Value = model.ExcelServerRCID; parameters[11].Value = model.ExcelServerRN; parameters[12].Value = model.ExcelServerCN; parameters[13].Value = model.ExcelServerRC1; parameters[14].Value = model.ExcelServerWIID; parameters[15].Value = model.ExcelServerRTID; parameters[16].Value = model.ExcelServerCHG; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_StationInformation model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_StationInformation("); strSql.Append("CompanyCode,PointCode,PointName,PointUses,PointType,OperatedLevel,OperatedCenter,OperatedGroup,Director,RouterIP,DataIP,VedioIP,LineNo,Vlan,NetOperator,NetType,remark,UpdateTime,UpdatePerson,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG,MnCode,OutletNo,PassTime,PointCode1,EnvirLevel,IsPatrol,IsContract,CompanyID,Longitude,latitude,frequency,Pointaddress,PointCodeB,Controlsystem,Treatmentprocess)"); strSql.Append(" values ("); strSql.Append("@CompanyCode,@PointCode,@PointName,@PointUses,@PointType,@OperatedLevel,@OperatedCenter,@OperatedGroup,@Director,@RouterIP,@DataIP,@VedioIP,@LineNo,@Vlan,@NetOperator,@NetType,@remark,@UpdateTime,@UpdatePerson,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG,@MnCode,@OutletNo,@PassTime,@PointCode1,@EnvirLevel,@IsPatrol,@IsContract,@CompanyID,@Longitude,@latitude,@frequency,@Pointaddress,@PointCodeB,@Controlsystem,@Treatmentprocess)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@CompanyCode", SqlDbType.NVarChar, 20), new SqlParameter("@PointCode", SqlDbType.NVarChar, 20), new SqlParameter("@PointName", SqlDbType.NVarChar, 255), new SqlParameter("@PointUses", SqlDbType.Bit, 1), new SqlParameter("@PointType", SqlDbType.Int, 4), new SqlParameter("@OperatedLevel", SqlDbType.NVarChar, 20), new SqlParameter("@OperatedCenter", SqlDbType.NVarChar, 20), new SqlParameter("@OperatedGroup", SqlDbType.NVarChar, 20), new SqlParameter("@Director", SqlDbType.NVarChar, 50), new SqlParameter("@RouterIP", SqlDbType.NVarChar, 255), new SqlParameter("@DataIP", SqlDbType.NVarChar, 255), new SqlParameter("@VedioIP", SqlDbType.NVarChar, 255), new SqlParameter("@LineNo", SqlDbType.NVarChar, 50), new SqlParameter("@Vlan", SqlDbType.NVarChar, 20), new SqlParameter("@NetOperator", SqlDbType.NVarChar, 20), new SqlParameter("@NetType", SqlDbType.NVarChar, 20), new SqlParameter("@remark", SqlDbType.NVarChar, 255), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@UpdatePerson", SqlDbType.NVarChar, 50), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4), new SqlParameter("@MnCode", SqlDbType.NVarChar, 20), new SqlParameter("@OutletNo", SqlDbType.NVarChar, 20), new SqlParameter("@PassTime", SqlDbType.DateTime), new SqlParameter("@PointCode1", SqlDbType.NVarChar, 20), new SqlParameter("@EnvirLevel", SqlDbType.NVarChar, 50), new SqlParameter("@IsPatrol", SqlDbType.Bit, 1), new SqlParameter("@IsContract", SqlDbType.Bit, 1), new SqlParameter("@CompanyID", SqlDbType.Int, 4), new SqlParameter("@Longitude", SqlDbType.NVarChar, 50), new SqlParameter("@latitude", SqlDbType.NVarChar, 50), new SqlParameter("@frequency", SqlDbType.Int, 4), new SqlParameter("@Pointaddress", SqlDbType.NVarChar, 255), new SqlParameter("@PointCodeB", SqlDbType.NVarChar, 50), new SqlParameter("@Controlsystem", SqlDbType.NVarChar, 50), new SqlParameter("@Treatmentprocess", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.CompanyCode; parameters[1].Value = model.PointCode; parameters[2].Value = model.PointName; parameters[3].Value = model.PointUses; parameters[4].Value = model.PointType; parameters[5].Value = model.OperatedLevel; parameters[6].Value = model.OperatedCenter; parameters[7].Value = model.OperatedGroup; parameters[8].Value = model.Director; parameters[9].Value = model.RouterIP; parameters[10].Value = model.DataIP; parameters[11].Value = model.VedioIP; parameters[12].Value = model.LineNo; parameters[13].Value = model.Vlan; parameters[14].Value = model.NetOperator; parameters[15].Value = model.NetType; parameters[16].Value = model.remark; parameters[17].Value = model.UpdateTime; parameters[18].Value = model.UpdatePerson; parameters[19].Value = model.ExcelServerRCID; parameters[20].Value = model.ExcelServerRN; parameters[21].Value = model.ExcelServerCN; parameters[22].Value = model.ExcelServerRC1; parameters[23].Value = model.ExcelServerWIID; parameters[24].Value = model.ExcelServerRTID; parameters[25].Value = model.ExcelServerCHG; parameters[26].Value = model.MnCode; parameters[27].Value = model.OutletNo; parameters[28].Value = model.PassTime; parameters[29].Value = model.PointCode1; parameters[30].Value = model.EnvirLevel; parameters[31].Value = model.IsPatrol; parameters[32].Value = model.IsContract; parameters[33].Value = model.CompanyID; parameters[34].Value = model.Longitude; parameters[35].Value = model.latitude; parameters[36].Value = model.frequency; parameters[37].Value = model.Pointaddress; parameters[38].Value = model.PointCodeB; parameters[39].Value = model.Controlsystem; parameters[40].Value = model.Treatmentprocess; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_Company model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_Company("); strSql.Append("AreaCode,CompanyCode,CompanyName,CompanyType,CompanyIndustry,CompanyPhone,CompanyLegal,CompanyLegalNo,CompanyAddress,Town,Street,CompanyIsStop,remark,UpdateTime,UpdatePerson,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG,contrator,AreaID,Longitude,latitude)"); strSql.Append(" values ("); strSql.Append("@AreaCode,@CompanyCode,@CompanyName,@CompanyType,@CompanyIndustry,@CompanyPhone,@CompanyLegal,@CompanyLegalNo,@CompanyAddress,@Town,@Street,@CompanyIsStop,@remark,@UpdateTime,@UpdatePerson,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG,@contrator,@AreaID,@Longitude,@latitude)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@AreaCode", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyCode", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyName", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyType", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyIndustry", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyPhone", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyLegal", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyLegalNo", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyAddress", SqlDbType.NVarChar, 255), new SqlParameter("@Town", SqlDbType.NVarChar, 255), new SqlParameter("@Street", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyIsStop", SqlDbType.Bit, 1), new SqlParameter("@remark", SqlDbType.NVarChar, 255), new SqlParameter("@UpdateTime", SqlDbType.DateTime), new SqlParameter("@UpdatePerson", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4), new SqlParameter("@contrator", SqlDbType.NVarChar, 100), new SqlParameter("@AreaID", SqlDbType.Int, 4), new SqlParameter("@Longitude", SqlDbType.Decimal, 9), new SqlParameter("@latitude", SqlDbType.Decimal, 9) }; parameters[0].Value = model.AreaCode; parameters[1].Value = model.CompanyCode; parameters[2].Value = model.CompanyName; parameters[3].Value = model.CompanyType; parameters[4].Value = model.CompanyIndustry; parameters[5].Value = model.CompanyPhone; parameters[6].Value = model.CompanyLegal; parameters[7].Value = model.CompanyLegalNo; parameters[8].Value = model.CompanyAddress; parameters[9].Value = model.Town; parameters[10].Value = model.Street; parameters[11].Value = model.CompanyIsStop; parameters[12].Value = model.remark; parameters[13].Value = model.UpdateTime; parameters[14].Value = model.UpdatePerson; parameters[15].Value = model.ExcelServerRCID; parameters[16].Value = model.ExcelServerRN; parameters[17].Value = model.ExcelServerCN; parameters[18].Value = model.ExcelServerRC1; parameters[19].Value = model.ExcelServerWIID; parameters[20].Value = model.ExcelServerRTID; parameters[21].Value = model.ExcelServerCHG; parameters[22].Value = model.contrator; parameters[23].Value = model.AreaID; parameters[24].Value = model.Longitude; parameters[25].Value = model.latitude; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.V_StationDev model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into V_StationDev("); strSql.Append("SortId,AreaName,CompanyCode,CompanyName,PointCode,PointName,Name,OperatedLevel,InstrumentID,InstrumentName,InstrumentModel,InstrumentType,InstallDate,DevCode,DetectionPrinciple,RangeLow,RangeUp,Protocol,TransmissionType,DevStatus,Remark,RecordFlag,PointID)"); strSql.Append(" values ("); strSql.Append("@SortId,@AreaName,@CompanyCode,@CompanyName,@PointCode,@PointName,@Name,@OperatedLevel,@InstrumentID,@InstrumentName,@InstrumentModel,@InstrumentType,@InstallDate,@DevCode,@DetectionPrinciple,@RangeLow,@RangeUp,@Protocol,@TransmissionType,@DevStatus,@Remark,@RecordFlag,@PointID)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@SortId", SqlDbType.Int, 4), new SqlParameter("@AreaName", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyCode", SqlDbType.NVarChar, 255), new SqlParameter("@CompanyName", SqlDbType.NVarChar, 255), new SqlParameter("@PointCode", SqlDbType.NVarChar, 50), new SqlParameter("@PointName", SqlDbType.NVarChar, 255), new SqlParameter("@Name", SqlDbType.NVarChar, 100), new SqlParameter("@OperatedLevel", SqlDbType.NVarChar, 20), new SqlParameter("@InstrumentID", SqlDbType.NVarChar, 50), new SqlParameter("@InstrumentName", SqlDbType.NVarChar, 255), new SqlParameter("@InstrumentModel", SqlDbType.NVarChar, 50), new SqlParameter("@InstrumentType", SqlDbType.NVarChar, 50), new SqlParameter("@InstallDate", SqlDbType.DateTime), new SqlParameter("@DevCode", SqlDbType.NVarChar, 50), new SqlParameter("@DetectionPrinciple", SqlDbType.NVarChar, 50), new SqlParameter("@RangeLow", SqlDbType.Float, 8), new SqlParameter("@RangeUp", SqlDbType.Float, 8), new SqlParameter("@Protocol", SqlDbType.NVarChar, 50), new SqlParameter("@TransmissionType", SqlDbType.NVarChar, 50), new SqlParameter("@DevStatus", SqlDbType.NVarChar, 50), new SqlParameter("@Remark", SqlDbType.NVarChar, 255), new SqlParameter("@RecordFlag", SqlDbType.NVarChar, 25), new SqlParameter("@PointID", SqlDbType.Int, 4) }; parameters[0].Value = model.SortId; parameters[1].Value = model.AreaName; parameters[2].Value = model.CompanyCode; parameters[3].Value = model.CompanyName; parameters[4].Value = model.PointCode; parameters[5].Value = model.PointName; parameters[6].Value = model.Name; parameters[7].Value = model.OperatedLevel; parameters[8].Value = model.InstrumentID; parameters[9].Value = model.InstrumentName; parameters[10].Value = model.InstrumentModel; parameters[11].Value = model.InstrumentType; parameters[12].Value = model.InstallDate; parameters[13].Value = model.DevCode; parameters[14].Value = model.DetectionPrinciple; parameters[15].Value = model.RangeLow; parameters[16].Value = model.RangeUp; parameters[17].Value = model.Protocol; parameters[18].Value = model.TransmissionType; parameters[19].Value = model.DevStatus; parameters[20].Value = model.Remark; parameters[21].Value = model.RecordFlag; parameters[22].Value = model.PointID; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_DevGeneSet model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_DevGeneSet("); strSql.Append("PointID,DevCode,GeneID,isStop,DayNum,RangeUp,RangeDown,StandardMaxValue,StandardMinValue,IsJudgeStandard,DayMaxValue,DayMinValue,ChangeType,ChangeRate,DetectionPrinciple,HasZs,HasPf,DecimalPlaces,Sort,RecordFlag,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG)"); strSql.Append(" values ("); strSql.Append("@PointID,@DevCode,@GeneID,@isStop,@DayNum,@RangeUp,@RangeDown,@StandardMaxValue,@StandardMinValue,@IsJudgeStandard,@DayMaxValue,@DayMinValue,@ChangeType,@ChangeRate,@DetectionPrinciple,@HasZs,@HasPf,@DecimalPlaces,@Sort,@RecordFlag,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@PointID", SqlDbType.Int, 4), new SqlParameter("@DevCode", SqlDbType.NVarChar, 50), new SqlParameter("@GeneID", SqlDbType.Int, 4), new SqlParameter("@isStop", SqlDbType.Bit, 1), new SqlParameter("@DayNum", SqlDbType.Int, 4), new SqlParameter("@RangeUp", SqlDbType.Decimal, 9), new SqlParameter("@RangeDown", SqlDbType.Decimal, 9), new SqlParameter("@StandardMaxValue", SqlDbType.Decimal, 9), new SqlParameter("@StandardMinValue", SqlDbType.Decimal, 9), new SqlParameter("@IsJudgeStandard", SqlDbType.Bit, 1), new SqlParameter("@DayMaxValue", SqlDbType.Decimal, 9), new SqlParameter("@DayMinValue", SqlDbType.Decimal, 9), new SqlParameter("@ChangeType", SqlDbType.NVarChar, 50), new SqlParameter("@ChangeRate", SqlDbType.Float, 8), new SqlParameter("@DetectionPrinciple", SqlDbType.NVarChar, 255), new SqlParameter("@HasZs", SqlDbType.Bit, 1), new SqlParameter("@HasPf", SqlDbType.Bit, 1), new SqlParameter("@DecimalPlaces", SqlDbType.Int, 4), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@RecordFlag", SqlDbType.NVarChar, 25), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4) }; parameters[0].Value = model.PointID; parameters[1].Value = model.DevCode; parameters[2].Value = model.GeneID; parameters[3].Value = model.isStop; parameters[4].Value = model.DayNum; parameters[5].Value = model.RangeUp; parameters[6].Value = model.RangeDown; parameters[7].Value = model.StandardMaxValue; parameters[8].Value = model.StandardMinValue; parameters[9].Value = model.IsJudgeStandard; parameters[10].Value = model.DayMaxValue; parameters[11].Value = model.DayMinValue; parameters[12].Value = model.ChangeType; parameters[13].Value = model.ChangeRate; parameters[14].Value = model.DetectionPrinciple; parameters[15].Value = model.HasZs; parameters[16].Value = model.HasPf; parameters[17].Value = model.DecimalPlaces; parameters[18].Value = model.Sort; parameters[19].Value = model.RecordFlag; parameters[20].Value = model.ExcelServerRCID; parameters[21].Value = model.ExcelServerRN; parameters[22].Value = model.ExcelServerCN; parameters[23].Value = model.ExcelServerRC1; parameters[24].Value = model.ExcelServerWIID; parameters[25].Value = model.ExcelServerRTID; parameters[26].Value = model.ExcelServerCHG; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Maticsoft.Model.T_StationDev model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_StationDev("); strSql.Append("InstrumentID,PointCode,InstallDate,DevCode,DetectionPrinciple,RangeLow,RangeUp,Protocol,TransmissionType,DevStatus,Remark,ExcelServerRCID,ExcelServerRN,ExcelServerCN,ExcelServerRC1,ExcelServerWIID,ExcelServerRTID,ExcelServerCHG,RecordFlag,PointID,Processmetermodel,Inputtime,currentsituation)"); strSql.Append(" values ("); strSql.Append("@InstrumentID,@PointCode,@InstallDate,@DevCode,@DetectionPrinciple,@RangeLow,@RangeUp,@Protocol,@TransmissionType,@DevStatus,@Remark,@ExcelServerRCID,@ExcelServerRN,@ExcelServerCN,@ExcelServerRC1,@ExcelServerWIID,@ExcelServerRTID,@ExcelServerCHG,@RecordFlag,@PointID,@Processmetermodel,@Inputtime,@currentsituation)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@InstrumentID", SqlDbType.NVarChar, 50), new SqlParameter("@PointCode", SqlDbType.NVarChar, 50), new SqlParameter("@InstallDate", SqlDbType.DateTime), new SqlParameter("@DevCode", SqlDbType.NVarChar, 50), new SqlParameter("@DetectionPrinciple", SqlDbType.NVarChar, 50), new SqlParameter("@RangeLow", SqlDbType.NVarChar, 255), new SqlParameter("@RangeUp", SqlDbType.NVarChar, 255), new SqlParameter("@Protocol", SqlDbType.NVarChar, 50), new SqlParameter("@TransmissionType", SqlDbType.NVarChar, 50), new SqlParameter("@DevStatus", SqlDbType.NVarChar, 50), new SqlParameter("@Remark", SqlDbType.NVarChar, 255), new SqlParameter("@ExcelServerRCID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerCN", SqlDbType.Int, 4), new SqlParameter("@ExcelServerRC1", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerWIID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerRTID", SqlDbType.NVarChar, 20), new SqlParameter("@ExcelServerCHG", SqlDbType.Int, 4), new SqlParameter("@RecordFlag", SqlDbType.NVarChar, 25), new SqlParameter("@PointID", SqlDbType.Int, 4), new SqlParameter("@Processmetermodel", SqlDbType.NVarChar, 50), new SqlParameter("@Inputtime", SqlDbType.DateTime), new SqlParameter("@currentsituation", SqlDbType.NVarChar, 50) }; parameters[0].Value = model.InstrumentID; parameters[1].Value = model.PointCode; parameters[2].Value = model.InstallDate; parameters[3].Value = model.DevCode; parameters[4].Value = model.DetectionPrinciple; parameters[5].Value = model.RangeLow; parameters[6].Value = model.RangeUp; parameters[7].Value = model.Protocol; parameters[8].Value = model.TransmissionType; parameters[9].Value = model.DevStatus; parameters[10].Value = model.Remark; parameters[11].Value = model.ExcelServerRCID; parameters[12].Value = model.ExcelServerRN; parameters[13].Value = model.ExcelServerCN; parameters[14].Value = model.ExcelServerRC1; parameters[15].Value = model.ExcelServerWIID; parameters[16].Value = model.ExcelServerRTID; parameters[17].Value = model.ExcelServerCHG; parameters[18].Value = model.RecordFlag; parameters[19].Value = model.PointID; parameters[20].Value = model.Processmetermodel; parameters[21].Value = model.Inputtime; parameters[22].Value = model.currentsituation; object obj = DbBaseHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }