Beispiel #1
0
        //
        // GET: /Fields/
        public ActionResult MultiSelectTemplate(ClaimFieldTemplate claimField, FieldMode FieldMode)
        {
            ViewBag.FieldMode = FieldMode;
            var claimFieldTemplateController      = new Claims.Controllers.ClaimFieldTemplateController();
            ClaimFieldTemplate claimFieldTemplate = claimFieldTemplateController.GetClaimFieldTemplate((int)claimField.ClaimFieldTemplateID);

            if (claimFieldTemplate.MultiChoiceDefaultValue != null)
            {
                string[] multiChoiceDefaultValues = claimFieldTemplate.MultiChoiceDefaultValue.Split('\n');

                List <SelectListItem> list = new List <SelectListItem>();

                foreach (string choice in multiChoiceDefaultValues)
                {
                    SelectListItem selectListItem = new SelectListItem()
                    {
                        Text = choice, Value = choice
                    };

                    list.Add(selectListItem);
                }

                ViewBag.MultiChoiceList = list;
                ViewBag.claimField      = claimField;
            }
            return(View());
        }
        public DeviceMode(Device device, int modeIndex, int width, int height, float frameRate, long frameDuration, FieldMode fieldMode, string modeDesc, string pixelFormatDesc)
        {
            _device          = device;
            _modeIndex       = modeIndex;
            _width           = width;
            _height          = height;
            _frameRate       = frameRate;
            _fieldMode       = fieldMode;
            _frameDuration   = frameDuration;
            _modeDesc        = modeDesc;
            _pixelFormatDesc = pixelFormatDesc;
            _pixelFormat     = DeckLinkPlugin.GetPixelFormat(_pixelFormatDesc);
            _pitch           = GetPitch(_width, _pixelFormat);

            _fieldModeString = "p";
            switch (_fieldMode)
            {
            case FieldMode.Interlaced_UpperFirst:
            case FieldMode.Interlaced_LowerFirst:
                _fieldModeString = "i";
                break;

            case FieldMode.Progressive_Segmented:
                _fieldModeString = "PsF";
                break;
            }
        }
Beispiel #3
0
 public static R WithEnumField <R, T>(this R register, string range, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <T, T> readCallback = null,
                                      Action <T, T> writeCallback = null, Action <T, T> changeCallback = null, Func <T, T> valueProviderCallback = null, string name = null, Type enumType = null) where R : PeripheralRegister
     where T : struct, IConvertible
 {
     register.DefineEnumField <T>(range, mode, readCallback, writeCallback, changeCallback, valueProviderCallback, name, enumType);
     return(register);
 }
Beispiel #4
0
        public IValueRegisterField DefineValueField(string range, FieldMode mode      = FieldMode.Read | FieldMode.Write, Action <uint, uint> readCallback = null,
                                                    Action <uint, uint> writeCallback = null, Action <uint, uint> changeCallback = null, Func <uint, uint> valueProviderCallback = null, string name = null)
        {
            Tuple <int, int> positionAndWidth = GetPositionAndWidth(range, name);

            return(DefineValueField(positionAndWidth.Item1, positionAndWidth.Item2, mode, readCallback, writeCallback, changeCallback, valueProviderCallback, name));
        }
Beispiel #5
0
        public Dictionary<int, XType> GetBySchema(int schemaId, FieldMode fieldMode = FieldMode.all)
        {
            if (schemaId < 0)
                throw new ArgumentOutOfRangeException("schemaId", "Can not be negative.");

            var data = new { schema_id = schemaId, fields_mode = fieldMode };
            return ExecuteTemplate<Dictionary<int, XType>>(EndPoint.type_schema, XHttpMethod.GET, data);
        }
        public Dictionary<string, XFieldInfo> GetAll(int typeId, FieldMode fieldMode = FieldMode.all)
        {
            if (typeId <= 0)
                throw new ArgumentOutOfRangeException("typeId", "Value must be greater than zero.");

            var data = new { object_type_id = typeId, fields_mode = fieldMode };
            return ExecuteTemplate<Dictionary<string, XFieldInfo>>(EndPoint.type_fields, XHttpMethod.GET, data);
        }
Beispiel #7
0
        public IEnumRegisterField <TEnum> DefineEnumField <TEnum>(string range, FieldMode mode        = FieldMode.Read | FieldMode.Write, Action <TEnum, TEnum> readCallback = null,
                                                                  Action <TEnum, TEnum> writeCallback = null, Action <TEnum, TEnum> changeCallback = null, Func <TEnum, TEnum> valueProviderCallback = null, string name = null, Type enumType = null)
            where TEnum : struct, IConvertible
        {
            Tuple <int, int> positionAndWidth = GetPositionAndWidth(range, name);

            return(DefineEnumField(positionAndWidth.Item1, positionAndWidth.Item2, mode, readCallback, writeCallback, changeCallback, valueProviderCallback, name, enumType));
        }
Beispiel #8
0
 public FieldSearchSort(string field, FieldType type = FieldType.Auto, FieldMode mode    = FieldMode.Default,
                        FieldMissing missing         = FieldMissing.Last, bool decending = false)
 {
     _field    = field;
     _type     = type;
     _mode     = mode;
     _missing  = missing;
     Decending = decending;
 }
        public ProcessJobFieldDefinition(Type type, string name, FieldMode mode)
        {
            if (type == null) throw Ex.ArgNull(() => type);
            if (string.IsNullOrEmpty(name)) throw Ex.ArgNull(() => name);

            _type = type;
            _name = name;
            _mode = mode;
        }
Beispiel #10
0
        /// <summary>
        /// Defines the flag field. Its width is always 1 and is interpreted as boolean value.
        /// </summary>
        /// <param name="position">Offset in the register.</param>
        /// <param name="mode">Access modifiers of this field.</param>
        /// <param name="readCallback">Method to be called whenever the containing register is read. The first parameter is the value of this field before read,
        /// the second parameter is the value after read. Note that it will also be called for unreadable fields.</param>
        /// <param name="writeCallback">Method to be called whenever the containing register is written to. The first parameter is the value of this field before write,
        /// the second parameter is the value written (without any modification). Note that it will also be called for unwrittable fields.</param>
        /// <param name="changeCallback">Method to be called whenever this field's value is changed, either due to read or write. The first parameter is the value of this field before change,
        /// the second parameter is the value after change. Note that it will also be called for unwrittable fields.</param>
        /// <param name="valueProviderCallback">Method to be called whenever this field is read. The value passed is the current field's value, that will be overwritten by
        /// the value returned from it. This returned value is eventually passed as the first parameter of <paramref name="readCallback"/>.</param>
        /// <param name="name">Ignored parameter, for convenience. Treat it as a comment.</param>
        public IFlagRegisterField DefineFlagField(int position, FieldMode mode      = FieldMode.Read | FieldMode.Write, Action <bool, bool> readCallback = null,
                                                  Action <bool, bool> writeCallback = null, Action <bool, bool> changeCallback = null, Func <bool, bool> valueProviderCallback = null, string name = null)
        {
            ThrowIfRangeIllegal(position, 1, name);
            var field = new FlagRegisterField(this, position, mode, readCallback, writeCallback, changeCallback, valueProviderCallback);

            registerFields.Add(field);
            RecalculateFieldMask();
            return(field);
        }
