Пример #1
0
        public int RemoveText(string text, IUnitOfData unit)
        {
            string       sql  = "DELETE FROM {0}  WHERE {1} = @txt  {2} ".AkFormat(TableName, TXTFileName, AndFilterSql);
            SqlParameter sql1 = new SqlParameter("@txt", text);

            // SqlParameter sql2 = new SqlParameter("@sign", SignName);

            return(unit.RegisterSqlCommand(sql, sql1));
        }
Пример #2
0
        public void InsertActive(ActiveModel bean)
        {
            // throw new NotImplementedException();
            string _sql = "INSERT INTO SNS_ACTIVITIES( FID ,USERID ,USERNAME,ACTIVITYITEMTYPE," +
                          " ACTIVITYITEMACTION,SOURCEID,PRIVACYSTATUS ,CREATE_ID,REFERENCEID,REFERENCENAME " +
                          " ,CREATE_TIME,UPDATE_ID ,UPDATE_TIME,FControlUnitID,ISDELETE  ,SACT_TITLE ,SACT_SUBCONTENT,ACTIVITYFROM,OWNERID,ACTIVITYSTATUS)" +
                          " VALUES ( @FID ,@USERID ,@USERNAME,@ACTIVITYITEMTYPE," +
                          " @ACTIVITYITEMACTION,@SOURCEID,@PRIVACYSTATUS ,@CREATE_ID,@REFERENCEID,@REFERENCENAME " +
                          " ,@CREATE_TIME,@UPDATE_ID ,@UPDATE_TIME,@FControlUnitID,@ISDELETE  ,@SACT_TITLE ,@SACT_SUBCONTENT,@ACTIVITYFROM,@OWNERID,@ACTIVITYSTATUS)";

            List <SqlParameter> pams = new List <SqlParameter>();

            pams.Add(new SqlParameter("@FID", SqlDbType.VarChar)
            {
                SqlValue = fUnitOfData.GetUniId()
            });
            pams.Add(new SqlParameter("@USERID", SqlDbType.VarChar)
            {
                SqlValue = bean.UserId
            });
            pams.Add(new SqlParameter("@USERNAME", SqlDbType.VarChar)
            {
                SqlValue = bean.UserName
            });
            pams.Add(new SqlParameter("@ACTIVITYITEMTYPE", SqlDbType.NVarChar)
            {
                Value = bean.ItemType
            });
            pams.Add(new SqlParameter("@PRIVACYSTATUS", SqlDbType.NVarChar)
            {
                SqlValue = bean.PrivacyStatus
            });
            pams.Add(new SqlParameter("@ACTIVITYITEMACTION", SqlDbType.NVarChar)
            {
                SqlValue = bean.ItemAction
            });
            pams.Add(new SqlParameter("@CREATE_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.UserId.IsEmpty() ? AtawAppContext.Current.UserId : bean.UserId
            });
            pams.Add(new SqlParameter("@CREATE_TIME", SqlDbType.DateTime)
            {
                SqlValue = fUnitOfData.Now
            });
            pams.Add(new SqlParameter("@UPDATE_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.FID
            });
            pams.Add(new SqlParameter("@UPDATE_TIME", SqlDbType.NVarChar)
            {
                SqlValue = fUnitOfData.Now
            });
            pams.Add(new SqlParameter("@FControlUnitID", SqlDbType.NVarChar)
            {
                SqlValue = bean.FControlUnitID.IsEmpty() ? AtawAppContext.Current.FControlUnitID : bean.FControlUnitID
            });
            pams.Add(new SqlParameter("@ISDELETE", SqlDbType.Bit)
            {
                SqlValue = 0
            });

            pams.Add(new SqlParameter("@SOURCEID", SqlDbType.NVarChar)
            {
                SqlValue = bean.SourceId
            });
            pams.Add(new SqlParameter("@SACT_TITLE", SqlDbType.NVarChar)
            {
                SqlValue = bean.Title
            });
            pams.Add(new SqlParameter("@SACT_SUBCONTENT", SqlDbType.NVarChar)
            {
                SqlValue = bean.SubContent
            });
            pams.Add(new SqlParameter("@ACTIVITYFROM", SqlDbType.NVarChar)
            {
                SqlValue = bean.ActivityFrom
            });
            pams.Add(new SqlParameter("@OWNERID", SqlDbType.NVarChar)
            {
                SqlValue = bean.OwnerID
            });

            pams.Add(new SqlParameter("@ACTIVITYSTATUS", SqlDbType.Int)
            {
                SqlValue = 0
            });
            pams.Add(new SqlParameter("@REFERENCEID", SqlDbType.NVarChar)
            {
                SqlValue = bean.ReferenceID
            });
            pams.Add(new SqlParameter("@REFERENCENAME", SqlDbType.NVarChar)
            {
                SqlValue = bean.ReferenceName
            });

            fUnitOfData.RegisterSqlCommand(_sql, pams.ToArray());
        }
