コード例 #1
0
        protected void lnkStopUse_Click(object sender, EventArgs e)
        {
            if (hidProductId.Value.Trim().Length > 0 && hidStatus.Value.Trim().Length > 0)
            {
                #region 日志记录

                USER_SHARE_LOGMODEL log = new USER_SHARE_LOGMODEL();
                log.LOGID           = CommonBusiness.GetSeqID("S_USER_SHARE_LOG");
                log.OPERATECONTENT  = "更改产品状态为:" + EnumPlus.GetEnumDescription(typeof(ShareEnum.ProductFlag), hidStatus.Value);
                log.OPERATECONTENT += ",产品Id:" + hidProductId.Value;
                log.OPERATEDATE     = DateTime.Now;
                log.OPERATETYPE     = int.Parse(ShareEnum.LogType.ChangeProductStatus.ToString("d"));
                log.OPERATORID      = AccountId;
                log.PROJECTID       = ProjectId;

                #endregion

                #region 保存
                if (ProductBusiness.UpdateProductStatus(hidProductId.Value, hidStatus.Value, log))
                {
                    Alert("操作成功!");
                    BindData(0);
                }
                else
                {
                    Alert("操作失败,请重试!");
                }
                #endregion
            }
        }
コード例 #2
0
            /// <summary>Turns data into a CuiTextComponent.</summary>
            /// <param name="data">The data to base the CuiTextComponent on.</param>
            /// <returns>A CuiTextComponent based on the data.</returns>
            public static CuiTextComponent ToTextComponent(Dictionary <string, object> data)
            {
                CuiTextComponent textComponent = new CuiTextComponent();

                if (data.ContainsKey(TextProperties.align))
                {
                    textComponent.Align = EnumPlus.ToEnum <TextAnchor>(data[TextProperties.align].ToString());
                }
                if (data.ContainsKey(TextProperties.color))
                {
                    textComponent.Color = data[TextProperties.color].ToString();
                }
                if (data.ContainsKey(TextProperties.font))
                {
                    textComponent.Font = data[TextProperties.font].ToString();
                }
                if (data.ContainsKey(TextProperties.fontSize))
                {
                    int fontSize = textComponent.FontSize;
                    if (!int.TryParse(data[TextProperties.fontSize].ToString(), out fontSize))
                    {
                        instance.PrintWarning("Could not succesfully parse " + data[TextProperties.fontSize].ToString() + ", a value retrieved from the configuration file, as a font size. Returned a default value of " + fontSize + " instead.");
                    }
                    textComponent.FontSize = fontSize;
                }
                if (data.ContainsKey(TextProperties.text))
                {
                    textComponent.Text = data[TextProperties.text].ToString();
                }

                return(textComponent);
            }
コード例 #3
0
        /// <summary>
        /// 删除一个车辆分组
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string DelGroup(HttpContext context)
        {
            int nGroupId = ValidatorHelper.ToInt(Enc.Decrypt(context.Request.QueryString["gid"], UrlEncKey), 0);
            //日志记录
            USER_SHARE_LOGMODEL logModel = new USER_SHARE_LOGMODEL();

            logModel.LOGID          = CommonBusiness.GetSeqID("S_USER_SHARE_LOG");
            logModel.OPERATEDATE    = DateTime.Now;
            logModel.OPERATORID     = AccountId;
            logModel.PROJECTID      = ProjectId;
            logModel.COMPANYID      = CompanyId;
            logModel.OPERATETYPE    = int.Parse(ShareEnum.LogType.ChangeProjectFunMenuStatus.ToString("d"));
            logModel.OPERATECONTENT = "设置车辆分组状态为" + EnumPlus.GetEnumDescription(typeof(ShareEnum.LogType), logModel.OPERATETYPE.ToString());
            return(CompanyGroupBusiness.SetGroupStop(nGroupId, logModel) ? "0" : "1");
        }
コード例 #4
0
    public string GetXML()
    {
        string response = string.Empty;

        string errorDesc = EnumPlus.GetEnumDescription(typeof(ShareEnum.ApiResultStatus), this.ErrorType.ToString("d"));

        if (!string.IsNullOrEmpty(ErrorDesc))
        {
            errorDesc = ErrorDesc;
        }
        response += string.Format("<result><code>{0}</code><desc><![CDATA[{1}]]></desc>{2}</result>"
                                  , Convert.ToInt16(this.ErrorType)
                                  , errorDesc, this.Result);
        response = string.Format(root, response);
        return(response);
    }
コード例 #5
0
        /// <summary>Reinitializes the static Ui.</summary>
        /// <param name="key">The key of the icon (equal to the panel it belongs to).</param>
        /// <param name="value">The value of the icon.</param>
        private void IconLoaded(string key, string value)
        {
            PanelTypes type = EnumPlus.ToEnum <PanelTypes>(key);

            for (int i = 0; i < BasePlayer.activePlayerList.Count; i++)
            {
                CuiHelper.DestroyUi(BasePlayer.activePlayerList[i], UniqueElementName(ContainerTypes.Static, ContainerParent, type.ToString()));
            }

            staticContainers[(int)type] = GetStaticContainer(type);

            for (int j = 0; j < BasePlayer.activePlayerList.Count; j++)
            {
                if (!BasePlayer.activePlayerList[j].IsDead())
                {
                    CuiHelper.AddUi(BasePlayer.activePlayerList[j], staticContainers[(int)type]);
                    UpdateField(BasePlayer.activePlayerList[j], type);
                }
            }
        }
コード例 #6
0
        private void ctxViewRule_Click(object sender, EventArgs e)
        {
            DataMapType theType = EnumPlus.ConvertString(typeof(DataMapType), mppedObjectsTree.SelectedNode.Tag.GetType().Name);
            var         store   = Result.ReferenceInfo.StoreReferences.Where(x => x.MapType == theType);

            if (store != null)
            {
                IDataRule storeRule = null;
                switch (theType)
                {
                case DataMapType.FieldColumnMap:
                case DataMapType.PropertyColumnMap:
                    RuleStore rStore = (RuleStore)store.First();
                    storeRule = rStore.Rules.Where(x => x.FieldName.Equals(mppedObjectsTree.SelectedNode.Text.Trim())).FirstOrDefault();
                    break;

                case DataMapType.MethodParameterMap:
                    RuleStore rpStore = (RuleStore)store.Where(x => x.DataStoreName.Equals(mppedObjectsTree.SelectedNode.Text.Trim()) && x.ParamterCount.Equals(lstMapDetails.Items.Count)).First();
                    storeRule = rpStore.Rules.Where(x => x.FieldName.Equals(lstMapDetails.SelectedItems[0].SubItems[0].Text.Trim())).First();
                    break;
                }
                DisplayRule(storeRule, false);
            }
        }
コード例 #7
0
    public static void Main()
    {
        EnumPlus o = new EnumPlus();

        Console.WriteLine(o + Constant.FIRST);
    }