/// <summary> /// ����һ������ /// </summary> public int Add(Csts_importdata.Model.UpFiles model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into UpFiles("); strSql.Append("GCRecord,Name,path,DocId,UpTime,UserId,OptimisticLockField,Small,IsDel)"); strSql.Append(" values ("); strSql.Append("@GCRecord,@Name,@path,@DocId,@UpTime,@UserId,@OptimisticLockField,@Small,@IsDel)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@GCRecord", SqlDbType.Int,4), new SqlParameter("@Name", SqlDbType.NVarChar,100), new SqlParameter("@path", SqlDbType.NVarChar,4000), new SqlParameter("@DocId", SqlDbType.Int,4), new SqlParameter("@UpTime", SqlDbType.DateTime), new SqlParameter("@UserId", SqlDbType.Int,4), new SqlParameter("@OptimisticLockField", SqlDbType.Int,4), new SqlParameter("@Small", SqlDbType.NVarChar,4000), new SqlParameter("@IsDel", SqlDbType.Bit,1)}; parameters[0].Value = model.GCRecord; parameters[1].Value = model.Name; parameters[2].Value = model.path; parameters[3].Value = model.DocId; parameters[4].Value = model.UpTime; parameters[5].Value = model.UserId; parameters[6].Value = model.OptimisticLockField; parameters[7].Value = model.Small; parameters[8].Value = model.IsDel; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 1; } else { return Convert.ToInt32(obj); } }
/// <summary> /// ����һ������ /// </summary> public void Update(Csts_importdata.Model.UpFiles model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update UpFiles set "); strSql.Append("GCRecord=@GCRecord,"); strSql.Append("Name=@Name,"); strSql.Append("path=@path,"); strSql.Append("DocId=@DocId,"); strSql.Append("UpTime=@UpTime,"); strSql.Append("UserId=@UserId,"); strSql.Append("OptimisticLockField=@OptimisticLockField,"); strSql.Append("Small=@Small,"); strSql.Append("IsDel=@IsDel"); strSql.Append(" where OID=@OID "); SqlParameter[] parameters = { new SqlParameter("@GCRecord", SqlDbType.Int,4), new SqlParameter("@OID", SqlDbType.Int,4), new SqlParameter("@Name", SqlDbType.NVarChar,100), new SqlParameter("@path", SqlDbType.NVarChar,4000), new SqlParameter("@DocId", SqlDbType.Int,4), new SqlParameter("@UpTime", SqlDbType.DateTime), new SqlParameter("@UserId", SqlDbType.Int,4), new SqlParameter("@OptimisticLockField", SqlDbType.Int,4), new SqlParameter("@Small", SqlDbType.NVarChar,4000), new SqlParameter("@IsDel", SqlDbType.Bit,1)}; parameters[0].Value = model.GCRecord; parameters[1].Value = model.OID; parameters[2].Value = model.Name; parameters[3].Value = model.path; parameters[4].Value = model.DocId; parameters[5].Value = model.UpTime; parameters[6].Value = model.UserId; parameters[7].Value = model.OptimisticLockField; parameters[8].Value = model.Small; parameters[9].Value = model.IsDel; DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); }
/// <summary> /// ����һ������ /// </summary> public void Update(Csts_importdata.Model.UpFiles model) { dal.Update(model); }
/// <summary> /// ����һ������ /// </summary> public int Add(Csts_importdata.Model.UpFiles model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(Csts_importdata.Model.Doc model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Doc set "); strSql.Append("GCRecord=@GCRecord,"); strSql.Append("SortId=@SortId,"); strSql.Append("SortChildId=@SortChildId,"); strSql.Append("DraftUserId=@DraftUserId,"); strSql.Append("CheckUserId=@CheckUserId,"); strSql.Append("DepartmentId=@DepartmentId,"); strSql.Append("Name=@Name,"); strSql.Append("Content=@Content,"); strSql.Append("DraftTime=@DraftTime,"); strSql.Append("ViewCount=@ViewCount,"); strSql.Append("IsView=@IsView,"); strSql.Append("IsDel=@IsDel,"); strSql.Append("Notice=@Notice,"); strSql.Append("OptimisticLockField=@OptimisticLockField,"); strSql.Append("Hit=@Hit,"); strSql.Append("OrderTime=@OrderTime,"); strSql.Append("sortid1=@sortid1,"); strSql.Append("CheckTime=@CheckTime,"); strSql.Append("PassUserId=@PassUserId,"); strSql.Append("PassTime=@PassTime,"); strSql.Append("Finish=@Finish,"); strSql.Append("Class=@Class,"); strSql.Append("Step=@Step,"); strSql.Append("typelist=@typelist"); strSql.Append(" where OID=@OID "); SqlParameter[] parameters = { new SqlParameter("@GCRecord", SqlDbType.Int,4), new SqlParameter("@OID", SqlDbType.Int,4), new SqlParameter("@SortId", SqlDbType.Int,4), new SqlParameter("@SortChildId", SqlDbType.Int,4), new SqlParameter("@DraftUserId", SqlDbType.Int,4), new SqlParameter("@CheckUserId", SqlDbType.Int,4), new SqlParameter("@DepartmentId", SqlDbType.Int,4), new SqlParameter("@Name", SqlDbType.NVarChar,100), new SqlParameter("@Content", SqlDbType.NText), new SqlParameter("@DraftTime", SqlDbType.DateTime), new SqlParameter("@ViewCount", SqlDbType.Int,4), new SqlParameter("@IsView", SqlDbType.NVarChar,100), new SqlParameter("@IsDel", SqlDbType.Bit,1), new SqlParameter("@Notice", SqlDbType.Bit,1), new SqlParameter("@OptimisticLockField", SqlDbType.Int,4), new SqlParameter("@Hit", SqlDbType.Int,4), new SqlParameter("@OrderTime", SqlDbType.DateTime), new SqlParameter("@sortid1", SqlDbType.Int,4), new SqlParameter("@CheckTime", SqlDbType.DateTime), new SqlParameter("@PassUserId", SqlDbType.Int,4), new SqlParameter("@PassTime", SqlDbType.DateTime), new SqlParameter("@Finish", SqlDbType.Bit,1), new SqlParameter("@Class", SqlDbType.Int,4), new SqlParameter("@Step", SqlDbType.Int,4), new SqlParameter("@typelist", SqlDbType.VarChar,200)}; parameters[0].Value = model.GCRecord; parameters[1].Value = model.OID; parameters[2].Value = model.SortId; parameters[3].Value = model.SortChildId; parameters[4].Value = model.DraftUserId; parameters[5].Value = model.CheckUserId; parameters[6].Value = model.DepartmentId; parameters[7].Value = model.Name; parameters[8].Value = model.Content; parameters[9].Value = model.DraftTime; parameters[10].Value = model.ViewCount; parameters[11].Value = model.IsView; parameters[12].Value = model.IsDel; parameters[13].Value = model.Notice; parameters[14].Value = model.OptimisticLockField; parameters[15].Value = model.Hit; parameters[16].Value = model.OrderTime; parameters[17].Value = model.sortid1; parameters[18].Value = model.CheckTime; parameters[19].Value = model.PassUserId; parameters[20].Value = model.PassTime; parameters[21].Value = model.Finish; parameters[22].Value = model.Class; parameters[23].Value = model.Step; parameters[24].Value = model.typelist; DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); }
/// <summary> /// ����һ������ /// </summary> public int Add(Csts_importdata.Model.Doc model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Doc("); strSql.Append("GCRecord,SortId,SortChildId,DraftUserId,CheckUserId,DepartmentId,Name,Content,DraftTime,ViewCount,IsView,IsDel,Notice,OptimisticLockField,Hit,OrderTime,sortid1,CheckTime,PassUserId,PassTime,Finish,Class,Step,typelist)"); strSql.Append(" values ("); strSql.Append("@GCRecord,@SortId,@SortChildId,@DraftUserId,@CheckUserId,@DepartmentId,@Name,@Content,@DraftTime,@ViewCount,@IsView,@IsDel,@Notice,@OptimisticLockField,@Hit,@OrderTime,@sortid1,@CheckTime,@PassUserId,@PassTime,@Finish,@Class,@Step,@typelist)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@GCRecord", SqlDbType.Int,4), new SqlParameter("@SortId", SqlDbType.Int,4), new SqlParameter("@SortChildId", SqlDbType.Int,4), new SqlParameter("@DraftUserId", SqlDbType.Int,4), new SqlParameter("@CheckUserId", SqlDbType.Int,4), new SqlParameter("@DepartmentId", SqlDbType.Int,4), new SqlParameter("@Name", SqlDbType.NVarChar,100), new SqlParameter("@Content", SqlDbType.NText), new SqlParameter("@DraftTime", SqlDbType.DateTime), new SqlParameter("@ViewCount", SqlDbType.Int,4), new SqlParameter("@IsView", SqlDbType.NVarChar,100), new SqlParameter("@IsDel", SqlDbType.Bit,1), new SqlParameter("@Notice", SqlDbType.Bit,1), new SqlParameter("@OptimisticLockField", SqlDbType.Int,4), new SqlParameter("@Hit", SqlDbType.Int,4), new SqlParameter("@OrderTime", SqlDbType.DateTime), new SqlParameter("@sortid1", SqlDbType.Int,4), new SqlParameter("@CheckTime", SqlDbType.DateTime), new SqlParameter("@PassUserId", SqlDbType.Int,4), new SqlParameter("@PassTime", SqlDbType.DateTime), new SqlParameter("@Finish", SqlDbType.Bit,1), new SqlParameter("@Class", SqlDbType.Int,4), new SqlParameter("@Step", SqlDbType.Int,4), new SqlParameter("@typelist", SqlDbType.VarChar,200)}; parameters[0].Value = model.GCRecord; parameters[1].Value = model.SortId; parameters[2].Value = model.SortChildId; parameters[3].Value = model.DraftUserId; parameters[4].Value = model.CheckUserId; parameters[5].Value = model.DepartmentId; parameters[6].Value = model.Name; parameters[7].Value = model.Content; parameters[8].Value = model.DraftTime; parameters[9].Value = model.ViewCount; parameters[10].Value = model.IsView; parameters[11].Value = model.IsDel; parameters[12].Value = model.Notice; parameters[13].Value = model.OptimisticLockField; parameters[14].Value = model.Hit; parameters[15].Value = model.OrderTime; parameters[16].Value = model.sortid1; parameters[17].Value = model.CheckTime; parameters[18].Value = model.PassUserId; parameters[19].Value = model.PassTime; parameters[20].Value = model.Finish; parameters[21].Value = model.Class; parameters[22].Value = model.Step; parameters[23].Value = model.typelist; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 1; } else { return Convert.ToInt32(obj); } }
/// <summary> /// ����һ������ /// </summary> public int Add(Csts_importdata.Model.Sort model) { return dal.Add(model); }
/// <summary> /// ����һ������ /// </summary> public void Update(Csts_importdata.Model.Sort model) { StringBuilder strSql=new StringBuilder(); strSql.Append("update Sort set "); strSql.Append("GCRecord=@GCRecord,"); strSql.Append("Name=@Name,"); strSql.Append("Nick=@Nick,"); strSql.Append("State=@State,"); strSql.Append("First=@First,"); strSql.Append("Second=@Second,"); strSql.Append("Third=@Third,"); strSql.Append("IsIndex=@IsIndex,"); strSql.Append("IndexCount=@IndexCount,"); strSql.Append("Count=@Count,"); strSql.Append("Num=@Num,"); strSql.Append("WebLink=@WebLink,"); strSql.Append("Pic=@Pic,"); strSql.Append("Depth=@Depth,"); strSql.Append("ParentID=@ParentID,"); strSql.Append("Path=@Path,"); strSql.Append("Child=@Child,"); strSql.Append("OrderID=@OrderID,"); strSql.Append("IsLastNode=@IsLastNode,"); strSql.Append("OptimisticLockField=@OptimisticLockField,"); strSql.Append("IsDel=@IsDel,"); strSql.Append("typelist=@typelist,"); strSql.Append("iszt=@iszt,"); strSql.Append("isfirstnews=@isfirstnews,"); strSql.Append("isnewpage=@isnewpage"); strSql.Append(" where OID=@OID "); SqlParameter[] parameters = { new SqlParameter("@GCRecord", SqlDbType.Int,4), new SqlParameter("@OID", SqlDbType.Int,4), new SqlParameter("@Name", SqlDbType.NVarChar,100), new SqlParameter("@Nick", SqlDbType.NVarChar,100), new SqlParameter("@State", SqlDbType.Int,4), new SqlParameter("@First", SqlDbType.NVarChar,100), new SqlParameter("@Second", SqlDbType.NVarChar,100), new SqlParameter("@Third", SqlDbType.NVarChar,100), new SqlParameter("@IsIndex", SqlDbType.Bit,1), new SqlParameter("@IndexCount", SqlDbType.Int,4), new SqlParameter("@Count", SqlDbType.Int,4), new SqlParameter("@Num", SqlDbType.Int,4), new SqlParameter("@WebLink", SqlDbType.NVarChar,4000), new SqlParameter("@Pic", SqlDbType.NVarChar,4000), new SqlParameter("@Depth", SqlDbType.Int,4), new SqlParameter("@ParentID", SqlDbType.Int,4), new SqlParameter("@Path", SqlDbType.NVarChar,100), new SqlParameter("@Child", SqlDbType.Int,4), new SqlParameter("@OrderID", SqlDbType.Int,4), new SqlParameter("@IsLastNode", SqlDbType.Bit,1), new SqlParameter("@OptimisticLockField", SqlDbType.Int,4), new SqlParameter("@IsDel", SqlDbType.Bit,1), new SqlParameter("@typelist", SqlDbType.VarChar,200), new SqlParameter("@iszt", SqlDbType.Bit,1), new SqlParameter("@isfirstnews", SqlDbType.Bit,1), new SqlParameter("@isnewpage", SqlDbType.Bit,1)}; parameters[0].Value = model.GCRecord; parameters[1].Value = model.OID; parameters[2].Value = model.Name; parameters[3].Value = model.Nick; parameters[4].Value = model.State; parameters[5].Value = model.First; parameters[6].Value = model.Second; parameters[7].Value = model.Third; parameters[8].Value = model.IsIndex; parameters[9].Value = model.IndexCount; parameters[10].Value = model.Count; parameters[11].Value = model.Num; parameters[12].Value = model.WebLink; parameters[13].Value = model.Pic; parameters[14].Value = model.Depth; parameters[15].Value = model.ParentID; parameters[16].Value = model.Path; parameters[17].Value = model.Child; parameters[18].Value = model.OrderID; parameters[19].Value = model.IsLastNode; parameters[20].Value = model.OptimisticLockField; parameters[21].Value = model.IsDel; parameters[22].Value = model.typelist; parameters[23].Value = model.iszt; parameters[24].Value = model.isfirstnews; parameters[25].Value = model.isnewpage; DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); }
/// <summary> /// ����һ������ /// </summary> public int Add(Csts_importdata.Model.Sort model) { StringBuilder strSql=new StringBuilder(); strSql.Append("insert into Sort("); strSql.Append("GCRecord,Name,Nick,State,First,Second,Third,IsIndex,IndexCount,Count,Num,WebLink,Pic,Depth,ParentID,Path,Child,OrderID,IsLastNode,OptimisticLockField,IsDel,typelist,iszt,isfirstnews,isnewpage)"); strSql.Append(" values ("); strSql.Append("@GCRecord,@Name,@Nick,@State,@First,@Second,@Third,@IsIndex,@IndexCount,@Count,@Num,@WebLink,@Pic,@Depth,@ParentID,@Path,@Child,@OrderID,@IsLastNode,@OptimisticLockField,@IsDel,@typelist,@iszt,@isfirstnews,@isnewpage)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@GCRecord", SqlDbType.Int,4), new SqlParameter("@Name", SqlDbType.NVarChar,100), new SqlParameter("@Nick", SqlDbType.NVarChar,100), new SqlParameter("@State", SqlDbType.Int,4), new SqlParameter("@First", SqlDbType.NVarChar,100), new SqlParameter("@Second", SqlDbType.NVarChar,100), new SqlParameter("@Third", SqlDbType.NVarChar,100), new SqlParameter("@IsIndex", SqlDbType.Bit,1), new SqlParameter("@IndexCount", SqlDbType.Int,4), new SqlParameter("@Count", SqlDbType.Int,4), new SqlParameter("@Num", SqlDbType.Int,4), new SqlParameter("@WebLink", SqlDbType.NVarChar,4000), new SqlParameter("@Pic", SqlDbType.NVarChar,4000), new SqlParameter("@Depth", SqlDbType.Int,4), new SqlParameter("@ParentID", SqlDbType.Int,4), new SqlParameter("@Path", SqlDbType.NVarChar,100), new SqlParameter("@Child", SqlDbType.Int,4), new SqlParameter("@OrderID", SqlDbType.Int,4), new SqlParameter("@IsLastNode", SqlDbType.Bit,1), new SqlParameter("@OptimisticLockField", SqlDbType.Int,4), new SqlParameter("@IsDel", SqlDbType.Bit,1), new SqlParameter("@typelist", SqlDbType.VarChar,200), new SqlParameter("@iszt", SqlDbType.Bit,1), new SqlParameter("@isfirstnews", SqlDbType.Bit,1), new SqlParameter("@isnewpage", SqlDbType.Bit,1)}; parameters[0].Value = model.GCRecord; parameters[1].Value = model.Name; parameters[2].Value = model.Nick; parameters[3].Value = model.State; parameters[4].Value = model.First; parameters[5].Value = model.Second; parameters[6].Value = model.Third; parameters[7].Value = model.IsIndex; parameters[8].Value = model.IndexCount; parameters[9].Value = model.Count; parameters[10].Value = model.Num; parameters[11].Value = model.WebLink; parameters[12].Value = model.Pic; parameters[13].Value = model.Depth; parameters[14].Value = model.ParentID; parameters[15].Value = model.Path; parameters[16].Value = model.Child; parameters[17].Value = model.OrderID; parameters[18].Value = model.IsLastNode; parameters[19].Value = model.OptimisticLockField; parameters[20].Value = model.IsDel; parameters[21].Value = model.typelist; parameters[22].Value = model.iszt; parameters[23].Value = model.isfirstnews; parameters[24].Value = model.isnewpage; object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters); if (obj == null) { return 1; } else { return Convert.ToInt32(obj); } }