Beispiel #11
0
        /// <summary>
        /// Defines the value field. Its value is interpreted as a regular number.
        /// </summary>
        /// <param name="position">Offset in the register.</param>
        /// <param name="width">Maximum width of the value, in terms of binary representation.</param>
        /// <param name="mode">Access modifiers of this field.</param>
        /// <param name="readCallback">Method to be called whenever the containing register is read. The first parameter is the value of this field before read,
        /// the second parameter is the value after read. Note that it will also be called for unreadable fields.</param>
        /// <param name="writeCallback">Method to be called whenever the containing register is written to. The first parameter is the value of this field before write,
        /// the second parameter is the value written (without any modification). Note that it will also be called for unwrittable fields.</param>
        /// <param name="changeCallback">Method to be called whenever this field's value is changed, either due to read or write. The first parameter is the value of this field before change,
        /// the second parameter is the value after change. Note that it will also be called for unwrittable fields.</param>
        /// <param name="valueProviderCallback">Method to be called whenever this field is read. The value passed is the current field's value, that will be overwritten by
        /// the value returned from it. This returned value is eventually passed as the first parameter of <paramref name="readCallback"/>.</param>
        /// <param name="name">Ignored parameter, for convenience. Treat it as a comment.</param>
        public IValueRegisterField DefineValueField(int position, int width, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <uint, uint> readCallback = null,
                                                    Action <uint, uint> writeCallback       = null, Action <uint, uint> changeCallback = null, Func <uint, uint> valueProviderCallback = null, string name = null)
        {
            ThrowIfRangeIllegal(position, width, name);
            var field = new ValueRegisterField(this, position, width, mode, readCallback, writeCallback, changeCallback, valueProviderCallback);

            registerFields.Add(field);
            RecalculateFieldMask();
            return(field);
        }
Beispiel #12
0
        /// <summary>
        /// Defines the enum field. Its value is interpreted as an enumeration
        /// </summary>
        /// <param name="position">Offset in the register.</param>
        /// <param name="width">Maximum width of the value, in terms of binary representation.</param>
        /// <param name="mode">Access modifiers of this field.</param>
        /// <param name="readCallback">Method to be called whenever the containing register is read. The first parameter is the value of this field before read,
        /// the second parameter is the value after read. Note that it will also be called for unreadable fields.</param>
        /// <param name="writeCallback">Method to be called whenever the containing register is written to. The first parameter is the value of this field before write,
        ///  the second parameter is the value written (without any modification). Note that it will also be called for unwrittable fields.</param>
        /// <param name="changeCallback">Method to be called whenever this field's value is changed, either due to read or write. The first parameter is the value of this field before change,
        /// the second parameter is the value after change. Note that it will also be called for unwrittable fields.</param>
        /// <param name="valueProviderCallback">Method to be called whenever this field is read. The value passed is the current field's value, that will be overwritten by
        /// the value returned from it. This returned value is eventually passed as the first parameter of <paramref name="readCallback"/>.</param>
        /// <param name="name">Ignored parameter, for convenience. Treat it as a comment.</param>
        public IEnumRegisterField <T> DefineEnumField <T>(int position, int width, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <T, T> readCallback = null,
                                                          Action <T, T> writeCallback             = null, Action <T, T> changeCallback = null, Func <T, T> valueProviderCallback = null, string name = null)
            where T : struct, IConvertible
        {
            ThrowIfRangeIllegal(position, width, name);
            var field = new EnumRegisterField <T>(this, position, width, mode, readCallback, writeCallback, changeCallback, valueProviderCallback);

            registerFields.Add(field);
            RecalculateFieldMask();
            return(field);
        }
Beispiel #13
0
 public static bool IsValid(this FieldMode mode)
 {
     if ((mode & (FieldMode.Read | FieldMode.ReadToClear)) == (FieldMode.Read | FieldMode.ReadToClear))
     {
         return(false);
     }
     //the assumption that write flags are exclusive is used in BusRegister logic (switch instead of ifs)
     if (BitHelper.GetSetBits((uint)(mode & (FieldMode.Write | FieldMode.Set | FieldMode.Toggle | FieldMode.WriteOneToClear | FieldMode.WriteZeroToClear))).Length > 1)
     {
         return(false);
     }
     return(true);
 }
        /// <summary>
        /// Creates a field with the specified details, and adds it to the schema being built.
        /// </summary>
        /// <param name="name">The name of the field. Must be a valid field name.</param>
        /// <param name="type">The type of the field. Must be a defined member within <see cref="BigqueryDbType"/>, other than <c>Record</c>.</param>
        /// <param name="mode">The mode of the field. Must be a defined member within <see cref="FieldMode"/>.</param>
        /// <param name="description">The description of the field. May be null.</param>
        public void Add(string name, BigqueryDbType type, FieldMode mode = FieldMode.Nullable, string description = null)
        {
            ValidateFieldName(name, nameof(name));
            GaxRestPreconditions.CheckArgument(type != BigqueryDbType.Record, nameof(type), "Record fields must be specified with their schema");

            Add(new TableFieldSchema
            {
                Name        = name,
                Type        = EnumMap <BigqueryDbType> .ToApiValue(type, nameof(type)),
                Mode        = EnumMap <FieldMode> .ToApiValue(mode, nameof(mode)),
                Description = description,
            });
        }
        /// <summary>
        /// Creates a nested field with the specified schema, and adds it to the schema being built.
        /// </summary>
        /// <param name="name">The name of the field. Must be a valid field name.</param>
        /// <param name="nestedSchema">The schema for the nested field. Must not be null.</param>
        /// <param name="mode">The mode of the field. Must be a defined member within <see cref="FieldMode"/>.</param>
        /// <param name="description">The description of the field. May be null.</param>
        public void Add(string name, TableSchema nestedSchema, FieldMode mode = FieldMode.Nullable, string description = null)
        {
            ValidateFieldName(name, nameof(name));
            GaxRestPreconditions.CheckNotNull(nestedSchema, nameof(nestedSchema));

            Add(new TableFieldSchema
            {
                Name        = name,
                Fields      = nestedSchema.Fields,
                Type        = EnumMap <BigqueryDbType> .ToApiValue(BigqueryDbType.Record),
                Mode        = EnumMap <FieldMode> .ToApiValue(mode, nameof(mode)),
                Description = description,
            });
        }
Beispiel #16
0
        private static DoubleWordRegister[] CreateRegistersGroup(int size, IPeripheral parent, int position, int width,
                                                                 FieldMode mode = FieldMode.Read | FieldMode.Write, Action <int, uint> writeCallback = null, Func <int, uint> valueProviderCallback = null, string name = null)
        {
            var result = new DoubleWordRegister[size];

            for (var i = 0; i < size; i++)
            {
                var j = i;
                result[i] = new DoubleWordRegister(parent)
                            .WithValueField(position, width, mode, name: name + j,
                                            valueProviderCallback: valueProviderCallback == null ? (Func <uint, uint>)null : _ => valueProviderCallback(j),
                                            writeCallback: writeCallback == null ? (Action <uint, uint>)null : (_, @new) => { writeCallback(j, @new); });
            }
            return(result);
        }
        /// <summary>
        /// Fluent API for creation of a set of consecutive flag fields.
        /// </summary>
        /// <param name="position">Offset in the register of the first field.</param>
        /// <param name="count">Number of flag fields to create.</param>
        /// <param name="mode">Access modifiers of each field.</param>
        /// <param name="readCallback">Method to be called whenever the containing register is read. The first parameter is the index of the flag field, the second is the value of this field before read,
        /// the third parameter is the value after read. Note that it will also be called for unreadable fields.</param>
        /// <param name="writeCallback">Method to be called whenever the containing register is written to. The first parameter is the index of the flag, the second is the value of this field before write,
        /// the third parameter is the value written (without any modification). Note that it will also be called for unwrittable fields.</param>
        /// <param name="changeCallback">Method to be called whenever this field's value is changed, either due to read or write. The first parameter is the index of the flag, the second is the value of this field before change,
        /// the third parameter is the value after change. Note that it will also be called for unwrittable fields.</param>
        /// <param name="valueProviderCallback">Method to be called whenever this field is read. The value passed is the current field's value, that will be overwritten by
        /// the value returned from it. This returned value is eventually passed as the second parameter of <paramref name="readCallback"/>.</param>
        /// <param name="name">Ignored parameter, for convenience. Treat it as a comment.</param>
        /// <returns>This register with defined flags.</returns>
        public static T WithFlags <T>(this T register, int position, int count, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <int, bool, bool> readCallback = null,
                                      Action <int, bool, bool> writeCallback = null, Action <int, bool, bool> changeCallback = null, Func <int, bool, bool> valueProviderCallback = null, string name = null) where T : PeripheralRegister
        {
            for (var i = 0; i < count; i++)
            {
                var j = i;

                register.DefineFlagField(position + j, mode,
                                         readCallback == null ? null : (Action <bool, bool>)((x, y) => readCallback(j, x, y)),
                                         writeCallback == null ? null : (Action <bool, bool>)((x, y) => writeCallback(j, x, y)),
                                         changeCallback == null ? null : (Action <bool, bool>)((x, y) => changeCallback(j, x, y)),
                                         valueProviderCallback == null ? null : (Func <bool, bool>)((x) => valueProviderCallback(j, x)),
                                         name == null ? null : $"{name}_{j}");
            }
            return(register);
        }
 public void changedFieldMode(FieldMode mode)
 {
     //throw new NotImplementedException();
 }
