public Field Map(CreateOrEditViewModel createOrEdit)
        {
            Field field = new Field();

              if (createOrEdit.Id != null)
            field = this.handler.Storage.GetRepository<IFieldRepository>().WithKey((int)createOrEdit.Id);

              else field.FormId = createOrEdit.FormId;

              field.FieldTypeId = createOrEdit.FieldTypeId;
              field.Position = createOrEdit.Position;
              return field;
        }
Exemplo n.º 2
0
        public Field Map(CreateOrEditViewModel createOrEdit)
        {
            Field field = new Field();

            if (createOrEdit.Id != null)
            {
                field = this.handler.Storage.GetRepository <IFieldRepository>().WithKey((int)createOrEdit.Id);
            }

            else
            {
                field.FormId = createOrEdit.FormId;
            }

            field.FieldTypeId = createOrEdit.FieldTypeId;
            field.Position    = createOrEdit.Position;
            return(field);
        }
Exemplo n.º 3
0
        public Field Map(CreateOrEditViewModel createOrEdit)
        {
            Field field = new Field();

            if (createOrEdit.Id != null)
            {
                field = this.RequestHandler.Storage.GetRepository <IFieldRepository>().WithKey((int)createOrEdit.Id);
            }

            else
            {
                field.FormId = createOrEdit.FormId;
            }

            field.FieldTypeId = createOrEdit.FieldTypeId;
            field.Code        = createOrEdit.Code;
            field.IsRequired  = createOrEdit.IsRequired;
            field.MaxLength   = createOrEdit.MaxLength;
            field.Position    = createOrEdit.Position;
            return(field);
        }