Exemplo n.º 1
0
        public IActionResult OnGet(string id, string redirect)
        {
            // Authorization
            AuthorizationResult authorizationResult;

            if (!Authorization.CheckAuthorization(HttpContext, MySQL, HttpContext.Response, out authorizationResult))
            {
                return(StatusCode(authorizationResult.StatusCode));
            }
            LoginUser = authorizationResult.Account;

            if (!string.IsNullOrEmpty(id))
            {
                ChangeCategory category = MySQL.Get <ChangeCategory>(Convert.ToInt32(id));
                Id       = id;
                Title    = category.TITLE;
                Redirect = redirect;
            }
            else
            {
                if (!String.IsNullOrEmpty(redirect))
                {
                    return(Redirect(Redirect));
                }
                return(Redirect("/Changes/Category"));
            }

            return(Page());
        }
Exemplo n.º 2
0
 public ResultStatus CreateParametricData(
     ChangeCategory changeCategory,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     return(this.CreateParametricData(changeCategory, (ChangeCategory_Parameters)null, request, out result));
 }
Exemplo n.º 3
0
 public ResultStatus ProcessComputation(
     ChangeCategory changeCategory,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     return(this.ProcessComputation(changeCategory, (ChangeCategory_Parameters)null, request, out result));
 }
Exemplo n.º 4
0
        public IActionResult OnGet(int id, string redirect)
        {
            // Authorization
            AuthorizationResult authorizationResult;

            if (!Authorization.CheckAuthorization(HttpContext, MySQL, HttpContext.Response, out authorizationResult))
            {
                return(StatusCode(authorizationResult.StatusCode));
            }
            LoginUser = authorizationResult.Account;

            if (!String.IsNullOrEmpty(Convert.ToString(id)))
            {
                ChangeCategory DeleteCategory = MySQL.Get <ChangeCategory>(id);
                MySQL.Delete(DeleteCategory);
            }
            if (String.IsNullOrEmpty(redirect))
            {
                return(Redirect("/Changes/Category/"));
            }
            else
            {
                return(Redirect(redirect));
            }
        }
Exemplo n.º 5
0
 public ResultStatus ValidateCategoryTransition(
     ChangeCategory changeCategory,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     return(this.ValidateCategoryTransition(changeCategory, (ChangeCategory_ValidateCategoryTransition_Parameters)null, request, out result));
 }
Exemplo n.º 6
0
 public ResultStatus SetTriageComplete(
     ChangeCategory changeCategory,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     return(this.SetTriageComplete(changeCategory, (ChangeCategory_Parameters)null, request, out result));
 }
Exemplo n.º 7
0
 public ChangeContextFilter(string contextName, Predicate<DocObject> objectSelector, ChangeCategory category)
 {
     m_selector = objectSelector;
     m_result = SummaryCategoryNode.Create(contextName + " Changes", category);
     m_unusedItems = new List<ISummaryItem>();
     m_result.ToolTipText = "Changes made to the " + contextName + "s of the document.";
 }
Exemplo n.º 8
0
 public ResultStatus GetActions(
     ChangeCategory changeCategory,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     return(this.GetActions(changeCategory, (ChangeCategory_Parameters)null, request, out result));
 }
Exemplo n.º 9
0
        public IActionResult OnGet(string id, string redirect)
        {
            // Authorization
            AuthorizationResult authorizationResult;

            if (!Authorization.CheckAuthorization(HttpContext, MySQL, HttpContext.Response, out authorizationResult))
            {
                return(StatusCode(authorizationResult.StatusCode));
            }
            LoginUser = authorizationResult.Account;

            if (!string.IsNullOrEmpty(id))
            {
                Redirect = redirect;
                Id       = id;

                Change Change = MySQL.Get <Change>(Convert.ToInt32(Id));
                Title           = Change.TITLE;
                Content         = Change.CHANGENEWS;
                CurrentCategory = MySQL.Get <ChangeCategory>(Change.CAT);
            }
            else
            {
                if (!String.IsNullOrEmpty(redirect))
                {
                    return(Redirect(Redirect));
                }
                return(Redirect("/Changes"));
            }
            Categories = MySQL.GetAll <ChangeCategory>();

            return(Page());
        }