Beispiel #19
0
    /// <summary>
    /// 顯示時欄位初始值
    /// </summary>
    /// <param name="versionField">欄位集合</param>
    public override void SetField(Ede.Uof.WKF.Design.VersionField versionField)
    {
        FieldOptional fieldOptional = versionField as FieldOptional;

        if (fieldOptional != null)
        {
            #region ==============屬性說明==============『』
            //fieldOptional.IsRequiredField『是否為必填欄位,如果是必填(True),如果不是必填(False)』
            //fieldOptional.DisplayOnly『是否為純顯示,如果是(True),如果不是(False),一般在觀看表單及列印表單時,屬性為True』
            //fieldOptional.HasAuthority『是否有填寫權限,如果有填寫權限(True),如果沒有填寫權限(False)』
            //fieldOptional.FieldValue『如果已有人填寫過欄位,則此屬性為記錄其內容』
            //fieldOptional.FieldDefault『如果欄位有預設值,則此屬性為記錄其內容』
            //fieldOptional.FieldModify『是否允許修改,如果允許(fieldOptional.FieldModify=FieldModifyType.yes),如果不允許(fieldOptional.FieldModify=FieldModifyType.no)』
            //fieldOptional.Modifier『如果欄位有被修改過,則Modifier的內容為EBUser,如果沒有被修改過,則會等於Null』
            #endregion

            //#region ==============如果沒有填寫權限時,就要顯示有填寫權限人員的清單,只要把以下註解拿掉即可==============
            //if (!fieldOptional.HasAuthority『是否有填寫權限)
            //{
            //    string strItemName = String.Empty;
            //    Ede.Uof.EIP.Organization.Util.UserSet userSet = ((FieldOptional)versionField).FieldControlData;

            //    for (int i = 0; i < userSet.Items.Count; i++)
            //    {
            //        if (i == userSet.Items.Count - 1)
            //        {
            //            strItemName += userSet.Items[i].Name;
            //        }
            //        else
            //        {
            //            strItemName += userSet.Items[i].Name + "、";
            //        }
            //    }

            //    lblHasNoAuthority.ToolTip = lblAuthorityMsg.Text + ":" + strItemName;
            //}
            //#endregion

            #region ==============如果有修改,要顯示修改者資訊==============
            if (fieldOptional.Modifier != null)
            {
                lblModifier.Visible   = true;
                lblModifier.ForeColor = System.Drawing.Color.Red;
                lblModifier.Text      = String.Format("( {0}:{1} )", this.lblMsgSigner.Text, fieldOptional.Modifier.Name);
            }
            #endregion

            this.FormFieldMode = fieldOptional.FieldMode; // 記住本次 FieldMode

            // 初始化kytcontroller
            kytController = new KYTController(UpdatePanel1);

            // 取得資料庫連通字串
            ConnectionString = new DatabaseHelper().Command.Connection.ConnectionString;
            service          = ConstructorCommonSettings.setSCSSServiceProxDefault();


            if (!Page.IsPostBack) // 網頁首次載入
            {
                if (!string.IsNullOrEmpty(fieldOptional.FieldValue))
                {
                    kytController.FieldValue = fieldOptional.FieldValue;
                }

                kytController.SetAllViewType(KYTViewType.ReadOnly);  // 設定所有KYT物件唯讀
                ConstructorCommonSettings.setCommonSettings();       // 設定DebugLog初始值

                switch (fieldOptional.FieldMode)                     // 判斷FieldMode
                {
                case FieldMode.Applicant:                            // 起單或退回申請者
                case FieldMode.ReturnApplicant:
                    kytController.SetAllViewType(KYTViewType.Input); // 設定所有KYT物件可輸入
                    ktxtMessage.ViewType       = KYTViewType.ReadOnly;
                    ktxtAPPLICANTDATE.ReadOnly = true;               // 申請日期唯讀
                    ktxtAPPLICANTDEPT.ReadOnly = true;               // 部門唯讀
                    ktxtEMPLOYEE.ReadOnly      = true;               // 異動人員唯讀

                    if (this.FormFieldMode == FieldMode.Applicant)
                    {
                        //EBUser user = new UserUCO().GetEBUser(this.ApplicantGuid);
                        KYT_EBUser KUser = new KYT_UserPO().GetUserDetailByUserGuid(this.ApplicantGuid);     // 人員
                        ktxtAPPLICANTDATE.Text     = DateTime.Now.ToString("yyyy/MM/dd");                    // 設定申請日期
                        ktxtEMPLOYEE.Text          = string.Format(@"{0} ({1})", KUser.Name, KUser.Account); // 設定異動人員名稱
                        hidEMPLOYEEGuid.Value      = KUser.UserGUID;                                         // 設定異動人員代號
                        ktxtAPPLICANTDEPT.Text     = KUser.GroupName[0];                                     // 設定異動人員部門名稱
                        hidAPPLICANTDEPT.Value     = KUser.GroupID[0];                                       // 設定異動人員部門代號(UOF)
                        hidEMPLOYEETitleId.Value   = KUser.Title_ID[0];                                      // 設定異動人員職稱代號
                        hidEMPLOYEETitleName.Value = KUser.Title_Name[0];                                    // 設定異動人員職稱
                        hidEMPLOYEEAccount.Value   = KUser.Account;                                          // 設定異動人員帳號
                        string[] sAccount = hidEMPLOYEEAccount.Value.Split('\\');
                        hidEMPLOYEEAccount.Value = sAccount[sAccount.Length - 1];
                        hidGROUPCODE.Value       = KUser.GroupCode[0]; // 設定異動人員部門代號

                        #region 申報公司

                        DataTable dtCompanyIDSource = getModifyType(SCSHRConfiguration.SCSSCompanyIDProdID, "SYS_ViewID,SYS_Name");
                        // 新增請選擇選項
                        DataRow ndr = dtCompanyIDSource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtCompanyIDSource.Rows.InsertAt(ndr, 0);

                        kddlCOMPANYID.DataSource     = dtCompanyIDSource;
                        kddlCOMPANYID.DataTextField  = "SYS_NAME";
                        kddlCOMPANYID.DataValueField = "SYS_VIEWID";
                        kddlCOMPANYID.DataBind();

                        #endregion 申報公司

                        kdpSTARTDATE.Text   = ktxtAPPLICANTDATE.Text;   // 到職日期,預設為今日
                        kdpTRIALDATE.Text   = ktxtAPPLICANTDATE.Text;   // 試用/約聘期滿日,預設為今日
                        kdpSSTARTDATE.Text  = ktxtAPPLICANTDATE.Text;   // (特休)年資起始日,預設為今日
                        kdpGARRIVEDATE.Text = ktxtAPPLICANTDATE.Text;   // 到集團日,預設為今日

                        #region 職稱

                        DataTable dtTitleSource = getModifyType(SCSHRConfiguration.SCSSTitleProdID, "SYS_ViewID,SYS_Name");
                        // 新增請選擇選項
                        ndr = dtTitleSource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtTitleSource.Rows.InsertAt(ndr, 0);

                        kddlDUTYID.DataSource     = dtTitleSource;
                        kddlDUTYID.DataTextField  = "SYS_NAME";
                        kddlDUTYID.DataValueField = "SYS_VIEWID";
                        kddlDUTYID.DataBind();

                        #endregion 職稱

                        #region 參考代碼

                        DataTable dtIDYClassSource = getModifyType(SCSHRConfiguration.SCSSIDYClassIDProdID, "SYS_ViewID,SYS_Name");
                        // 新增請選擇選項
                        ndr = dtIDYClassSource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtIDYClassSource.Rows.InsertAt(ndr, 0);

                        kddlIDYCLASSID.DataSource     = dtIDYClassSource;
                        kddlIDYCLASSID.DataTextField  = "SYS_NAME";
                        kddlIDYCLASSID.DataValueField = "SYS_VIEWID";
                        kddlIDYCLASSID.DataBind();

                        #endregion 參考代碼
                        //取得利潤中心
                        kddlPROFITNAME.DataSource     = getPROFITID(SCSHRConfiguration.SCSSPROFITID, "SYS_ViewID,SYS_Name");
                        kddlPROFITNAME.DataValueField = "SYS_VIEWID";
                        kddlPROFITNAME.DataTextField  = "SYS_NAME";
                        kddlPROFITNAME.DataBind();
                    }
                    // 設定Picker是否能輸入
                    kdpSTARTDATE.TextBoxReadOnly   = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpTRIALDATE.TextBoxReadOnly   = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpSSTARTDATE.TextBoxReadOnly  = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpGARRIVEDATE.TextBoxReadOnly = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    break;

                case FieldMode.Design:     // 表單設計階段
                    break;

                case FieldMode.Print:     // 表單列印
                    break;

                case FieldMode.Signin:     // 表單簽核
                    break;

                case FieldMode.Verify:     // Verify
                    break;

                case FieldMode.View:     // 表單觀看
                    break;
                }
            }
            else // 如果網頁POSTBACK
            {
                JGlobalLibs.WebUtils.RequestHiddenFields(UpdatePanel1); // 取回HiddenField的值

                switch (fieldOptional.FieldMode) // 判斷FieldMode
                {
                case FieldMode.Applicant:        // 起單或退回申請者
                case FieldMode.ReturnApplicant:
                    // 設定Picker是否能輸入
                    kdpSTARTDATE.ViewType          = KYTViewType.Input;
                    kdpTRIALDATE.ViewType          = KYTViewType.Input;
                    kdpSSTARTDATE.ViewType         = KYTViewType.Input;
                    kdpGARRIVEDATE.ViewType        = KYTViewType.Input;
                    kdpSTARTDATE.TextBoxReadOnly   = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpTRIALDATE.TextBoxReadOnly   = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpSSTARTDATE.TextBoxReadOnly  = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpGARRIVEDATE.TextBoxReadOnly = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    break;
                }
            }
        }
    }
 public WidgetAttribute()
 {
     this._mode = FieldMode.Unknown;
 }
 public static void filedModeChange(FieldMode mode)
 {
     Debug.Log(mode);
     CurrentFieldMode = mode;
     GameControlProxy.changedFiledMode(mode);
 }
