Esempio n. 1
0
        /// <summary>
        /// NotifyIconWrapper クラス を生成、初期化します。
        /// </summary>
        public NotifyIconWrapper()
        {
            // コンポーネントの初期化
            InitializeComponent();

            // タイマーのインスタンスを生成
            _timeInterval = new TimeInterval();
            _timeInterval.LoadJson();
            _pomodoroTime = new PomodoroTimer(_timeInterval);
            _pomodoroTime.PomodoroTimerTickEventHandler += new PomodoroTimer.TimerTickEventHandler(CallBackEventProgress);

            // Window の初期化
            _settingsVM    = new SettingsVM(_timeInterval);
            _endPomodoroVM = new EndPomodoroVM(_pomodoroTime);
            _taskListVM    = new TaskListVM();

            // コンテキストメニューのイベントを設定
            this.toolStripMenuItem_Exit.Click      += this.toolStripMenuItem_Exit_Click;
            this.toolStripMenuItem_Start.Click     += this.toolStripMenuItem_Start_Click;
            this.toolStripMenuItem_Break.Click     += this.toolStripMenuItem_Break_Click;
            this.toolStripMenuItem_LongBreak.Click += this.toolStripMenuItem_LongBreak_Click;
            this.toolStripMenuItem_Settings.Click  += this.toolStripMenuItem_Settings_Click;
            this.toolStripMenuItem_TaskEdit.Click  += this.toolStripMenuItem_TaskEdit_Click;

            // TextBox の初期化
            toolStripMenuItem_TimeText.Text = "00:00";
        }
Esempio n. 2
0
        public JsonResult InsertOrUpdate(TaskListVM tasklistVM)
        {
            var client = new HttpClient
            {
                BaseAddress = new Uri("https://localhost:44320/api/")
            };

            client.DefaultRequestHeaders.Add("Authorization", HttpContext.Session.GetString(("JWToken")));
            //tasklistVM.Project_Id = HttpContext.Session.GetString("Id");
            var myContent   = JsonConvert.SerializeObject(tasklistVM);
            var buffer      = System.Text.Encoding.UTF8.GetBytes(myContent);
            var byteContent = new ByteArrayContent(buffer);

            byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            if (tasklistVM.Id.Equals(0))
            {
                var result = client.PostAsync("TaskList/Insert", byteContent).Result;
                return(Json(result));
            }
            else
            {
                var result = client.PutAsync("TaskList/" + tasklistVM.Id, byteContent).Result;
                return(Json(result));
            }
        }
Esempio n. 3
0
        public static List <TaskListVM> GetAllTasks()
        {
            //Create an empty list of AttendanceRecordVms
            List <TaskListVM> taskListVms = new List <TaskListVM>();

            //Get connection string from Web Config
            SqlConnection Connection = new SqlConnection(ConnectionString);

            Connection.Open();

            //Provide a SQL command
            SqlCommand command =
                new SqlCommand(
                    "SELECT TaskId, DueDate, CourseName, TaskDescription, Completion FROM Course INNER JOIN Task ON Task.CourseCode = Course.CourseCode; ",
                    Connection);

            //Execute SQL command and read data from DB
            using (SqlDataReader reader = command.ExecuteReader())
            {
                while (reader.Read())
                {
                    TaskListVM tasks = new TaskListVM(); //task is one row of following 4 data
                    tasks.TaskId          = (Guid)reader["TaskId"];
                    tasks.DueDate         = (DateTime)reader["DueDate"];
                    tasks.CourseName      = (string)reader["CourseName"];
                    tasks.TaskDescription = (string)reader["TaskDescription"];
                    tasks.Completion      = (bool)reader["Completion"];
                    taskListVms.Add(tasks); //add new task into Vms(List)
                }
            }

            Connection.Close();

            return(taskListVms);
        }
Esempio n. 4
0
        public TaskListWindow(TaskListVM taskListVM)
        {
            InitializeComponent();

            InputCategoryComboBox.ItemsSource = _CategoryComboBoxList;
            InputTaskData.DataContext         = taskListVM;
            DG_TaskList.DataContext           = taskListVM.TaskList;
        }
Esempio n. 5
0
 public int Insert(TaskListVM taskListVM)
 {
     using (var connection = new SqlConnection(_configuration.GetConnectionString("MyNetCoreConnection")))
     {
         var procName = "SP_Insert_TB_T_Task_List";
         parameters.Add("@Name", taskListVM.Name);
         parameters.Add("@Status", taskListVM.Status);
         parameters.Add("@Project_Id", taskListVM.Project_Id);
         var data = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure);
         return(data);
     }
 }
Esempio n. 6
0
        public BaseResponse addUser(User vm)
        {
            string err;
            int    id = TaskListVM.AddUser(vm, out err);

            return(new BaseResponse()
            {
                count = id > 0 ? 1 : 0,
                id = id > 0 ? id : 0,
                error = err,
                status = id > 0 ? "SUCCESS" : "FAIL"
            });
        }
Esempio n. 7
0
 public IEnumerable <TaskListVM> getTaskList(int userID, int?taskType)
 {
     return(TaskListVM.GetTaskByUserID(userID, taskType));
 }
Esempio n. 8
0
 public IActionResult Insert(TaskListVM taskListVM)
 {
     _repository.Insert(taskListVM);
     return(Ok("Insert Succesfully"));
 }