示例#1
0
        private void CurrentTasks_Load(object sender, EventArgs e)
        {
            // Get The current tasks from the database
            // Create a object to access data and pass on employee id whose tasks are to be fetched.
            getCurrentTasks            GCT = new getCurrentTasks();
            IEnumerable <currenttasks> CT  = GCT.getTasks(GlobalVar.app_userID);

            // populate the datagrid view with the  fetched "Task Data"
            foreach (currenttasks t in CT)
            {
                getClientDetails cd = new getClientDetails();

                CurrentTasksDataGrid.Rows.Add(t.DateOfAssignment, cd.getClientName(t.ClientID), t.SubjectWithParty, t.areaOfWork, t.priority, t.TaskDescription,
                                              t.DocumentsSource, t.assigner, t.status, t.remarks, t.ID, t.ClientID);
            }
        }
示例#2
0
        private void LoginBTN_Click(object sender, EventArgs e)
        {
            string username;
            string password;

            // Condition to check if all textboxes are filled
            if (UsernameTxt.Text == string.Empty || PasswordTxt.Text == string.Empty)
            {
                onClientDetails += new getClientDetails(loginTextboxFail);
                onClientDetails.Invoke();
            }
            else
            {
                username = UsernameTxt.Text;
                password = PasswordTxt.Text;
                bool loginn = false;
                foreach (var item in loginList)
                {
                    if (username == item.Key && password == item.Value)
                    {
                        loginn = true;
                    }
                }
                if (loginn)
                {
                    clientUsername = username;
                    //invoke event that displays success message
                    onClientDetails += new getClientDetails(loginSuccess);
                    onClientDetails.Invoke();

                    MenuForm.Show();
                    this.Hide();
                }
                else
                {
                    //invoke event that displays failed message
                    onClientDetails += new getClientDetails(loginFailed);
                    onClientDetails.Invoke();
                }
            }
        }