Exemplo n.º 10
0
        static Texture GetChangeCategoryIcon(ChangeCategory category)
        {
            switch (category.Type)
            {
            case ChangeCategoryType.Merged:
                return(Images.GetImage(Images.Name.IconMerged));

            case ChangeCategoryType.Changed:
                return(Images.GetImage(Images.Name.IconChanged));

            case ChangeCategoryType.Moved:
                return(Images.GetImage(Images.Name.IconMoved));

            case ChangeCategoryType.Deleted:
                return(Images.GetImage(Images.Name.IconDeleted));

            case ChangeCategoryType.FSProtection:
                return(Images.GetImage(Images.Name.IconFsChanged));

            case ChangeCategoryType.Added:
                return(Images.GetImage(Images.Name.IconAdded));

            default:
                return(null);
            }
        }
Exemplo n.º 11
0
 public ResultStatus LoadESigDetails(
     ChangeCategory changeCategory,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     return(this.LoadESigDetails(changeCategory, (ChangeCategory_Parameters)null, request, out result));
 }
Exemplo n.º 12
0
 public ChangeTypeFilter(string headingText, Predicate<Change> predicate, ChangeCategory category, string tooltipText)
 {
     m_headingText = headingText;
     m_predicate = predicate;
     m_category = category;
     m_tooltipText = tooltipText;
 }
Exemplo n.º 13
0
            static ClientDiffInfo FindClientDiffOfType(
                string path,
                ChangeCategoryType type,
                ITreeViewNode node)
            {
                if (node is ClientDiffInfo)
                {
                    ClientDiffInfo clientDiffInfo = (ClientDiffInfo)node;
                    ChangeCategory category       = (ChangeCategory)node.GetParent();

                    if (category.Type == type &&
                        clientDiffInfo.DiffWithMount.Difference.Path == path)
                    {
                        return((ClientDiffInfo)node);
                    }
                }

                for (int i = 0; i < node.GetChildrenCount(); i++)
                {
                    ClientDiffInfo result = FindClientDiffOfType(path, type, node.GetChild(i));
                    if (result != null)
                    {
                        return(result);
                    }
                }

                return(null);
            }
Exemplo n.º 14
0
 internal FieldChange(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility, FieldDefinition field)
     : base(changeType, category, compatibility)
 {
     if (field == null)
     {
         throw new ArgumentNullException("field");
     }
     _field = field;
 }
Exemplo n.º 15
0
        /// <summary>
        /// 删除信息,写入记录日志
        /// </summary>
        /// <param name="category">类型</param>
        /// <param name="to">操作对象</param>
        /// <param name="tousertype">操作对象用户类型:会员、店铺、公司、管理员</param>
        /// <param name="remark">操作发生的数据改变记录信息</param>
        public static void DeletedIntoLogs(ChangeCategory category, string to, ENUM_USERTYPE tousertype, string remark)
        {
            // 自动化参数
            string from         = GetCurrentUserID();
            string fromusertype = GetCurrentUserType().ToString();
            int    qishu        = CommonDataBLL.getMaxqishu();

            AddChangeLog((int)ChangeType.Delete, category, from, fromusertype, to, tousertype.ToString(), qishu, remark, 0);
        }
Exemplo n.º 16
0
 internal MethodChange(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility, MethodDefinition method)
     : base(changeType, category, compatibility)
 {
     if (method == null)
     {
         throw new ArgumentNullException("method");
     }
     _method = method;
 }
Exemplo n.º 17
0
 internal TypeChange(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility, TypeDefinition type)
     : base(changeType, category, compatibility)
 {
     if (type == null)
     {
         throw new ArgumentNullException("type");
     }
     _type = type;
 }
