Exemple #1
0
        public async Task <TaskAssign> InsertTaskAssign(TaskAssign data, CancellationToken cancellationToken)
        {
            data.CreatedTS = DateTime.Now;
            var result = await _context.TaskAssigns.AddAsync(data, cancellationToken);

            return(null);
        }
Exemple #2
0
        void Shell_Loaded(object sender, RoutedEventArgs e)
        {
            TaskAssign view = new TaskAssign();

            view.CurrentApp     = App.CurrentApp;
            BorderContent.Child = view;
        }
        public JsonResult Save(TaskAssign model)
        {
            if (model.TaskAssignType == "Department")
            {
                var dept = departmentManager.GetById(model.TaskAssignTypeId);

                model.TaskType = dept.Name;
            }
            else if (model.TaskAssignType == "Group")
            {
                var group = groupManager.GetById(model.TaskAssignTypeId);

                model.TaskType = group.Name;
            }
            else if (model.TaskAssignType == "Employee")
            {
                var employee = employeeInfoManager.GetById(model.TaskAssignTypeId);

                model.TaskType = employee.Name;
            }
            else if (model.TaskAssignType == "Member")
            {
                var member = memberManager.GetById(model.TaskAssignTypeId);

                model.TaskType = member.Name;
            }



            if (taskAssignManager.SaveOrUpdate(model))
            {
                return(Json(new { info = "Saved", status = true }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { info = "Not Saved", status = false }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AssingTask(TaskAssign taskAssign)
        {
            var userId = WebSecurity.CurrentUserId;

            taskAssign.TaskAssignBy = userId;
            db.TaskAssigns.Add(taskAssign);
            db.SaveChanges();

            return(RedirectToAction("Index", "Home"));
        }
Exemple #5
0
        public ActionResult TaskAssign(TaskAssign task)
        {
            task.addTaskUser(task);


            return(Content(@"<body>
                       <script type='text/javascript'>
                        alert('Les données ont été enregistrées.');
                         window.close();
                       </script>
                     </body> "));
        }
Exemple #6
0
        // GET: Task

        // controleur pour la view d'assignation des tâches
        public ActionResult TaskAssign(string description, int idProjet, bool newTask)
        {
            TaskAssign thisTask = new TaskAssign();

            thisTask         = thisTask.getTaskInfo(description, idProjet);
            thisTask.NewTask = newTask;
            TaskUser taskUser = new TaskUser();

            thisTask.TaskUserList = taskUser.getTaskUser(thisTask.IdTask);

            return(View(thisTask));
        }
Exemple #7
0
        private void btn2TaskTrack_Click_1(object sender, RoutedEventArgs e)
        {
            var        temp           = CurrentApp as S3103App;
            TaskAssign taskAssignView = new TaskAssign();

            CurrentApp.CurrentView  = taskAssignView;
            taskAssignView.PageName = "taskAssignView";
            if (temp != null)
            {
                temp.InitMainView(taskAssignView);
                //temp.InitMainView(0);
            }
        }
Exemple #8
0
        public async Task <TaskAssign> UpdateTaskAssign(int Id, TaskAssign data)
        {
            try
            {
                data.UpdatedTS = DateTime.Now;
                _context.Attach(data).State = EntityState.Detached;
                var result = _context.TaskAssigns.Update(data);
                await _context.SaveChangesAsync();

                return(null);
            }
            catch (Exception Ex)
            {
                throw;
            }
        }
        public JsonResult SaveComment(CommentOnTaskVm commentOnTask)
        {
            CommentOnTask commentModel = new CommentOnTask();
            TaskAssign    taskModel    = new TaskAssign();

            var exist = taskAssignManager.GetById(commentOnTask.Id);

            taskModel.Id               = commentOnTask.Id;
            taskModel.Logo             = commentOnTask.Logo;
            taskModel.Priority         = commentOnTask.Priority;
            taskModel.StartDate        = commentOnTask.StartDate;
            taskModel.Status           = commentOnTask.Status;
            taskModel.TaskAssignType   = commentOnTask.TaskAssignType;
            taskModel.TaskAssignTypeId = commentOnTask.TaskAssignTypeId;
            taskModel.TaskDetails      = commentOnTask.TaskDetails;
            taskModel.TaskName         = commentOnTask.TaskName;
            taskModel.TaskShortName    = commentOnTask.TaskShortName;
            taskModel.TaskType         = commentOnTask.TaskType;
            taskModel.Banner           = commentOnTask.Banner;
            taskModel.EndDate          = commentOnTask.EndDate;

            taskModel.Created    = exist.Created;
            taskModel.CreatedBy  = exist.CreatedBy;
            taskModel.Modified   = exist.Modified;
            taskModel.ModifiedBy = exist.ModifiedBy;
            taskModel.IsActive   = exist.IsActive;

            commentModel.TaskAssignId = taskModel.Id;
            commentModel.TaskComment  = commentOnTask.Comment;

            if (taskAssignManager.SaveOrUpdate(taskModel))
            {
                commentOnTaskManager.SaveComments(commentModel);
                return(Json(new { info = "Saved", status = true }, JsonRequestBehavior.AllowGet));
            }

            else
            {
                return(Json(new { info = "Not Saved", status = false }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #10
0
    // Use this for initialization
    void Start()
    {
        days_since_start = 0;
        Time.timeScale   = 1.0f;

        curr_state    = State.DAY_SHIFT;
        shift_length  = 5f;           //60f*2f; //2 minutes
        lunch_length  = 5f;           //60f*1f; //1 minute
        time_elapsed  = shift_length; // count down to end of shift
        shift_started = false;

        employee_manager = EmployeeManager.GetComponent <EmployeeManager> ();
        task_assign      = TaskAssign.GetComponent <TaskAssign> ();

        // Sliders for 2 employees, and players can't change these
        //emp1_energy.enabled = false;
        //emp2_energy.enabled = false;

        // Initialize energy for sliders
        currEnergy = shift_length;
        maxEnergy  = shift_length;

        // Hide sliders before shift starts
        HideSliders();
        HideFeedbackText();
        HideEmployeePanel();
        HideTaskAssign();
        HideIngredients();
        HideEmployeeChoose();
        HideWeek();

        bread_list = new Dictionary <string, GameObject>();
        foreach (Transform bread in Breads.transform)
        {
            string key = Regex.Match(bread.gameObject.name, @"\d+").Value;
            bread_list.Add(key, bread.gameObject);

            //hide all bread first
            if (key != "100")
            {
                Color col = bread.GetComponent <SpriteRenderer> ().color;
                col.a = 0f;
                bread.GetComponent <SpriteRenderer> ().color = col;
            }
        }

        // SELL
        sell_freq         = shift_length / (float)(store.GetReputation());
        sell_freq_elapsed = sell_freq;

        emp1_sell_freq         = sell_freq;
        emp2_sell_freq         = sell_freq;
        emp1_sell_freq_elapsed = emp1_sell_freq;
        emp2_sell_freq_elapsed = emp2_sell_freq;

        // MAKE
        emp1_make_freq         = 10f; //default
        emp2_make_freq         = 10f; //default
        emp1_make_freq_elapsed = emp1_make_freq;
        emp2_make_freq_elapsed = emp2_make_freq;

        // Get audio source component
        collectSound = store.GetComponent <AudioSource>();
    }
Exemple #11
0
            public static AgendaTaskClass SaveAgendaTask(string username, int agendaID, string title, string desc, DateTime dueDate, string[] usernames)
            {
                AgendaTaskClass rObject = new AgendaTaskClass();

                using (boxEntities box = new boxEntities())
                {
                    usernames = usernames.Distinct().ToArray();


                    if (AgendaClass.AgendaPrivacyClass.CheckRole(username, MeetingRoles.Creator, agendaID))
                    {
                        // create the header
                        TaskAssign task = new TaskAssign();
                        task.AgendaID    = agendaID;
                        task.TaskTitle   = title;
                        task.TaskDesc    = desc;
                        task.DueDate     = dueDate;
                        task.DateCreated = DateTime.Now;
                        task.Creator     = Profile.getUserID(username);
                        box.TaskAssigns.AddObject(task);
                        box.SaveChanges();

                        // check if all
                        int[]    users = { };
                        string[] na    = { };
                        if (usernames.Contains("All"))
                        {
                            // get all users in meeting ids
                            users = AgendaPrivacyClass.ListParticipantIDs(agendaID);
                            na    = AgendaPrivacyClass.ListParticipantUsername(agendaID);
                        }
                        else
                        {
                            users = Profile.GetUserIDs(usernames);
                            na    = usernames;
                        }
                        foreach (var t in users)
                        {
                            TaskUser u = new TaskUser();
                            u.UserID       = t;
                            u.TaskID       = task.TaskID;
                            u.AssignedDate = DateTime.Now;
                            task.TaskUsers.Add(u);
                        }
                        box.SaveChanges();
                        rObject.TaskID      = task.TaskID;
                        rObject.CreatedDate = task.DateCreated;
                        rObject.DueDate     = task.DueDate;
                        rObject.Desc        = task.TaskDesc;
                        rObject.Title       = task.TaskTitle;
                        rObject.AgendaID    = agendaID;
                        rObject.Usernames   = na;
                        rObject.Creator     = username;

                        return(rObject);
                    }
                    else
                    {
                        throw new UnauthorizedAccessException();
                    }
                }
            }
Exemple #12
0
            } // done

            public static ProjectTaskClass SaveProjectFileTask(string username, int projectID, string title, string desc, DateTime dueDate, string[] usernames, string fileFullname)
            {
                ProjectTaskClass rObject = new ProjectTaskClass();

                using (boxEntities box = new boxEntities())
                {
                    usernames = usernames.Distinct().ToArray();


                    if (Roles.UserIsAllowed_Project(username, ProjectPrivilages.Manage, projectID))
                    {
                        // get projectfile id
                        var fileid = (from o in box.ProjectFiles
                                      where o.ProjectID == projectID && o.FullName == fileFullname
                                      select o.ID).FirstOrDefault();
                        if (fileid != 0)
                        {
                            // create the header
                            TaskAssign task = new TaskAssign();
                            task.ProjecFileID = fileid;
                            task.TaskTitle    = title;
                            task.TaskDesc     = desc;
                            task.DueDate      = dueDate;
                            task.DateCreated  = DateTime.Now;
                            task.Creator      = Profile.getUserID(username);
                            box.TaskAssigns.AddObject(task);
                            box.SaveChanges();

                            // check if all
                            int[]    users = { };
                            string[] na    = { };
                            if (usernames.Contains("All"))
                            {
                                // get all users in meeting ids
                                users = ProjectPrivacyClass.GetProjectFileUserIDs(fileid);
                                na    = ProjectPrivacyClass.GetProjectFileUsernames(fileid);
                            }
                            else
                            {
                                users = Profile.GetUserIDs(usernames);
                                na    = usernames;
                            }
                            foreach (var t in users)
                            {
                                TaskUser u = new TaskUser();
                                u.UserID       = t;
                                u.TaskID       = task.TaskID;
                                u.AssignedDate = DateTime.Now;
                                task.TaskUsers.Add(u);
                            }
                            box.SaveChanges();
                            rObject.TaskID        = task.TaskID;
                            rObject.CreatedDate   = task.DateCreated;
                            rObject.DueDate       = task.DueDate;
                            rObject.Desc          = task.TaskDesc;
                            rObject.Title         = task.TaskTitle;
                            rObject.ProjectFileID = fileid;
                            rObject.Usernames     = na;
                            rObject.Creator       = username;

                            return(rObject);
                        }
                        else
                        {
                            throw new FileNotFoundException();
                        }
                    }
                    else
                    {
                        throw new UnauthorizedAccessException();
                    }
                }
            } // done