Exemplo n.º 1
0
 public GroupInfo3(int groupId, string img)
     : base(groupId)
 {
     TkDebug.AssertArgumentNullOrEmpty(img, "img", null);
     Img = img;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the SubFuncOperateRight class.
        /// </summary>
        /// <param name="functionKey"></param>
        public SubFuncOperateRight(string functionKey)
        {
            TkDebug.AssertArgumentNullOrEmpty(functionKey, "functionKey", null);

            FunctionKey = functionKey;
        }
Exemplo n.º 3
0
        public bool IsKey(string nickName)
        {
            TkDebug.AssertArgumentNullOrEmpty(nickName, "nickName", this);

            return(fKeyFieldInfos.Contains(nickName));
        }
        private static IPageTemplate CreatePageTemplate(string regName)
        {
            TkDebug.AssertArgumentNullOrEmpty(regName, "regName", null);

            return(PlugInFactoryManager.CreateInstance <IPageTemplate>(PageTemplatePlugInFactory.REG_NAME, regName));
        }
Exemplo n.º 5
0
        public bool ContainsKey(string regName)
        {
            TkDebug.AssertArgumentNullOrEmpty(regName, "regName", this);

            return(fData.ContainsKey(regName));
        }
Exemplo n.º 6
0
        public string GetDisplayName(string nickName)
        {
            TkDebug.AssertArgumentNullOrEmpty(nickName, "nickName", this);

            return(GetFieldInfo(nickName).DisplayName);
        }
Exemplo n.º 7
0
        string ISqlProvider.EscapeName(string name)
        {
            TkDebug.AssertArgumentNullOrEmpty(name, "name", this);

            return(string.Format(ObjectUtil.SysCulture, "`{0}`", name));
        }
Exemplo n.º 8
0
        public WebExceptionResult(string errorPath)
        {
            TkDebug.AssertArgumentNullOrEmpty(errorPath, "errorPath", null);

            Result = ActionResultData.CreateFailResult(errorPath);
        }
Exemplo n.º 9
0
        //数据有效性以及下拉框的设置
        private static HSSFDataValidation CreateDataValidation(int index, Tk5FieldInfoEx fieldInfo,
                                                               ICellStyle styleContent, HSSFWorkbook workbook)
        {
            IDataFormat          format         = workbook.CreateDataFormat();
            CellRangeAddressList region         = new CellRangeAddressList(1, 65535, index, index);
            DVConstraint         constraint     = null;
            HSSFDataValidation   dataValidation = null;

            if (fieldInfo.Decoder != null && fieldInfo.Decoder.Type == DecoderType.CodeTable)
            {
                IEnumerable <IDecoderItem> data = GetDecoderItem(fieldInfo);
                if (data != null)
                {
                    List <string> optionList = new List <string>();
                    foreach (IDecoderItem item in data)
                    {
                        if (item != null)
                        {
                            TkDebug.AssertArgumentNullOrEmpty(item.Name, "item.Name", null);
                            optionList.Add(item.Name);
                        }
                    }
                    constraint     = DVConstraint.CreateExplicitListConstraint(optionList.ToArray());
                    dataValidation = DisplayMsg(region, constraint, "请从下拉框选项中选择");
                }
            }
            else
            {
                if (fieldInfo.InternalControl != null && fieldInfo.InternalControl.SrcControl == ControlType.CheckBox)
                {
                    constraint     = DVConstraint.CreateExplicitListConstraint(new string[] { "√" });
                    dataValidation = DisplayMsg(region, constraint, "请在下拉框选项中进行选择");
                }
                else
                {
                    switch (fieldInfo.DataType)
                    {
                    case TkDataType.DateTime:
                    case TkDataType.Date:
                        if (fieldInfo.DataType == TkDataType.DateTime)
                        {
                            styleContent.DataFormat = format.GetFormat("yyyy-MM-dd HH:mm");
                        }
                        else
                        {
                            styleContent.DataFormat = format.GetFormat("yyyy-MM-dd");
                        }
                        constraint     = DVConstraint.CreateDateConstraint(6, "1900-01-01", null, "yyyy-MM-dd");
                        dataValidation = DisplayMsg(region, constraint, "请输入一个日期类型的值");
                        break;

                    case TkDataType.Double:
                    case TkDataType.Decimal:
                    case TkDataType.Money:
                        constraint              = DVConstraint.CreateNumericConstraint(2, 1, "1", "0");
                        dataValidation          = DisplayMsg(region, constraint, "请输入数值类型的值");
                        styleContent.DataFormat = format.GetFormat("0");
                        break;

                    case TkDataType.Long:
                    case TkDataType.Int:
                    case TkDataType.Short:
                    case TkDataType.Byte:
                    case TkDataType.Bit:
                        constraint              = DVConstraint.CreateNumericConstraint(1, 1, "1", "0");
                        dataValidation          = DisplayMsg(region, constraint, "请输入一个整数");
                        styleContent.DataFormat = format.GetFormat("0");
                        break;

                    default:
                        styleContent.DataFormat = format.GetFormat("@");
                        break;
                    }
                }
            }
            return(dataValidation);
        }
Exemplo n.º 10
0
        void IListSqlContext.JoinSql(string format)
        {
            TkDebug.AssertArgumentNullOrEmpty(format, "format", this);

            fListSql = string.Format(ObjectUtil.SysCulture, format, fListSql);
        }
Exemplo n.º 11
0
        public static string GetTemplateFile(string fileName)
        {
            TkDebug.AssertArgumentNullOrEmpty(fileName, nameof(fileName), null);

            return($"^{Path.Combine(TemplateName, fileName)}");
        }
Exemplo n.º 12
0
        public void SetUser(string userId)
        {
            TkDebug.AssertArgumentNullOrEmpty(userId, "userId", this);

            ToUser = userId;
        }
Exemplo n.º 13
0
        internal WeixinSettings(WeixinXml xml)
        {
            AppId         = xml.Weixin.AppId;
            LogRawMessage = xml.Weixin.LogRawMessage;
            WeixinPath    = Path.GetDirectoryName(xml.FullPath);
            UseLogOnRight = xml.Weixin.UseLogOnRight;

            WeixinNormalConfig normalConfig = xml.Weixin.Normal;

            if (normalConfig != null)
            {
                Mode              = WeixinMode.Normal;
                OpenId            = normalConfig.OpenId;
                fAppSecret        = normalConfig.Secret;
                fToken            = normalConfig.Token;
                MessageMode       = normalConfig.MessageMode;
                EncodingAESKey    = normalConfig.EncodingAESKey;
                fTemplateMessages = normalConfig.TemplateMessages;
                PaymentConfigItem pay = normalConfig.Pay;
                if (pay != null)
                {
                    fUsePay       = true;
                    fMchId        = pay.MchId;
                    fPayKey       = pay.Key;
                    fDeviceInfo   = pay.DeviceInfo;
                    fDeviceIp     = pay.DeviceIp;
                    fPayNotifyUrl = UriUtil.CombineUri(pay.NotifyBaseUrl, pay.NotifyUrl).ToString();
                }
                WeixinServiceConfigItem service = normalConfig.Service;
                if (service != null)
                {
                    fEnableService = service.Enabled;
                    fWeixinAccount = service.WeixinAccount;
                }
                else
                {
                    fEnableService = false;
                }

                if (MessageMode != MessageMode.Normal)
                {
                    TkDebug.AssertArgumentNullOrEmpty(EncodingAESKey,
                                                      "当消息是混合或者安全模式时,请配置EncodingAESKey的内容", xml);
                }
            }
            else if (xml.Weixin.CorpApps != null)
            {
                Mode      = WeixinMode.Corporation;
                fCorpApps = xml.Weixin.CorpApps;
                TkDebug.Assert(fCorpApps.Count > 0,
                               "至少需要配置一个tk:CorpApp节点", xml);
                CorpSecretConfig corpSecret = xml.Weixin.CorpSecret;
                TkDebug.AssertNotNull(corpSecret, "需要配置tk:CorpSecret节点", xml);
                fCorpUserManagerSecret = corpSecret.UserManager;
                fCorpMenuSecret        = corpSecret.Menu;
                if (string.IsNullOrEmpty(fCorpMenuSecret))
                {
                    fCorpMenuSecret = fCorpUserManagerSecret;
                }
                OpenId = AppId;
            }
            else
            {
                TkDebug.ThrowImpossibleCode(xml);
            }
            fCurrent = this;
        }
Exemplo n.º 14
0
        string IDbProvider.GetParamName(string fieldName, bool isOrigin)
        {
            TkDebug.AssertArgumentNullOrEmpty(fieldName, "fieldName", this);

            return(GetParamName(fieldName, isOrigin));
        }
Exemplo n.º 15
0
        public bool IsSectionDefined(string name)
        {
            TkDebug.AssertArgumentNullOrEmpty(name, nameof(name), this);

            return(SectionWriters.ContainsKey(name));
        }
Exemplo n.º 16
0
        public void Add(string id, int count)
        {
            TkDebug.AssertArgumentNullOrEmpty(id, "id", this);

            TabList.Add(new TabItemCount(id, count));
        }
Exemplo n.º 17
0
        /// <summary>
        /// 根据SQL条件语句填充数据
        /// </summary>
        /// <param name="whereClause">SQL的条件子句</param>
        public void Select(string whereClause)
        {
            TkDebug.AssertArgumentNullOrEmpty(whereClause, "whereClause", this);

            Select(ParamBuilder.CreateSql(whereClause));
        }
Exemplo n.º 18
0
        public WeMediaId(string mediaId)
        {
            TkDebug.AssertArgumentNullOrEmpty(mediaId, "mediaId", null);

            MediaId = mediaId;
        }
Exemplo n.º 19
0
        public void Add(string fieldName, TkDataType dataType, object fieldValue)
        {
            TkDebug.AssertArgumentNullOrEmpty(fieldName, "fieldName", this);

            List.Add(new DbParameter(fieldName, dataType, fieldValue));
        }