Exemplo n.º 18
0
        public void ModifiedIntoLogstran(SqlTransaction tran, ChangeCategory category, string to, ENUM_USERTYPE tousertype)
        {
            // 自动化参数
            string from         = GetCurrentUserID();
            string fromusertype = GetCurrentUserType().ToString();
            int    qishu        = CommonDataBLL.getMaxqishu(tran);

            AddChangeLogtran(tran, (int)ChangeType.Modify, category, from, fromusertype, to, tousertype.ToString(), qishu, this._remarkinfo.Text, 0);
        }
Exemplo n.º 19
0
 public ChangeCategoryMethod(
     ChangeCategory Cdo,
     ChangeCategoryMethods Method,
     ChangeCategory_Parameters Parameters)
 {
     this.Cdo           = Cdo;
     this.ServiceMethod = Method;
     this.Parameters    = Parameters;
 }
Exemplo n.º 20
0
        internal static string ToSerializedValue(this ChangeCategory value)
        {
            switch (value)
            {
            case ChangeCategory.User:
                return("User");

            case ChangeCategory.System:
                return("System");
            }
            return(null);
        }
Exemplo n.º 21
0
                internal static MergeCategory GetMergeCategory(ClientDiffInfo diff)
                {
                    ChangeCategory changeCategory = GetChangeCategory(diff);

                    ITreeViewNode mergeCategory = changeCategory.GetParent();

                    if (mergeCategory == null)
                    {
                        return(null);
                    }

                    return((MergeCategory)mergeCategory);
                }
Exemplo n.º 22
0
                internal static string BuildCacheKey(
                    MergeCategory mergeCategory,
                    ChangeCategory changeCategory,
                    string path)
                {
                    string result = string.Concat(changeCategory.Type, ":", path);

                    if (mergeCategory == null)
                    {
                        return(result);
                    }

                    return(string.Concat(mergeCategory.GetCategoryNameSingular(), ":", result));
                }
Exemplo n.º 23
0
        public IActionResult OnPostAsync()
        {
            if (String.IsNullOrEmpty(Title))
            {
                return(Page());
            }

            ChangeCategory category = new ChangeCategory();

            category.TITLE = Title;

            MySQL.Insert(category);

            return(Redirect("/Changes/Category"));
        }
Exemplo n.º 24
0
 public ResultStatus GetEnvironment(
     ChangeCategory cdo,
     ChangeCategory_Request request,
     out ChangeCategory_Result result)
 {
     result = (ChangeCategory_Result)null;
     try
     {
         return(((IChangeCategoryService)this._Channel).GetEnvironment(this._UserProfile, cdo, request, out result));
     }
     catch (Exception ex)
     {
         return(this.OnThrowException(ex));
     }
 }
