Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskViewModel"/> class.
        /// </summary>
        /// <param name="task">
        /// The task.
        /// </param>
        /// <param name="hairStyles">
        /// The hair Styles.
        /// </param>
        public TaskViewModel(Task task, IEnumerable<HairStyle> hairStyles)
        {
            _task = task;

            HairStyles = hairStyles.Select(style => new SelectListItem
                {
                    Value = style.id + ";" + style.small_image,
                    Text = style.name
                }).ToArray();
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskProxy"/> class.
        /// </summary>
        /// <param name="task">
        /// The task.
        /// </param>
        public TaskProxy(Task task)
        {
            this.Id = task.id;

            this.Client = task.client;

            this.Phone = task.phone;

            this.Description = task.description;

            this.Date = task.date ?? DateTime.Now;

            this.HairStyleId = task.hairstyle_id ?? 0;
        }
Пример #3
0
        public Task ToTask()
        {
            var task = new Task
                {
                    id = this.Id,
                    client = this.Client,
                    phone = this.Phone,
                    description = this.Description,
                    date = this.Date,
                    hairstyle_id = this.HairStyleId
                };

            return task;
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TaskViewModel"/> class.
 /// </summary>
 public TaskViewModel()
 {
     _task = new Task();
 }
 /// <summary>
 /// Create a new Task object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="client">Initial value of the client property.</param>
 /// <param name="phone">Initial value of the phone property.</param>
 public static Task CreateTask(global::System.Int32 id, global::System.String client, global::System.String phone)
 {
     Task task = new Task();
     task.id = id;
     task.client = client;
     task.phone = phone;
     return task;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Tasks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTasks(Task task)
 {
     base.AddObject("Tasks", task);
 }