Esempio n. 1
0
        /// <summary>
        /// Modified process cardmodule
        /// </summary>
        /// <param name="card"></param>
        /// <returns></returns>
        public static bool UpdateProcessCardModule(Kingdee.CAPP.Model.ProcessCardModule card)
        {
            string strsql = @"UPDATE [dbo].[ProcessCardModule]                                   
                                   set [CardModuleXML]=@CardModuleXML
                                   ,[FixedMapValues]=@FixedMapValues
                                   ,[DetailMapValues]=@DetailMapValues
                                   ,[TitleMapValues]=@TitleMapValues
                                   ,[CreateTime]=@CreateTime
                                   ,[CreateBy]=@CreateBy
                                   ,[UpdateTime]=@UpdateTime
                                   ,[IsDelete]=@IsDelete
                                   ,[IsCheckout]=@IsCheckout
                             where ID=@ID";

            string xmlstr = SerializeHelper.Serialize <CardsXML>(card.CardModule);

            using (DbCommand cmd = db.GetSqlStringCommand(strsql))
            {
                db.AddInParameter(cmd, "@ID", DbType.Guid, card.Id);
                db.AddInParameter(cmd, "@CardModuleXML", DbType.String, xmlstr);
                db.AddInParameter(cmd, "@FixedMapValues", DbType.String, card.FixedMapValues);
                db.AddInParameter(cmd, "@DetailMapValues", DbType.String, card.DetailMapValues);
                db.AddInParameter(cmd, "@TitleMapValues", DbType.String, card.TitleMapValues);
                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);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// insert process card module
        /// </summary>
        /// <param name="card"></param>
        /// <returns></returns>
        public static Guid AddProcessCard(Kingdee.CAPP.Model.ProcessCardModule card)
        {
            string strsql = @"INSERT INTO [dbo].[ProcessCardModule]
                                   (
                                    [ID]
                                   ,[Name]
                                   ,[CardModuleXML]
                                   ,[FixedMapValues]
                                   ,[DetailMapValues]
                                   ,[TitleMapValues]
                                   ,[CreateTime]
                                   ,[CreateBy]
                                   ,[UpdateTime]
                                   ,[IsDelete]
                                   ,[IsCheckout])
                             VALUES
                                   (
                                    @ID
                                   ,@Name
                                   ,@CardModuleXML
                                   ,@FixedMapValues
                                   ,@DetailMapValues
                                   ,@TitleMapValues
                                   ,@CreateTime
                                   ,@CreateBy
                                   ,@UpdateTime
                                   ,@IsDelete
                                   ,@IsCheckout)";

            string xmlstr = SerializeHelper.Serialize <CardsXML>(card.CardModule);

            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, "@CardModuleXML", DbType.String, xmlstr);
                db.AddInParameter(cmd, "@FixedMapValues", DbType.String, card.FixedMapValues);
                db.AddInParameter(cmd, "@DetailMapValues", DbType.String, card.DetailMapValues);
                db.AddInParameter(cmd, "@TitleMapValues", DbType.String, card.TitleMapValues);
                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);
                card.Id = id;
                return(id);
            }
        }