Exemplo n.º 25
0
        /// <summary>
        /// DS2012
        /// 添加修改日志记录过程
        /// </summary>
        /// <param name="type"></param>
        /// <param name="time"></param>
        /// <param name="sip"></param>
        /// <param name="category"></param>
        /// <param name="from"></param>
        /// <param name="fromusertype"></param>
        /// <param name="to"></param>
        /// <param name="tousertype"></param>
        /// <param name="qishu"></param>
        /// <param name="remark"></param>
        /// <param name="recordid"></param>
        /// <returns>返回插入成功的标识列ID,未插入记录返回"-1"</returns>
        private static int AddChangeLog(int type, DateTime time, string sip, ChangeCategory category, string from, string fromusertype, string to, string tousertype, int qishu, string remark, int recordid)
        {
            #region remark

            /*
             *          @Type smallint,
             *          @Time datetime,
             *          @SIP varchar(50),
             *          @Category varchar(10),
             *          @From varchar(20),
             *          @FromUserType varchar(10),
             *          @To varchar(20),
             *          @ToUserType varchar(10),
             *          @Qishu int,
             *          @Remark varchar(4000),
             *          @RecordID int output --返回插入成功的标识列ID
             */
            #endregion

            SqlParameter[] parms = new SqlParameter[11];

            parms[0]  = new SqlParameter("@Type", type);
            parms[1]  = new SqlParameter("@Time", time);
            parms[2]  = new SqlParameter("@SIP", sip);
            parms[3]  = new SqlParameter("@Category", (int)category);
            parms[4]  = new SqlParameter("@From", from);
            parms[5]  = new SqlParameter("@FromUserType", fromusertype);
            parms[6]  = new SqlParameter("@To", to);
            parms[7]  = new SqlParameter("@ToUserType", tousertype);
            parms[8]  = new SqlParameter("@Qishu", qishu);
            parms[9]  = new SqlParameter("@Remark", remark);
            parms[10] = new SqlParameter("@RecordID", recordid);
            // 输出参数,返回插入成功的标识列ID
            parms[10].Direction = ParameterDirection.Output;

            // 执行添加修改日志记录过程存储过程
            int rid = DBHelper.ExecuteNonQuery("AddChangeLog", parms, CommandType.StoredProcedure);

            if (rid > 0)
            {
                return((int)parms[10].Value);
            }
            else
            {
                return(-1);
            }
        }
Exemplo n.º 26
0
        public async Task ChangeCategory_should_create_events_and_update_state()
        {
            var command = new ChangeCategory { Name = "my-category" };

            await ExecuteCreateAsync();

            var result = await sut.ExecuteAsync(CreateCommand(command));

            result.ShouldBeEquivalent(sut.Snapshot);

            Assert.Equal(command.Name, sut.Snapshot.SchemaDef.Category);

            LastEvents
                .ShouldHaveSameEvents(
                    CreateEvent(new SchemaCategoryChanged { Name = command.Name })
                );
        }
Exemplo n.º 27
0
        public IActionResult OnPostAsync()
        {
            if (String.IsNullOrEmpty(Title))
            {
                return(Page());
            }

            ChangeCategory category = MySQL.Get <ChangeCategory>(Convert.ToInt32(Id));

            category.TITLE = Title;

            MySQL.Update(category);

            if (!String.IsNullOrEmpty(Redirect))
            {
                return(Redirect(Redirect));
            }
            return(Redirect("/Changes/Category"));
        }
Exemplo n.º 28
0
        public ResultStatus AddDataTransaction(ChangeCategory cdo)
        {
            this.OnBeforeCall(nameof(AddDataTransaction), (DCObject)cdo, (Parameters)null, (Request)null);
            ResultStatus res;

            try
            {
                res = !this._IsTransactionOpened ? this.GetAddDataTransactionException() : this.AddMethod((Method) new ChangeCategoryMethod(cdo, ChangeCategoryMethods.AddDataTransaction, (ChangeCategory_Parameters)null));
            }
            catch (Exception ex)
            {
                res = this.OnThrowException(ex);
            }
            if (res.IsSuccess)
            {
                Result result;
                this.OnAfterCall(nameof(AddDataTransaction), res, (DCObject)cdo, (Parameters)null, (Request)null, result);
            }
            return(res);
        }
Exemplo n.º 29
0
        public ResultStatus ExecuteTransaction(
            ChangeCategory cdo,
            ChangeCategory_Request request,
            out ChangeCategory_Result result)
        {
            result = (ChangeCategory_Result)null;
            this.OnBeforeCall(nameof(ExecuteTransaction), (DCObject)cdo, (Parameters)null, (Request)request);
            ResultStatus res;

            try
            {
                res = !this._IsTransactionOpened ? ((IChangeCategoryService)this._Channel).ExecuteTransaction(this._UserProfile, cdo, request, out result) : this.AddMethod((Method) new ChangeCategoryMethod(cdo, ChangeCategoryMethods.ExecuteTransaction, (ChangeCategory_Parameters)null));
            }
            catch (Exception ex)
            {
                res = this.OnThrowException(ex);
            }
            if (res.IsSuccess)
            {
                this.OnAfterCall(nameof(ExecuteTransaction), res, (DCObject)cdo, (Parameters)null, (Request)request, (Result)result);
            }
            return(res);
        }
