private void HandleUpdateSourceEmployeeMessage(UpdateSourceEmployeeMessage obj)
        {
            try
            {
                BindingExpression be = EmployeeId.GetBindingExpression(SfTextBoxExt.TextProperty);
                be.UpdateSource();

                BindingExpression bf = FirstName.GetBindingExpression(SfTextBoxExt.TextProperty);
                bf.UpdateSource();

                BindingExpression bm = MiddleName.GetBindingExpression(SfTextBoxExt.TextProperty);
                bm.UpdateSource();

                BindingExpression bl = LastName.GetBindingExpression(SfTextBoxExt.TextProperty);
                bl.UpdateSource();

                BindingExpression bs = NameSuffix.GetBindingExpression(SfTextBoxExt.TextProperty);
                bs.UpdateSource();

                BindingExpression ba = AddressView.txtAddress.GetBindingExpression(SfTextBoxExt.TextProperty);
                ba.UpdateSource();

                BindingExpression ba2 = AddressView.txtAddress2.GetBindingExpression(SfTextBoxExt.TextProperty);
                ba2.UpdateSource();

                BindingExpression bt = AddressView.txtZipCode.GetBindingExpression(SfTextBoxExt.TextProperty);
                bt.UpdateSource();
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 ///     A hash code for the current object.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = IncludeNamespace.GetHashCode();
         hashCode = (hashCode * 397) ^ IncludeTypeParameters.GetHashCode();
         hashCode = (hashCode * 397) ^ IncludeGenericTypeParameters.GetHashCode();
         hashCode = (hashCode * 397) ^ NestedTypeSeparator.GetHashCode();
         hashCode = (hashCode * 397) ^ (NameSuffix != null ? NameSuffix.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IncludeGlobal.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
 public void TrimAllFields()
 {
     FirstName  = FirstName.TrimIfNotNull();
     LastName   = LastName.TrimIfNotNull();
     ZipCode    = ZipCode.TrimIfNotNull();
     MiddleName = MiddleName.TrimIfNotNull();
     NameSuffix = NameSuffix.TrimIfNotNull();
     Address    = Address.TrimIfNotNull();
     City       = City.TrimIfNotNull();
     State      = State.TrimIfNotNull();
     Email      = Email.TrimIfNotNull();
     CellPhone  = CellPhone.TrimIfNotNull();
     HomePhone  = HomePhone.TrimIfNotNull();
     Apartment  = Apartment.TrimIfNotNull();
 }
        public void Can_sort_simple_value_objects()
        {
            var name3 = new NameSuffix(3);
            var name1 = new NameSuffix(1);
            var name4 = new NameSuffix(4);
            var name2 = new NameSuffix(2);

            NameSuffix[] nameSuffixes = new [] { name3, name1, name4, name2 }
            .OrderBy(x => x)
            .ToArray();

            nameSuffixes[0].Should().BeSameAs(name1);
            nameSuffixes[1].Should().BeSameAs(name2);
            nameSuffixes[2].Should().BeSameAs(name3);
            nameSuffixes[3].Should().BeSameAs(name4);
        }
 public Name(string first, string last, NameSuffix suffix)
 {
     First  = first;
     Last   = last;
     Suffix = suffix;
 }
Ejemplo n.º 6
0
 public TypePrinterResult(string type = "", string nameSuffix = "")
 {
     Type = type;
     NameSuffix.Append(nameSuffix);
 }
Ejemplo n.º 7
0
 public string GetCodeName()
 {
     return(NameUtils.ToCodeName(XmlName, false)
            + ((NameSuffix == 0) ? "" : NameSuffix.ToString(CultureInfo.InvariantCulture)));
 }
Ejemplo n.º 8
0
        private void Bind()
        {
            var dic = new UserResourceBLL().GetDownList();

            // 日期格式
            this.DateFormat.DataTextField  = "show";
            this.DateFormat.DataValueField = "val";
            this.DateFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "DateFormat").Value;
            this.DateFormat.DataBind();
            // DateFormat.Items.Insert(0, new ListItem() { Value = "0", Text = "   ", Selected = true });
            //数字格式
            this.NumberFormat.DataTextField  = "show";
            this.NumberFormat.DataValueField = "val";
            this.NumberFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "NumberFormat").Value;
            NumberFormat.DataBind();
            // NumberFormat.Items.Insert(0, new ListItem() { Value = "0", Text = "   ", Selected = true });
            //TimeFormat时间格式
            this.TimeFormat.DataTextField  = "show";
            this.TimeFormat.DataValueField = "val";
            this.TimeFormat.DataSource     = dic.FirstOrDefault(_ => _.Key == "TimeFormat").Value;
            TimeFormat.DataBind();
            // TimeFormat.Items.Insert(0, new ListItem() { Value = "0", Text = "   ", Selected = true });
            //EmailType50
            this.EmailType.DataTextField  = "show";
            this.EmailType.DataValueField = "val";
            this.EmailType.DataSource     = dic.FirstOrDefault(_ => _.Key == "EmailType").Value;
            EmailType.DataBind();
            EmailType.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            this.EmailType1.DataTextField  = "show";
            this.EmailType1.DataValueField = "val";
            this.EmailType1.DataSource     = dic.FirstOrDefault(_ => _.Key == "EmailType").Value;
            EmailType1.DataBind();
            EmailType1.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            this.EmailType2.DataTextField  = "show";
            this.EmailType2.DataValueField = "val";
            this.EmailType2.DataSource     = dic.FirstOrDefault(_ => _.Key == "EmailType").Value;
            EmailType2.DataBind();
            EmailType2.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            //Sex49
            this.Sex.DataTextField  = "show";
            this.Sex.DataValueField = "val";
            this.Sex.DataSource     = dic.FirstOrDefault(_ => _.Key == "Sex").Value;
            Sex.DataBind();
            Sex.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            //NameSuffix
            this.NameSuffix.DataTextField  = "show";
            this.NameSuffix.DataValueField = "val";
            this.NameSuffix.DataSource     = dic.FirstOrDefault(_ => _.Key == "NameSuffix").Value;
            NameSuffix.DataBind();
            NameSuffix.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            //Prefix前缀
            //Prefix.Items.Insert(0, new ListItem() { Value = "0", Text = "   ", Selected = true });
            //Prefix.Items.Insert(1, new ListItem() { Value = "1", Text = "Mr." });
            //Prefix.Items.Insert(2, new ListItem() { Value = "2", Text = "Mrs." });
            //Prefix.Items.Insert(3, new ListItem() { Value = "3", Text = "Ms." });
            //主要位置  location_id

            this.Position.DataTextField  = "name";
            this.Position.DataValueField = "id";
            this.Position.DataSource     = dic.FirstOrDefault(_ => _.Key == "Position").Value;
            Position.DataBind();
            Position.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            Position.Items.Insert(1, new ListItem()
            {
                Value = "1", Text = "总部"
            });
            //授权tab页

            //权限等级
            //this.Security_Level
            this.Security_Level.DataTextField  = "name";
            this.Security_Level.DataValueField = "id";
            this.Security_Level.DataSource     = dic.FirstOrDefault(_ => _.Key == "Security_Level").Value;
            Security_Level.DataBind();
            Security_Level.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });
            //外包权限
            //this.Outsource_Security
            this.Outsource_Security.DataTextField  = "show";
            this.Outsource_Security.DataValueField = "val";
            this.Outsource_Security.DataSource     = dic.FirstOrDefault(_ => _.Key == "Outsource_Security").Value;
            Outsource_Security.DataBind();
            Outsource_Security.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "   ", Selected = true
            });

            //员工类型
            var genBll  = new GeneralBLL();
            var resType = genBll.GetDicValues(GeneralTableEnum.RESOURCE_TYPE);

            type_id.DataTextField  = "show";
            type_id.DataValueField = "val";
            type_id.DataSource     = resType;
            type_id.DataBind();

            //薪资类型
            var payType = genBll.GetDicValues(GeneralTableEnum.PAYROLL_TYPE);

            payroll_type_id.DataTextField  = "show";
            payroll_type_id.DataValueField = "val";
            payroll_type_id.DataSource     = payType;
            payroll_type_id.DataBind();

            hire_date.Text             = DateTime.Now.ToString("yyyy-MM-dd");
            time_sheet_start_date.Text = DateTime.Now.ToString("yyyy-MM-dd");

            var tmoffBll = new TimeOffPolicyBLL();
            // 休假方案
            var policyList = tmoffBll.GetPolicyList();

            timeoff_policy_id.DataTextField  = "name";
            timeoff_policy_id.DataValueField = "id";
            timeoff_policy_id.DataSource     = policyList;
            timeoff_policy_id.DataBind();
            timeoff_policy_id.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "", Selected = true
            });

            // 出差限度
            var travelRest = genBll.GetDicValues(GeneralTableEnum.TRAVEL_RESTRICTIONS);

            travel_restrictions_id.DataTextField  = "show";
            travel_restrictions_id.DataValueField = "val";
            travel_restrictions_id.DataSource     = travelRest;
            travel_restrictions_id.DataBind();
        }