Beispiel #1
0
 public void UpdateRealtion(TaskType objType, IfUser objSub, IfUser objHand, QLevel objLevel)
 {
     this.task.BusinessType = objType;
     this.task.Submitter    = objSub;
     this.task.Handler      = objHand;
     this.task.QLevel       = objLevel;
     UpdatePriority();
 }
 public void UpdateRealtion(TaskType objType, IfUser objSub, ProcedureStep objStep, QLevel objLevel)
 {
     this.task.BusinessType = objType;
     this.task.Submitter    = objSub;
     this.task.Handler      = objSub;
     this.curStep           = objStep;
     this.task.QLevel       = objLevel;
     UpdatePriority();
 }
Beispiel #3
0
 public void InsertNewUser(IfUser newUser)
 {
     if (newUser == null)
     {
         return;
     }
     if (this.GetUserItem(newUser.Name) == null)
     {
         userList.Add(newUser);
     }
 }
Beispiel #4
0
        private void CreateUser()
        {
            IfUser newUser = SelectUserType(TypeComboBox.Text);

            RefreshUserGroup(newUser);
            if (TypeComboBox.Text == "Manager")
            {
                RefreshInferior((Manager)newUser);
            }
            mainDataSet.InsertNewUser(newUser);
            return;
        }
Beispiel #5
0
 public Task(XmlElement ModelPayload)
 {
     this.strName      = Utility.GetText(ModelPayload, "Name");
     this.taskType     = null;
     this.usrSubmitter = null;
     this.usrHandler   = null;
     this.datStartTime = Convert.ToDateTime(Utility.GetText(ModelPayload, "StartTime"));
     this.datDeadLine  = Convert.ToDateTime(Utility.GetText(ModelPayload, "DeadLine"));
     this.eQlevel      = null;
     this.taskStatus   = TaskStatus.ToEnum(Utility.GetText(ModelPayload, "Status"));
     this.dubPriority  = 0.0;
 }
Beispiel #6
0
 public Task(string sName, DateTime dStart, DateTime dDead)
 {
     this.strName      = sName;
     this.taskType     = null;
     this.usrSubmitter = null;
     this.usrHandler   = null;
     this.datStartTime = dStart;
     this.datDeadLine  = dDead;
     this.eQlevel      = null;
     this.taskStatus   = TaskStatus.EnumTaskStatus.Process;
     this.dubPriority  = 0.0;
 }
Beispiel #7
0
        private void LoadInfo(string sName)
        {
            IfUser curItem = mainDataSet.GetUserItem(sName);

            if (curItem == null)
            {
                return;
            }
            TypeComboBox.Text    = curItem.Type;
            PasswordTextBox.Text = curItem.Password;
            foreach (UserGroup curGroup in curItem.UserGroups)
            {
                GroupListBox.Items.Add(curGroup.Name);
            }
            if (curItem.Type == "Customer")
            {
                PhoneTextBox.Text   = ((Customer)curItem).Phone;
                CompanyTextBox.Text = ((Customer)curItem).Company;
            }
            else if (curItem.Type == "Engineer")
            {
                EmployeeTextBox.Text = ((Engineer)curItem).EmployeeNumber;
            }
            else if (curItem.Type == "ServiceUser")
            {
                EmployeeTextBox.Text = ((ServiceUser)curItem).EmployeeNumber;
            }
            else if (curItem.Type == "Manager")
            {
                EmployeeTextBox.Text = ((Manager)curItem).EmployeeNumber;
                foreach (IfUser curUser in ((Manager)curItem).Inferiors)
                {
                    InferiorListBox.Items.Add(curUser.Name);
                }
            }
        }
Beispiel #8
0
        private void SubmitWorkTimeTask(IfUser Submitter, IfUser Handler)
        {
            string strName = "填报工时_" + Handler.Name + "_" + DateTime.Today.ToShortDateString();

            if (mainDataSet.GetTaskItem(strName) != null)
            {
                ShowStatus("Task: " + strName + " already exists.");
                return;
            }
            DateTime   dDate    = DateTime.Now + new TimeSpan(3, 0, 0, 0);
            CustomTask newTask  = new CustomTask(strName, DateTime.Now, dDate, strName);
            TaskType   workTime = mainDataSet.GetTypeItem("填报工时");

            if (workTime == null)
            {
                workTime = new TaskType("填报工时", 70);
            }
            newTask.UpdateRealtion(workTime,
                                   Submitter,
                                   Handler,
                                   mainDataSet.GetQlevelItem("Q3"));
            mainDataSet.InsertCustomTask(newTask, workTime);
            mainDataSet.UpdateRuntimeDataSet();
        }
Beispiel #9
0
        private void RefreshUserGroup(IfUser curUser)
        {
            bool             bolIsExist;
            List <string>    insertGroups;
            List <UserGroup> deleteGroups;

            //比较两表生成一个Insert表,一个Delete表
            deleteGroups = new List <UserGroup>();
            foreach (UserGroup curGroup in curUser.UserGroups)
            {
                bolIsExist = false;
                foreach (string sItem in UserGroups)
                {
                    if (curGroup.Name == sItem)
                    {
                        bolIsExist = true;
                    }
                }
                if (bolIsExist == false)
                {
                    deleteGroups.Add(curGroup);
                }
            }
            insertGroups = new List <string>();
            foreach (string sItem in UserGroups)
            {
                bolIsExist = false;
                foreach (UserGroup curGroup in curUser.UserGroups)
                {
                    if (curGroup.Name == sItem)
                    {
                        bolIsExist = true;
                    }
                }
                if (bolIsExist == false)
                {
                    insertGroups.Add(sItem);
                }
            }
            if (deleteGroups.Count != 0)
            {
                foreach (UserGroup curGroup in deleteGroups)
                {
                    curUser.UserGroups.Remove(curGroup);
                    curGroup.Users.Remove(curUser);
                }
            }
            if (insertGroups.Count != 0)
            {
                UserGroup newGroup;
                foreach (string curItem in insertGroups)
                {
                    newGroup = mainDataSet.GetGroupItem(curItem);
                    if (newGroup == null)
                    {
                        continue;
                    }
                    curUser.UserGroups.Add(newGroup);
                    newGroup.Users.Add(curUser);
                }
            }
        }