Exemplo n.º 30
0
        public ResultStatus GetActions(
            ChangeCategory changeCategory,
            ChangeCategory_Parameters parameters,
            ChangeCategory_Request request,
            out ChangeCategory_Result result)
        {
            result = (ChangeCategory_Result)null;
            this.OnBeforeCall(nameof(GetActions), (DCObject)changeCategory, (Parameters)parameters, (Request)request);
            ResultStatus res;

            try
            {
                res = !this._IsTransactionOpened ? ((IChangeCategoryService)this._Channel).GetActions(this._UserProfile, changeCategory, parameters, request, out result) : this.AddMethod((Method) new ChangeCategoryMethod(changeCategory, ChangeCategoryMethods.GetActions, parameters));
            }
            catch (Exception ex)
            {
                res = this.OnThrowException(ex);
            }
            if (res.IsSuccess)
            {
                this.OnAfterCall(nameof(GetActions), res, (DCObject)changeCategory, (Parameters)parameters, (Request)request, (Result)result);
            }
            return(res);
        }
Exemplo n.º 31
0
 public SummaryCategoryNode(string headingText, ChangeCategory category)
 {
     this.HeadingText = headingText;
     this.m_category = category;
 }
Exemplo n.º 32
0
 public void ChangeCategory(ChangeCategory command)
 {
     RaiseEvent(SimpleMapper.Map(command, new SchemaCategoryChanged()));
 }
Exemplo n.º 33
0
 public static void CanChangeCategory(Schema schema, ChangeCategory command)
 {
     Guard.NotNull(command, nameof(command));
 }
Exemplo n.º 34
0
 public static SummaryNode Create(string headingText, ChangeCategory category)
 {
     return new SummaryCategoryNode(headingText, category);
 }
Exemplo n.º 35
0
 internal MethodChangedChange(ChangeCategory category, CompatibilityLevel compatibility, MethodDefinition method, IEnumerable<MethodDefinition> overloads)
     : base(ChangeType.MethodChanged, category, compatibility, method)
 {
     _overloads = overloads;
 }
Exemplo n.º 36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChangeType"/> class using the specified
 /// change <paramref name="category"/> and <paramref name="compatibility"/> level.
 /// </summary>
 /// <param name="changeType">
 /// The <see cref="ChangeType"/> indicating the type of the change.
 /// </param>
 /// <param name="category">
 /// The <see cref="ChangeCategory"/> indicating whether or not this is a breaking change.
 /// </param>
 /// <param name="compatibility">
 /// The <see cref="CompatibilityLevel"/> indicating whether this change breaks binary or 
 /// source compatibility.
 /// </param>
 protected Change(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility)
 {
     ChangeType = changeType;
     Category = category;
     Compatibility = compatibility;
 }
Exemplo n.º 37
0
 public SelectAllFilter(string headingText, ChangeCategory category, string tooltipText) 
 {
     m_tooltipText = tooltipText;
     m_category = category;
     m_headingText = headingText;
 }
Exemplo n.º 38
0
 internal TypeChange(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility, TypeDefinition type)
     : base(changeType, category, compatibility)
 {
     if (type == null) throw new ArgumentNullException("type");
     _type = type;
 }
Exemplo n.º 39
0
 internal FieldChange(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility, FieldDefinition field)
     : base(changeType, category, compatibility)
 {
     if (field == null) throw new ArgumentNullException("field");
     _field = field;
 }
Exemplo n.º 40
0
 internal MethodChange(ChangeType changeType, ChangeCategory category, CompatibilityLevel compatibility, MethodDefinition method)
     : base(changeType, category, compatibility)
 {
     if (method == null) throw new ArgumentNullException("method");
     _method = method;
 }