Beispiel #22
0
 public static bool IsFlagSet(this FieldMode mode, FieldMode value)
 {
     return((mode & value) != 0);
 }
Beispiel #23
0
 /// <summary>
 /// Fluent API for flag field creation. For parameters see <see cref="PeripheralRegister.DefineValueField"/>.
 /// This overload allows you to retrieve the created field via <c>flagFiled</c> parameter.
 /// </summary>
 /// <returns>This register with a defined flag.</returns>
 public static T WithFlag <T>(this T register, int position, out IFlagRegisterField flagField, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <bool, bool> readCallback = null,
                              Action <bool, bool> writeCallback = null, Action <bool, bool> changeCallback = null, Func <bool, bool> valueProviderCallback = null, string name = null) where T : PeripheralRegister
 {
     flagField = register.DefineFlagField(position, mode, readCallback, writeCallback, changeCallback, valueProviderCallback, name);
     return(register);
 }
 public EnumRegisterField(PeripheralRegister parent, int position, int width, FieldMode fieldMode, Action <TEnum, TEnum> readCallback,
                          Action <TEnum, TEnum> writeCallback, Action <TEnum, TEnum> changeCallback, Func <TEnum, TEnum> valueProviderCallback)
     : base(parent, position, width, fieldMode, readCallback, writeCallback, changeCallback, valueProviderCallback)
 {
 }
Beispiel #25
0
 public WidgetAttribute(FieldMode mode)
 {
     this._mode = mode;
 }
Beispiel #26
0
 public WidgetAttribute(FieldMode mode, string field)
 {
     this._mode = mode;
     this._field = field;
 }
Beispiel #27
0
 public static FieldMode ReadBits(this FieldMode mode)
 {
     return(mode & (FieldMode.Read | FieldMode.ReadToClear));
 }
Beispiel #28
0
 public Dictionary<int, XType> GetAll(FieldMode fieldMode = FieldMode.all)
 {
     return GetBySchema(0, fieldMode);
 }
Beispiel #29
0
 public static FieldMode WriteBits(this FieldMode mode)
 {
     return(mode & ~(FieldMode.Read | FieldMode.ReadToClear));
 }
Beispiel #30
0
 private static DoubleWordRegister[] CreateRegistersGroup(int size, IPeripheral parent, int position, int width,
     FieldMode mode = FieldMode.Read | FieldMode.Write, Action<int, uint> writeCallback = null, Func<int, uint> valueProviderCallback = null, string name = null)
 {
     var result = new DoubleWordRegister[size];
     for(var i = 0; i < size; i++)
     {
         var j = i;
         result[i] = new DoubleWordRegister(parent)
             .WithValueField(position, width, mode, name: name + j,
                 valueProviderCallback: valueProviderCallback == null ? (Func<uint, uint>)null : _ => valueProviderCallback(j),
                 writeCallback: writeCallback == null ? (Action<uint, uint>)null : (_, @new) => { writeCallback(j, @new); });
     }
     return result;
 }
Beispiel #31
0
 public static bool IsReadable(this FieldMode mode)
 {
     return((mode & (FieldMode.Read | FieldMode.ReadToClear)) != 0);
 }
