/// <summary> /// 方法说明:卡片修改 /// 作 者:jason.tang /// 完成时间:2013-03-11 /// </summary> /// <param name="card">卡片实体</param> /// <returns>True/False</returns> public static bool UpdateProcessCard(Kingdee.CAPP.Model.ProcessCard card) { string strsql = @"UPDATE [dbo].[ProcessCard] set [CardXml]=@CardXml ,[CreateTime]=@CreateTime ,[CreateBy]=@CreateBy ,[UpdateTime]=@UpdateTime ,[IsDelete]=@IsDelete ,[IsCheckout]=@IsCheckout where ID=@ID"; string xmlstr = SerializeHelper.Serialize <CardsXML>(card.Card); using (DbCommand cmd = db.GetSqlStringCommand(strsql)) { db.AddInParameter(cmd, "@ID", DbType.Guid, card.ID); db.AddInParameter(cmd, "@CardXML", DbType.Xml, xmlstr); db.AddInParameter(cmd, "@CreateTime", DbType.DateTime, DateTime.Now); db.AddInParameter(cmd, "@CreateBy", DbType.String, card.CreateBy); db.AddInParameter(cmd, "@UpdateTime", DbType.DateTime, DateTime.Now); db.AddInParameter(cmd, "@IsDelete", DbType.Int16, 0); db.AddInParameter(cmd, "@IsCheckout", DbType.Boolean, false); db.ExecuteScalar(cmd); return(true); } }
/// <summary> /// insert process card /// </summary> /// <param name="card"></param> /// <returns></returns> public static Guid AddProcessCard(Kingdee.CAPP.Model.ProcessCard card) { string strsql = @"INSERT INTO [dbo].[ProcessCard] ([Id] ,Name ,[CardModuleId] ,[CardXml] ,[CreateTime] ,[CreateBy] ,[UpdateTime] ,[IsDelete] ,[IsCheckOut]) VALUES ( @ID ,@Name ,@CardModuleId ,@CardXml ,@CreateTime ,@CreateBy ,@UpdateTime ,@IsDelete ,@IsCheckout)"; string xmlstr = SerializeHelper.Serialize <CardsXML>(card.Card); using (DbCommand cmd = db.GetSqlStringCommand(strsql)) { Guid id = Guid.NewGuid(); db.AddInParameter(cmd, "@ID", DbType.Guid, id); db.AddInParameter(cmd, "@Name", DbType.String, card.Name); db.AddInParameter(cmd, "@CardModuleId", DbType.Guid, card.CardModuleId); db.AddInParameter(cmd, "@CardXML", DbType.Xml, xmlstr); db.AddInParameter(cmd, "@CreateTime", DbType.DateTime, DateTime.Now); db.AddInParameter(cmd, "@CreateBy", DbType.String, card.CreateBy); db.AddInParameter(cmd, "@UpdateTime", DbType.DateTime, DateTime.Now); db.AddInParameter(cmd, "@IsDelete", DbType.Int16, card.IsDelete); db.AddInParameter(cmd, "@IsCheckout", DbType.Boolean, card.IsCheckOut); db.ExecuteScalar(cmd); return(id); } }