Esempio n. 1
0
        internal override object CreateEditorContainer(object rowItem, object containerType)
        {
            if (!this.CanEdit || containerType != this.GetEditorType(rowItem))
            {
                return(this.CreateContainer(rowItem));
            }

            // return this.CreateEditorContentVisual();

            ////TODO: Create value proxy to provide option for delayed update of the values in the VM behind.
            FrameworkElement content = this.CreateEditorContentVisual();

            var host = new EditRowHostPanel();

            host.Owner = this.Model.GridView;
            var validation = new ValidationControl()
            {
                ControlPeer = content
            };

            host.Children.Add(content);
            host.Children.Add(validation);

            return(new Tuple <FrameworkElement, FrameworkElement, FrameworkElement>(content, host, validation));
        }
Esempio n. 2
0
        public override void OnAuthorization(HttpActionContext actionContext)
        {
            if (actionContext.Request.Headers.Authorization == null)
            {
                actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized);
            }
            else
            {
                var tokenkey   = actionContext.Request.Headers.Authorization.Parameter;
                var jsonstring = FTH.Extension.Encrypter.Decrypt(tokenkey, "1");
                var perso      = Newtonsoft.Json.JsonConvert.DeserializeObject <Personeller>(jsonstring);

                Personeller pers = ValidationControl.IsPersonel(perso.Adi, perso.SoyAdi);

                if (pers != null)
                {
                    Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(pers.Adi), null);
                }
                else
                {
                    actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized);
                }
            }

            base.OnAuthorization(actionContext);
        }
Esempio n. 3
0
 public void Add(ValidationControl pControl)
 {
     if ((pControl == null))
     {
         return;
     }
     this.List.Add(pControl);
 }
Esempio n. 4
0
    public void Add(object pControl)
    {
        if ((pControl == null))
        {
            return;
        }
        ValidationControl obj = new ValidationControl();

        obj.ControlObj   = pControl;
        obj.DisplayName  = ((System.Windows.Forms.Control)pControl).Name;
        obj.ErrorMessage = ("Please enter " + ((System.Windows.Forms.Control)pControl).Name);
        this.List.Add(obj);
    }
Esempio n. 5
0
    public void Add(object pControl, string pDisplayName, string pErrorMessage)
    {
        if ((pControl == null))
        {
            return;
        }
        ValidationControl obj = new ValidationControl();

        obj.ControlObj   = pControl;
        obj.DisplayName  = pDisplayName;
        obj.ErrorMessage = pErrorMessage;
        this.List.Add(obj);
    }
Esempio n. 6
0
        public HttpResponseMessage Get([FromUri] string name, [FromUri] string surname)
        {
            var Perso = ValidationControl.IsPersonel(name, surname);

            if (Perso != null)
            {
                //UserNorth u = new UserNorth();
                //u.name = Perso.Adi;
                //u.surname = Perso.SoyAdi;
                var    jsonstr = Newtonsoft.Json.JsonConvert.SerializeObject(Perso);
                string token   = FTH.Extension.Encrypter.Encrypt(jsonstr, "159357");
                return(Request.CreateResponse(HttpStatusCode.OK, token));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized, "Giriş yapılan bilgilere sahip personel bulunmamaktadır."));
            }
        }
Esempio n. 7
0
 public void ValidateObject(object sender, EventArgs e, UIElementCollection UIElements, List <ListPickerValidationControl> listpickers)
 {
     foreach (UIElement ui in UIElements)
     {
         if (ui.GetType() == typeof(ValidationControl))
         {
             ValidationControl control = (ValidationControl)ui;
             IValidationRule   v       = (IValidationRule)control.ValidationRule;
             IsPageValid     = v.Validate(control.Text);
             control.IsValid = IsPageValid;
         }
         else if (ui.GetType() == typeof(ListPickerValidationControl))
         {
             ListPickerValidationControl control = (ListPickerValidationControl)ui;
             IValidationRule             v       = (IValidationRule)control.ValidationRule;
             IsPageValid     = v.Validate(((ICustomListBox)control.SelectedItem).Value == "Choose ..." ? "" : "valid");
             control.IsValid = IsPageValid;
         }
     }
 }
		public void TestInitialize()
		{
			_control = new ValidationControl();
		}
 public void TestInitialize()
 {
     _control = new ValidationControl();
 }