Beispiel #32
0
 /// <summary>
 /// Fluent API for value field creation. For parameters see <see cref="PeripheralRegister.DefineValueField"/>.
 /// This overload allows you to retrieve the created field via <c>valueField</c> parameter.
 /// </summary>
 /// <returns>This register with a defined value field.</returns>
 public static T WithValueField <T>(this T register, int position, int width, out IValueRegisterField valueField, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <uint, uint> readCallback = null,
                                    Action <uint, uint> writeCallback = null, Action <uint, uint> changeCallback = null, Func <uint, uint> valueProviderCallback = null, string name = null) where T : PeripheralRegister
 {
     valueField = register.DefineValueField(position, width, mode, readCallback, writeCallback, changeCallback, valueProviderCallback, name);
     return(register);
 }
    /// <summary>
    /// 顯示時欄位初始值
    /// </summary>
    /// <param name="versionField">欄位集合</param>
    public override void SetField(Ede.Uof.WKF.Design.VersionField versionField)
    {
        FieldOptional fieldOptional = versionField as FieldOptional;

        if (fieldOptional != null)
        {
            #region ==============屬性說明==============『』
            //fieldOptional.IsRequiredField『是否為必填欄位,如果是必填(True),如果不是必填(False)』
            //fieldOptional.DisplayOnly『是否為純顯示,如果是(True),如果不是(False),一般在觀看表單及列印表單時,屬性為True』
            //fieldOptional.HasAuthority『是否有填寫權限,如果有填寫權限(True),如果沒有填寫權限(False)』
            //fieldOptional.FieldValue『如果已有人填寫過欄位,則此屬性為記錄其內容』
            //fieldOptional.FieldDefault『如果欄位有預設值,則此屬性為記錄其內容』
            //fieldOptional.FieldModify『是否允許修改,如果允許(fieldOptional.FieldModify=FieldModifyType.yes),如果不允許(fieldOptional.FieldModify=FieldModifyType.no)』
            //fieldOptional.Modifier『如果欄位有被修改過,則Modifier的內容為EBUser,如果沒有被修改過,則會等於Null』
            #endregion

            //#region ==============如果沒有填寫權限時,就要顯示有填寫權限人員的清單,只要把以下註解拿掉即可==============
            //if (!fieldOptional.HasAuthority『是否有填寫權限)
            //{
            //    string strItemName = String.Empty;
            //    Ede.Uof.EIP.Organization.Util.UserSet userSet = ((FieldOptional)versionField).FieldControlData;

            //    for (int i = 0; i < userSet.Items.Count; i++)
            //    {
            //        if (i == userSet.Items.Count - 1)
            //        {
            //            strItemName += userSet.Items[i].Name;
            //        }
            //        else
            //        {
            //            strItemName += userSet.Items[i].Name + "、";
            //        }
            //    }

            //    lblHasNoAuthority.ToolTip = lblAuthorityMsg.Text + ":" + strItemName;
            //}
            //#endregion

            #region ==============如果有修改,要顯示修改者資訊==============
            if (fieldOptional.Modifier != null)
            {
                lblModifier.Visible   = true;
                lblModifier.ForeColor = System.Drawing.Color.Red;
                lblModifier.Text      = String.Format("( {0}:{1} )", this.lblMsgSigner.Text, fieldOptional.Modifier.Name);
            }
            #endregion

            this.FormFieldMode = fieldOptional.FieldMode; // 記住本次 FieldMode

            // 初始化kytcontroller
            kytController = new KYTController(UpdatePanel1);

            // 取得資料庫連通字串
            ConnectionString = new DatabaseHelper().Command.Connection.ConnectionString;
            service          = ConstructorCommonSettings.setSCSSServiceProxDefault();

            if (!Page.IsPostBack) // 網頁首次載入
            {
                if (!string.IsNullOrEmpty(fieldOptional.FieldValue))
                {
                    kytController.FieldValue = fieldOptional.FieldValue;
                }

                kytController.SetAllViewType(KYTViewType.ReadOnly);  // 設定所有KYT物件唯讀
                btnCheck.Visible = false;                            // 隱藏檢查

                ConstructorCommonSettings.setCommonSettings();       // 設定DebugLog初始值

                switch (fieldOptional.FieldMode)                     // 判斷FieldMode
                {
                case FieldMode.Applicant:                            // 起單或退回申請者
                case FieldMode.ReturnApplicant:
                    hidAPIResult.Value = "";                         // 清掉先前的旗標
                    kytController.SetAllViewType(KYTViewType.Input); // 設定所有KYT物件可輸入
                    ktxtAPPLICANTDEPT.ReadOnly = true;               // 部門唯讀
                    ktxtAPPLICANTDATE.ReadOnly = true;               // 申請日期唯讀
                    ktxtAPPLICANT.ReadOnly     = true;               // 申請人唯讀
                    btnCheck.Visible           = true;               // 顯示檢查
                    if (this.FormFieldMode == FieldMode.Applicant)   // 剛起單
                    {
                        //EBUser user = new UserUCO().GetEBUser(this.ApplicantGuid);
                        KYT_EBUser KUser = new KYT_UserPO().GetUserDetailByUserGuid(this.ApplicantGuid); // 人員
                        ktxtAPPLICANTDEPT.Text           = KUser.GroupName[0];                           // 部門名稱
                        hidAPPLICANTDEPT.Value           = KUser.GroupID[0];                             // 部門代碼
                        hidAPPLICANTDEPT_GROUPCODE.Value = KUser.GroupCode[0];
                        if (string.IsNullOrEmpty(hidAPPLICANTDEPT_GROUPCODE.Value))                      // 如果UOF沒有維護GROUP_CODE,就呼叫WS取得
                        {
                            List <SCSHR.net.azurewebsites.scsservices_beta.FilterItem> lsItems = new List <SCSHR.net.azurewebsites.scsservices_beta.FilterItem>();
                            SCSHR.net.azurewebsites.scsservices_beta.FilterItem        item    = new SCSHR.net.azurewebsites.scsservices_beta.FilterItem();
                            item.FieldName   = "SYS_VIEWID";
                            item.FilterValue = KUser.Account;
                            lsItems.Add(item);
                            //filters.SetValue(item, 0);
                            Exception ex         = null;
                            DataTable dtEmployee = service.BOFind("HUM0020100", "*", lsItems.ToArray(), out ex);
                            if (dtEmployee.Rows.Count > 0)
                            {
                                if (dtEmployee.Columns.Contains("TMP_DEPARTID"))
                                {
                                    hidAPPLICANTDEPT_GROUPCODE.Value = dtEmployee.Rows[0]["TMP_DEPARTID"].ToString();
                                }
                            }
                        }
                        ktxtAPPLICANTDATE.Text    = DateTime.Now.ToString("yyyy/MM/dd");                    // 申請日期
                        ktxtAPPLICANT.Text        = string.Format(@"{0} ({1})", KUser.Name, KUser.Account); // 申請人姓名
                        hidAPPLICANT.Value        = KUser.UserGUID;                                         // 申請人代碼
                        hidAPPLICANTAccount.Value = KUser.Account;                                          // 申請人帳號
                        string[] sAccount = hidAPPLICANTAccount.Value.Split('\\');
                        hidAPPLICANTAccount.Value = sAccount[sAccount.Length - 1];
                        hidAPPLICANTGuid.Value    = KUser.UserGUID;  // 申請人Guid


                        kddlFOPUNCH_REASON.DataSource     = getFOPUNCHType(SCSHRConfiguration.SCSSPunchTypeProgID, "SYS_ViewID,SYS_Name,SYS_EngName");
                        kddlFOPUNCH_REASON.DataValueField = "SYS_VIEWID";
                        kddlFOPUNCH_REASON.DataTextField  = "SYS_NAME";
                        kddlFOPUNCH_REASON.DataBind();
                    }
                    // 設定Picker是否能輸入
                    kdtpFOPUNCH_TIME.TextBoxReadOnly     = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdtpFOPUNCH_TIME_OFF.TextBoxReadOnly = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";

                    #region 綁定上班補卡狀態

                    if (!string.IsNullOrEmpty(SCSHRConfiguration.FOPUNCH_TYPE))
                    {
                        DataTable dtSource = new DataTable();
                        dtSource.Columns.Add(new DataColumn("VALUE", typeof(string)));
                        dtSource.Columns.Add(new DataColumn("TEXT", typeof(string)));
                        DataRow ndr = dtSource.NewRow();
                        ndr["TEXT"]  = "====請選擇====";
                        ndr["VALUE"] = "";
                        dtSource.Rows.Add(ndr);
                        foreach (string _type in SCSHRConfiguration.FOPUNCH_TYPE.Split(","))
                        {
                            string typeName = "";
                            switch (_type)
                            {
                            case "2":
                                typeName = "刷卡上班";
                                break;

                            case "0":
                                typeName = "加班上班(前)";
                                break;

                            case "4":
                                typeName = "加班上班(後)";
                                break;
                            }
                            //kddlFOPUNCHTYPE.Items.Add(new ListItem(typeName, _type));
                            DataRow _ndr = dtSource.NewRow();
                            _ndr["TEXT"]  = typeName;
                            _ndr["VALUE"] = _type;
                            dtSource.Rows.Add(_ndr);
                        }
                        kddlFOPUNCHTYPE.DataSource     = dtSource;
                        kddlFOPUNCHTYPE.DataTextField  = "TEXT";
                        kddlFOPUNCHTYPE.DataValueField = "VALUE";
                        kddlFOPUNCHTYPE.DataBind();
                        kddlFOPUNCHTYPE.BindDataOnly = true;
                    }

                    #endregion 綁定上班補卡狀態

                    #region 綁定下班補卡狀態

                    if (!string.IsNullOrEmpty(SCSHRConfiguration.FOPUNCH_OFF_TYPE))
                    {
                        DataTable dtSource = new DataTable();
                        dtSource.Columns.Add(new DataColumn("VALUE", typeof(string)));
                        dtSource.Columns.Add(new DataColumn("TEXT", typeof(string)));
                        DataRow ndr = dtSource.NewRow();
                        ndr["TEXT"]  = "====請選擇====";
                        ndr["VALUE"] = "";
                        dtSource.Rows.Add(ndr);
                        foreach (string _type in SCSHRConfiguration.FOPUNCH_OFF_TYPE.Split(","))
                        {
                            string typeName = "";
                            switch (_type)
                            {
                            case "3":
                                typeName = "刷卡下班";
                                break;

                            case "1":
                                typeName = "加班下班(前)";
                                break;

                            case "5":
                                typeName = "加班下班(後)";
                                break;
                            }
                            //kddlFOPUNCHTYPE_OFF.Items.Add(new ListItem(typeName, _type));
                            DataRow _ndr = dtSource.NewRow();
                            _ndr["TEXT"]  = typeName;
                            _ndr["VALUE"] = _type;
                            dtSource.Rows.Add(_ndr);
                        }
                        kddlFOPUNCHTYPE_OFF.DataSource     = dtSource;
                        kddlFOPUNCHTYPE_OFF.DataTextField  = "TEXT";
                        kddlFOPUNCHTYPE_OFF.DataValueField = "VALUE";
                        kddlFOPUNCHTYPE_OFF.DataBind();
                        kddlFOPUNCHTYPE_OFF.BindDataOnly = true;
                    }

                    #endregion 綁定下班補卡狀態
                    break;

                case FieldMode.Design:     // 表單設計階段
                    break;

                case FieldMode.Signin:     // 表單簽核
                    if (taskObj != null &&
                        taskObj.CurrentSite != null &&
                        taskObj.CurrentSite.SiteCode == "HR")
                    {
                        kddlFOPUNCHTYPE.ViewType     = KYTViewType.Input; // 補上班卡狀態
                        kddlFOPUNCHTYPE_OFF.ViewType = KYTViewType.Input; // 補下班卡狀態
                    }
                    break;

                case FieldMode.Print:    // 表單列印
                case FieldMode.Verify:   // Verify
                case FieldMode.View:     // 表單觀看
                    //kddlFOPUNCHTYPE_SelectedIndexChanged(kddlFOPUNCHTYPE, null);
                    //kddlFOPUNCHTYPE_OFF_SelectedIndexChanged(kddlFOPUNCHTYPE_OFF, null);
                    break;
                }
                ktxtSignResult.ViewType = KYTViewType.ReadOnly;
            }
            else // 如果網頁POSTBACK
            {
                JGlobalLibs.WebUtils.RequestHiddenFields(UpdatePanel1); // 取回HiddenField的值
                switch (fieldOptional.FieldMode) // 判斷FieldMode
                {
                case FieldMode.Applicant:        // 起單或退回申請者
                case FieldMode.ReturnApplicant:
                    // 設定Picker是否能輸入
                    kdtpFOPUNCH_TIME.ViewType            = KYTViewType.Input;
                    kdtpFOPUNCH_TIME_OFF.ViewType        = KYTViewType.Input;
                    kdtpFOPUNCH_TIME.TextBoxReadOnly     = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdtpFOPUNCH_TIME_OFF.TextBoxReadOnly = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    break;
                }
            }
        }
    }
