Esempio n. 1
0
        public async Task <IActionResult> completed(int id)
        {
            var Email  = _httpContextAccessor.HttpContext.User.Identity.Name;
            var UserId = await _dGetByEmail.UserByEmail(Email);

            var data = await _dgetactivitybyid.ActivityById(id);

            var model = new Activities();

            model.Id            = id;
            model.Completed     = true;
            model.CompletedTime = DateTime.Now.ToString();
            model.Status        = "Completed By";
            await _dupdateactivity.Update(model);

            //////////////////////////////
            ///
            var data1 = await _dgetactivitybyid.ActivityById(id);

            var datamodel = new Activitydata();

            datamodel.AssignDate   = data1.AssignedTime;
            datamodel.TaskId       = data1.Id;
            datamodel.UserId       = data1.UserId;
            datamodel.Status       = data1.Status;
            datamodel.FullName     = UserId.FullName;
            datamodel.Name         = data1.Name;
            datamodel.CompleteDate = DateTime.Now.ToString();
            await _dcreateactivitydata.Create(datamodel);

            return(RedirectToAction("WorkingList", "Board"));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create(UserTasks taskModel)
        {
            if (taskModel == null)
            {
                return(View(taskModel));
            }
            var task = new UserTasks();

            task.Name = taskModel.Name;
            await _dcreatetask.Create(task);



            var Email  = _httpContextAccessor.HttpContext.User.Identity.Name;
            var UserId = await _dGetByEmail.UserByEmail(Email);

            var modal = new Activitydata();

            modal.FullName = UserId.FullName;
            modal.Name     = taskModel.Name;
            modal.UserId   = UserId.Id;
            modal.Status   = "Created by";
            await _daddtaskactivity.Create(modal);

            TempData["Sucess"] = "Task has been added";
            return(RedirectToAction("Create", "Task"));
        }
Esempio n. 3
0
 public async Task Create(Activitydata data)
 {
     List <SQLParam> sQLParams = new List <SQLParam>()
     {
         new SQLParam("@name", data.Name),
         new SQLParam("@fullname", data.FullName),
         new SQLParam("@status", data.Status),
         new SQLParam("@id", data.UserId)
     };
     await _addtaskactivity.Create(sQLParams);
 }
Esempio n. 4
0
 public async Task Create(Activitydata data)
 {
     List <SQLParam> sQLParams = new List <SQLParam>()
     {
         new SQLParam("@taskid", data.TaskId),
         new SQLParam("@userId", data.UserId),
         new SQLParam("@assignTime", data.AssignDate),
         new SQLParam("@completedTime", data.CompleteDate),
         new SQLParam("@status", data.Status),
         new SQLParam("@name", data.Name),
         new SQLParam("@fullname", data.FullName)
     };
     await _createactivity.Create(sQLParams);
 }
Esempio n. 5
0
        public async Task <IActionResult> Add(string name)
        {
            if (name != null)
            {
                var lst = new List <string>();


                string text = name;

                string[] word = text.Split(':');


                foreach (var item in word)
                {
                    if (item != "")
                    {
                        lst.Add(item);
                    }
                }


                foreach (var task in lst)
                {
                    if (task != "")
                    {
                        var Email  = _httpContextAccessor.HttpContext.User.Identity.Name;
                        var UserId = await _dGetByEmail.UserByEmail(Email);

                        var user = await _dgetuserinfo.UserById(UserId.Id);

                        var taskid = await _dgettaskbyname.TaskbyName(task);

                        var model = new Activities();
                        model.TaskId = taskid.Id;
                        model.UserId = UserId.Id;
                        model.Name   = task;


                        model.Status = "Assigned to";

                        await _dcreateactivity.Create(model);


                        var datamodel = new Activitydata();
                        datamodel.AssignDate   = DateTime.Now.ToString();
                        datamodel.TaskId       = taskid.Id;
                        datamodel.UserId       = UserId.Id;
                        datamodel.CompleteDate = " ";
                        datamodel.FullName     = UserId.FullName;
                        datamodel.Name         = task;
                        datamodel.Status       = "Assigned to";;
                        await _dcreateactivitydata.Create(datamodel);
                    }
                }


                return(RedirectToAction("WorkingList", "Board"));
            }
            TempData["Sucess"] = "Assigned Sucessfully";
            return(RedirectToAction("WorkingList", "Board"));
        }