Пример #3
0
        public void InsertMessage(MessageModel bean)
        {
            // throw new NotImplementedException();
            string _sql = "INSERT INTO ATAW_MESSAGES(FID,TENANT_ID,APPLICATION_ID,ORGANIZATION_ID,MODULE_ID," +
                          "SOURCE_ID,SEND_ID,RECEIVE_ID,BODY,TYPE,CATEGORY,PRIVACY,ISHANDLED,CREATE_ID,CREATE_TIME" +
                          " VALUES (@FID,@TENANT_ID,@APPLICATION_ID,@ORGANIZATION_ID," +
                          "@MODULE_ID,@SOURCE_ID,@SEND_ID,@RECEIVE_ID,@BODY,@TYPE,@CATEGORY,@PRIVACY,@ISHANDLED,@CREATE_ID,@CREATE_TIME)";

            List <SqlParameter> pams = new List <SqlParameter>();

            pams.Add(new SqlParameter("@FID", SqlDbType.NVarChar)
            {
                SqlValue = fUnitOfData.GetUniId()
            });
            pams.Add(new SqlParameter("@TENANT_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.TenantID
            });
            pams.Add(new SqlParameter("@APPLICATION_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.ApplicationID
            });
            pams.Add(new SqlParameter("@ORGANIZATION_ID", SqlDbType.NVarChar)
            {
                Value = bean.OrganizationID
            });
            pams.Add(new SqlParameter("@MODULE_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.ModuleID
            });
            pams.Add(new SqlParameter("@SOURCE_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.SourceID
            });
            pams.Add(new SqlParameter("@SEND_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.SendID
            });
            pams.Add(new SqlParameter("@RECEIVE_ID", SqlDbType.NVarChar)
            {
                SqlValue = bean.ReceiveID
            });
            pams.Add(new SqlParameter("@BODY", SqlDbType.NVarChar)
            {
                SqlValue = bean.Body
            });
            pams.Add(new SqlParameter("@TYPE", SqlDbType.NVarChar)
            {
                SqlValue = bean.Type
            });
            pams.Add(new SqlParameter("@CATEGORY", SqlDbType.NVarChar)
            {
                SqlValue = bean.Category
            });
            pams.Add(new SqlParameter("@PRIVACY", SqlDbType.NVarChar)
            {
                SqlValue = bean.Privacy
            });
            pams.Add(new SqlParameter("@ISHANDLED", SqlDbType.NVarChar)
            {
                SqlValue = bean.IsHandled
            });
            pams.Add(new SqlParameter("@CREATE_ID", SqlDbType.NVarChar)
            {
                SqlValue = AtawAppContext.Current.UserId
            });
            pams.Add(new SqlParameter("@CREATE_TIME", SqlDbType.DateTime)
            {
                SqlValue = fUnitOfData.Now
            });

            fUnitOfData.RegisterSqlCommand(_sql, pams.ToArray());
        }