Beispiel #34
0
 /// <summary>
 /// Fluent API for enum field creation. For parameters see <see cref="PeripheralRegister.DefineValueField"/>.
 /// This overload allows you to retrieve the created field via <c>enumFiled</c> parameter.
 /// </summary>
 /// <returns>This register with a defined enum field.</returns>
 public static R WithEnumField <R, T>(this R register, int position, int width, out IEnumRegisterField <T> enumField, FieldMode mode = FieldMode.Read | FieldMode.Write, Action <T, T> readCallback = null,
                                      Action <T, T> writeCallback = null, Action <T, T> changeCallback = null, Func <T, T> valueProviderCallback = null, string name = null) where R : PeripheralRegister
     where T : struct, IConvertible
 {
     enumField = register.DefineEnumField <T>(position, width, mode, readCallback, writeCallback, changeCallback, valueProviderCallback, name);
     return(register);
 }
Beispiel #35
0
    /// <summary>
    /// 顯示時欄位初始值
    /// </summary>
    /// <param name="versionField">欄位集合</param>
    public override void SetField(Ede.Uof.WKF.Design.VersionField versionField)
    {
        FieldOptional fieldOptional = versionField as FieldOptional;

        if (fieldOptional != null)
        {
            #region ==============屬性說明==============『』
            //fieldOptional.IsRequiredField『是否為必填欄位,如果是必填(True),如果不是必填(False)』
            //fieldOptional.DisplayOnly『是否為純顯示,如果是(True),如果不是(False),一般在觀看表單及列印表單時,屬性為True』
            //fieldOptional.HasAuthority『是否有填寫權限,如果有填寫權限(True),如果沒有填寫權限(False)』
            //fieldOptional.FieldValue『如果已有人填寫過欄位,則此屬性為記錄其內容』
            //fieldOptional.FieldDefault『如果欄位有預設值,則此屬性為記錄其內容』
            //fieldOptional.FieldModify『是否允許修改,如果允許(fieldOptional.FieldModify=FieldModifyType.yes),如果不允許(fieldOptional.FieldModify=FieldModifyType.no)』
            //fieldOptional.Modifier『如果欄位有被修改過,則Modifier的內容為EBUser,如果沒有被修改過,則會等於Null』
            #endregion

            //#region ==============如果沒有填寫權限時,就要顯示有填寫權限人員的清單,只要把以下註解拿掉即可==============
            //if (!fieldOptional.HasAuthority『是否有填寫權限)
            //{
            //    string strItemName = String.Empty;
            //    Ede.Uof.EIP.Organization.Util.UserSet userSet = ((FieldOptional)versionField).FieldControlData;

            //    for (int i = 0; i < userSet.Items.Count; i++)
            //    {
            //        if (i == userSet.Items.Count - 1)
            //        {
            //            strItemName += userSet.Items[i].Name;
            //        }
            //        else
            //        {
            //            strItemName += userSet.Items[i].Name + "、";
            //        }
            //    }

            //    lblHasNoAuthority.ToolTip = lblAuthorityMsg.Text + ":" + strItemName;
            //}
            //#endregion

            #region ==============如果有修改,要顯示修改者資訊==============
            if (fieldOptional.Modifier != null)
            {
                lblModifier.Visible   = true;
                lblModifier.ForeColor = System.Drawing.Color.Red;
                lblModifier.Text      = String.Format("( {0}:{1} )", this.lblMsgSigner.Text, fieldOptional.Modifier.Name);
            }
            #endregion

            this.FormFieldMode = fieldOptional.FieldMode; // 記住本次 FieldMode

            // 初始化kytcontroller
            kytController = new KYTController(UpdatePanel1);

            // 取得資料庫連通字串
            ConnectionString = new DatabaseHelper().Command.Connection.ConnectionString;
            service          = ConstructorCommonSettings.setSCSSServiceProxDefault();


            if (!Page.IsPostBack) // 網頁首次載入
            {
                if (!string.IsNullOrEmpty(fieldOptional.FieldValue))
                {
                    kytController.FieldValue = fieldOptional.FieldValue;
                }

                kytController.SetAllViewType(KYTViewType.ReadOnly);  // 設定所有KYT物件唯讀
                ConstructorCommonSettings.setCommonSettings();       // 設定DebugLog初始值
                btnDEPARTID.Visible = false;                         // 帳部部門
                btnPROFITID.Visible = false;                         // 利潤中心

                switch (fieldOptional.FieldMode)                     // 判斷FieldMode
                {
                case FieldMode.Applicant:                            // 起單或退回申請者
                case FieldMode.ReturnApplicant:
                    kytController.SetAllViewType(KYTViewType.Input); // 設定所有KYT物件可輸入
                    ktxtMessage.ViewType       = KYTViewType.ReadOnly;
                    ktxtAPPLICANTDATE.ReadOnly = true;               // 申請日期唯讀
                    ktxtAPPLICANTDEPT.ReadOnly = true;               // 部門唯讀
                    ktxtEMPLOYEE.ReadOnly      = true;               // 異動人員唯讀
                    btnDEPARTID.Visible        = true;               // 帳部部門
                    btnPROFITID.Visible        = true;               // 利潤中心
                    if (this.FormFieldMode == FieldMode.Applicant)
                    {
                        //EBUser user = new UserUCO().GetEBUser(this.ApplicantGuid); // 取得起單人資料
                        KYT_EBUser KUser = new KYT_UserPO().GetUserDetailByUserGuid(this.ApplicantGuid);     // 人員
                        ktxtAPPLICANTDATE.Text     = DateTime.Now.ToString("yyyy/MM/dd");                    // 設定申請日期
                        ktxtEMPLOYEE.Text          = string.Format(@"{0} ({1})", KUser.Name, KUser.Account); // 設定異動人員名稱
                        hidEMPLOYEEGuid.Value      = KUser.UserGUID;                                         // 設定異動人員代號
                        ktxtAPPLICANTDEPT.Text     = KUser.GroupName[0];                                     // 設定異動人員部門名稱
                        hidAPPLICANTDEPT.Value     = KUser.GroupID[0];                                       // 設定異動人員部門代號(UOF)
                        hidEMPLOYEETitleId.Value   = KUser.Title_ID[0];                                      // 設定異動人員職稱代號
                        hidEMPLOYEETitleName.Value = KUser.Title_Name[0];                                    // 設定異動人員職稱
                        hidEMPLOYEEAccount.Value   = KUser.Account;                                          // 設定異動人員帳號
                        string[] sAccount = hidEMPLOYEEAccount.Value.Split('\\');
                        hidEMPLOYEEAccount.Value = sAccount[sAccount.Length - 1];
                        hidGROUPCODE.Value       = KUser.GroupCode[0]; // 設定異動人員部門代號

                        #region 職務異動原因

                        DataTable dtEMPCHANGESource = getEMPCHANGEType(SCSHRConfiguration.SCSSReasonProdID, "SYS_ViewID,SYS_Name,FLAG");
                        // 新增請選擇選項
                        DataRow ndr = dtEMPCHANGESource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtEMPCHANGESource.Rows.InsertAt(ndr, 0);

                        kddlREASONID.DataSource     = dtEMPCHANGESource;
                        kddlREASONID.DataTextField  = "SYS_NAME";
                        kddlREASONID.DataValueField = "SYS_VIEWID";
                        kddlREASONID.DataBind();

                        #endregion 職務異動原因

                        #region 異動前職務資訊

                        using (SqlDataAdapter sda = new SqlDataAdapter(@"
                                -- 查詢申請者個人資訊
                                SELECT COMPANY_NO, OPTION2, OPTION3, OPTION4 
                                  FROM TB_EB_USER 
                                 WHERE USER_GUID = @USER_GUID

                                 -- 查詢申請者職稱
                                SELECT TITLE_NAME, TITLE_ID 
                                  FROM TB_EB_JOB_TITLE 
                                 WHERE TITLE_ID =(SELECT TOP 1 TITLE_ID 
					                                FROM TB_EB_EMPL_DEP 
				                                   WHERE USER_GUID = @USER_GUID 
				                                     AND GROUP_ID = @GROUP_ID)

                                -- 查詢申請者HR資訊
                                SELECT BU 
                                  FROM TB_EB_EMPL_HR
                                 WHERE USER_GUID = @USER_GUID
                                ", ConnectionString))
                            using (DataSet ds = new DataSet())
                            {
                                sda.SelectCommand.Parameters.AddWithValue("@USER_GUID", hidEMPLOYEEGuid.Value);
                                sda.SelectCommand.Parameters.AddWithValue("@GROUP_ID", hidAPPLICANTDEPT.Value);
                                try
                                {
                                    sda.Fill(ds);
                                    if (ds.Tables[0].Rows.Count > 0 &&
                                        ds.Tables[1].Rows.Count > 0)
                                    {
                                        DataRow drUser   = ds.Tables[0].Rows[0];
                                        DataRow drTitle  = ds.Tables[1].Rows[0];
                                        DataRow drEmplHr = ds.Tables[2].Rows[0];
                                        hidOCOMPANYID.Value   = drUser["COMPANY_NO"].ToString();      // 申報公司
                                        ktxtOCOMPANYNAME.Text = hidOCOMPANYID.Value;                  // 申報公司
                                        ktxtODEPARTNAME.Text  = KUser.GroupName[0];                   // 帳部部門
                                        hidODEPARTID.Value    = hidAPPLICANTDEPT.Value;               // 帳部部門
                                        //ktxtOPROFITNAME.Text = user.GroupName; // 利潤中心
                                        ktxtOPROFITNAME.Text      = drEmplHr["BU"].ToString();        // 利潤中心
                                        hidOPROFITID.Value        = drEmplHr["BU"].ToString();        // 利潤中心
                                        ktxtODUTYNAME.Text        = drTitle["TITLE_NAME"].ToString(); // 職稱
                                        hidODUTYID.Value          = drTitle["TITLE_ID"].ToString();   // 職稱
                                        ktxtOINSURANCESTATUS.Text = drUser["OPTION2"].ToString();     // 投保身份
                                        ktxtONotCutHIdentity.Text = drUser["OPTION3"].ToString();     // 免扣繳對象
                                        ktxtOIDYCLASSID.Text      = drUser["OPTION4"].ToString();     // 參考代碼
                                    }
                                }
                                catch (Exception e)
                                {
                                    DebugLog.Log(DebugLog.LogLevel.Error, string.Format(@"UC_KYTI_SCSHR_EMPCHANGE.異動前職務資訊.SELECT.ERROR:{0}", e.Message));
                                }
                            }
                        #endregion 異動前職務資訊

                        #region 異動後職務資訊
                        #region 申報公司
                        DataTable dtCompanyIDSource = getModifyType(SCSHRConfiguration.SCSSCompanyIDProdID, "SYS_ViewID,SYS_Name");
                        // 新增請選擇選項
                        ndr = dtCompanyIDSource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtCompanyIDSource.Rows.InsertAt(ndr, 0);

                        kddlCOMPANYID.DataSource     = dtCompanyIDSource;
                        kddlCOMPANYID.DataTextField  = "SYS_NAME";
                        kddlCOMPANYID.DataValueField = "SYS_VIEWID";
                        kddlCOMPANYID.DataBind();
                        kddlCOMPANYID.SelectedValue = hidOCOMPANYID.Value;
                        #endregion 申報公司
                        ktxtDEPARTNAME.Text          = ktxtODEPARTNAME.Text; // 帳部部門
                        hidDEPARTID.Value            = hidODEPARTID.Value;   // 帳部部門
                        hidPROFITID.Value            = hidOPROFITID.Value;   // 利潤中心
                        kddlPROFITNAME.SelectedValue = hidOPROFITID.Value;   // 利潤中心
                        if (!string.IsNullOrEmpty(kddlPROFITNAME.SelectedValue))
                        {
                            ktxtOPROFITNAME.Text = kddlPROFITNAME.SelectedItem.Text; // 如果找的到利潤中心的名稱就改用名稱
                        }
                        ktxtPROFITNAME.Text = ktxtOPROFITNAME.Text;                  // 利潤中心

                        #region 職稱

                        DataTable dtTitleSource = getModifyType(SCSHRConfiguration.SCSSTitleProdID, "SYS_ViewID,SYS_Name");
                        // 新增請選擇選項
                        ndr = dtTitleSource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtTitleSource.Rows.InsertAt(ndr, 0);

                        kddlDUTYID.DataSource     = dtTitleSource;
                        kddlDUTYID.DataTextField  = "SYS_NAME";
                        kddlDUTYID.DataValueField = "SYS_VIEWID";
                        kddlDUTYID.DataBind();
                        kddlDUTYID.SelectedValue = hidODUTYID.Value;

                        #endregion 職稱

                        kddlINSURANCESTATUS.SelectedValue = ktxtOINSURANCESTATUS.Text;     // 投保身份
                        kddlNotCutHIdentity.SelectedValue = ktxtONotCutHIdentity.Text;     // 免扣繳對象

                        #region 參考代碼

                        DataTable dtIDYClassSource = getModifyType(SCSHRConfiguration.SCSSIDYClassIDProdID, "SYS_ViewID,SYS_Name");
                        // 新增請選擇選項
                        ndr = dtIDYClassSource.NewRow();
                        ndr["SYS_VIEWID"] = "";
                        ndr["SYS_NAME"]   = "===請選擇===";
                        dtIDYClassSource.Rows.InsertAt(ndr, 0);

                        kddlIDYCLASSID.DataSource     = dtIDYClassSource;
                        kddlIDYCLASSID.DataTextField  = "SYS_NAME";
                        kddlIDYCLASSID.DataValueField = "SYS_VIEWID";
                        kddlIDYCLASSID.DataBind();
                        kddlIDYCLASSID.SelectedValue = ktxtOIDYCLASSID.Text;

                        #endregion 參考代碼

                        #endregion 異動後職務資訊

                        //取得利潤中心
                        kddlPROFITNAME.DataSource     = getPROFITID(SCSHRConfiguration.SCSSPROFITID, "SYS_ViewID,SYS_Name");
                        kddlPROFITNAME.DataValueField = "SYS_VIEWID";
                        kddlPROFITNAME.DataTextField  = "SYS_NAME";
                        kddlPROFITNAME.DataBind();
                    }
                    // 設定Picker是否能輸入
                    kdpSTARTDATE.TextBoxReadOnly = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpENDDATE.TextBoxReadOnly   = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    break;

                case FieldMode.Design:     // 表單設計階段
                    break;

                case FieldMode.Print:     // 表單列印
                    break;

                case FieldMode.Signin:     // 表單簽核
                    break;

                case FieldMode.Verify:     // Verify
                    break;

                case FieldMode.View:     // 表單觀看

                    break;
                }
            }
            else // 如果網頁POSTBACK
            {
                JGlobalLibs.WebUtils.RequestHiddenFields(UpdatePanel1); // 取回HiddenField的值
                switch (fieldOptional.FieldMode) // 判斷FieldMode
                {
                case FieldMode.Applicant:        // 起單或退回申請者
                case FieldMode.ReturnApplicant:
                    // 設定Picker是否能輸入
                    kdpSTARTDATE.ViewType        = KYTViewType.Input;
                    kdpENDDATE.ViewType          = KYTViewType.Input;
                    kdpSTARTDATE.TextBoxReadOnly = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    kdpENDDATE.TextBoxReadOnly   = SCSHRConfiguration.IS_PICKER_READONLY.ToUpper() == "Y";
                    break;
                }
            }
        }
    }
 protected RegisterField(PeripheralRegister parent, int position, int width, FieldMode fieldMode, Action <T, T> readCallback,
                         Action <T, T> writeCallback, Action <T, T> changeCallback, Func <T, T> valueProviderCallback) : base(parent, position, width, fieldMode)
 {
     this.readCallback          = readCallback;
     this.writeCallback         = writeCallback;
     this.changeCallback        = changeCallback;
     this.valueProviderCallback = valueProviderCallback;
 }
Beispiel #37
0
 public FieldSearchSort Mode(FieldMode mode)
 {
     _mode = mode;
     return(this);
 }
 public FlagRegisterField(PeripheralRegister parent, int position, FieldMode fieldMode, Action <bool, bool> readCallback,
                          Action <bool, bool> writeCallback, Action <bool, bool> changeCallback, Func <bool, bool> valueProviderCallback)
     : base(parent, position, 1, fieldMode, readCallback, writeCallback, changeCallback, valueProviderCallback)
 {
 }
Beispiel #39
0
 public static bool IsFlagSet(this FieldMode mode, FieldMode value)
 {
     return (mode & value) != 0;
 }
Beispiel #40
0
 public static bool IsWritable(this FieldMode mode)
 {
     return((mode & (FieldMode.Write | FieldMode.Set | FieldMode.Toggle | FieldMode.WriteOneToClear | FieldMode.WriteZeroToClear)) != 0);
 }
        /// <summary>
        /// Creates a nested field with the specified schema, and adds it to the schema being built.
        /// This method simply delegates to <see cref="Add(string, TableSchema, FieldMode, string)"/> after calling <see cref="Build"/>
        /// on <paramref name="nestedSchema"/>.
        /// </summary>
        /// <param name="name">The name of the field. Must be a valid field name.</param>
        /// <param name="nestedSchema">The schema for the nested field, in the form of a <see cref="TableSchemaBuilder"/>. Must not be null.</param>
        /// <param name="mode">The mode of the field. Must be a defined member within <see cref="FieldMode"/>.</param>
        /// <param name="description">The description of the field. May be null.</param>
        public void Add(string name, TableSchemaBuilder nestedSchema, FieldMode mode = FieldMode.Nullable, string description = null)
        {
            var builtSchema = GaxRestPreconditions.CheckNotNull(nestedSchema, nameof(nestedSchema)).Build();

            Add(name, builtSchema, mode, description);
        }