public EvaluationDetailForm(string id) { InitializeComponent(); this.id = id; string url = ApiRouting.GetUrl("", "", "evaluation", ApiFunction.GetById).ToString() + "?EvId=" + id; bool getEv = url.Get <VEvaluation>(ref listEv); if (!getEv) { MessageBox.Show("Cannot Connect To Server!"); return; } VEvaluation vEvaluation = listEv[0]; lbCreatedDate.Text = vEvaluation.CreatedDate; lbDescription.Text = vEvaluation.EvDescription; lbFromDate.Text = vEvaluation.fromDate; lbToDate.Text = vEvaluation.toDate; lbStatus.Text = vEvaluation.Status; string evQUrl = ApiRouting.GetUrl("", "", "evaluationDetail", ApiFunction.GetByEvId).ToString() + "?EvId=" + id; bool getEvQ = evQUrl.GetDeserializeObject <VEvaluationDetail>(ref EVD); if (!getEvQ) { MessageBox.Show("Cannot Connect To Server!"); return; } dataGridQuestion.DataSource = EVD.VEvaluationQuestion.Select(x => new { ID = x.EvQId, Description = x.EvQDescription }).ToList(); dataGridStaff.DataSource = EVD.vEvaluationDetailStaff; //dataGridQuestion.DataSource = listEVQ.Select(x=> new {ID = x.EvQId,Description = x.EvQDescription }).ToList(); }
public SelectQuestion() { InitializeComponent(); listEvQ = new List <Entity.VEvaluationQuestion>(); string url = ApiRouting.GetUrl("", "", "evaluationQuestion", ApiFunction.GetAll).ToString(); bool confirm = url.Get <Entity.VEvaluationQuestion>(ref listEvQ); if (!confirm) { MessageBox.Show("Operation Failed"); } dataGridMain.DataSource = listEvQ.Select(x => new { Description = x.EvQDescription }).ToList(); dataGridMain.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; dataGridMain.Columns.Add(new DataGridViewCheckBoxColumn() { HeaderText = "Selected", Name = "Selected", TrueValue = true, FalseValue = false }); dataGridMain.Columns[dataGridMain.Columns.Count - 1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; foreach (DataGridViewColumn col in dataGridMain.Columns) { if (col.HeaderText != "Selected") { col.ReadOnly = true; } } }
public SelectStaff() { InitializeComponent(); obj = Singleton.Instance.Container.Resolve <AddEvaluation>(); listDepartment = new List <VDepartment>(); listOffice = new List <VOffice>(); listStaff = new List <VStaff>(); bool conDepartment = ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString().Get <VDepartment>(ref listDepartment); bool conOffice = ApiRouting.GetUrl("", "", "office", ApiFunction.GetAll).ToString().Get <VOffice>(ref listOffice); bool conStaff = ApiRouting.GetUrl("", "", "staff", ApiFunction.GetAll).ToString().Get <VStaff>(ref listStaff); dataGridMain.DataSource = listStaff.Select(x => new { ID = x.StaffId, Name = x.Sname, Office = x.OfficeId, Department = x.DeptId }).ToList(); comboDepartment.DataSource = listDepartment.Select(x => x.Deptname).ToList(); comboOffice.DataSource = listOffice.Select(x => x.OfficeName).ToList(); dataGridMain.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; dataGridMain.AutoGenerateColumns = false; dataGridMain.Columns.Add(new DataGridViewCheckBoxColumn() { HeaderText = "Selected", Name = "Selected", TrueValue = true, FalseValue = false }); dataGridMain.Columns[dataGridMain.Columns.Count - 1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; foreach (DataGridViewColumn col in dataGridMain.Columns) { if (col.HeaderText != "Selected") { col.ReadOnly = true; } } }
private void BtnDeleteEvaluation_Click(object sender, EventArgs e) { int index = dataGridMain.CurrentCell.RowIndex; string EvId = dataGridMain.Rows[index].Cells[0].Value.ToString(); VEvaluation vEvaluation = new VEvaluation() { CreatedDate = "", EvId = EvId, EvDescription = "", fromDate = "", StaffId = "", Status = "", toDate = "", EvTId = "" }; string queryString = vEvaluation.GetQueryString(); string url = ApiRouting.GetUrl("", "", "evaluation", ApiFunction.DeleteById).ToString() + queryString; bool confirm = url.Detete <VEvaluation>(); if (confirm) { MessageBox.Show("Operation Succesful", "Successful"); Init(); } }
private void BtnDelete_Click(object sender, EventArgs e) { int index = dataGridMain.CurrentCell.RowIndex; string id = dataGridMain.Rows[index].Cells[0].Value.ToString(); User user = new User() { Created_date = "", Password = "", Regcom_id = "", StaffId = "", Status = "", Username = "", UserId = id, Role = "" }; string queryString = user.GetQueryString <User>(); string url = ApiRouting.GetUrl("", "", "user", ApiFunction.DeleteById).ToString() + queryString; bool confirm = url.Detete <User>(); if (!confirm) { MessageBox.Show("Cannot delete user account!"); } Init(); }
private void BtnSubmit_Click(object sender, EventArgs e) { if (txtType.TextLength == 0) { MessageBox.Show("Please input information"); return; } string text = txtType.Text.Trim(); EvaluationType evaluationType = new EvaluationType() { EvTName = text, EvTId = "" }; string json = JsonConvert.SerializeObject(evaluationType); string url = ApiRouting.GetUrl("", "", "evaluationType", ApiFunction.Add).ToString(); bool confirm = url.Post <EvaluationType>(json); if (confirm) { MessageBox.Show("Operation Successful"); } else { MessageBox.Show("Operation Falied"); } txtType.Clear(); var evtObj = Singleton.Instance.Container.Resolve <MainView>("evaluation type"); evtObj.Init(); }
private void BtnDelete_Click(object sender, EventArgs e) { int index = dataGridMain.CurrentCell.RowIndex; string StaffId = dataGridMain.Rows[index].Cells[0].Value.ToString(); Staff staff = new Staff() { CreatedBy = "", CurrentAddress = "", DeptID = "", Dob = "", Email = "", OfficeId = "", Phone = "", Pid = "", Pob = "", SName = "", Sex = "", UserGroupID = "", StaffId = StaffId }; string queryString = staff.GetQueryString <Staff>(); string url = ApiRouting.GetUrl("", "", "staff", ApiFunction.DeleteById).ToString() + queryString; bool confirm = url.Detete <Staff>(); if (confirm) { MessageBox.Show("Deleted Successful", "Deleted Successful"); Init(); } }
private void BtnSubmit_Click(object sender, EventArgs e) { string officeName = txtOfficeName.Text.Trim(); if (officeName.Length == 0) { MessageBox.Show("Office Name Required !", "Invalid Input"); return; } string deptName = comboDepartment.SelectedItem.ToString(); string deptId = listDepartment.Where(x => x.Deptname == deptName).Select(x => x.DeptId).FirstOrDefault(); Office office = new Office() { DeptId = deptId, OfficeName = officeName }; string url = ApiRouting.GetUrl("", "", "office", ApiFunction.Add).ToString(); string json = JsonConvert.SerializeObject(office); bool confirm = url.Post <Office>(json); var objOffice = Singleton.Instance.Container.Resolve <MainView>("office"); if (confirm) { MessageBox.Show("Office added successful", "Successful"); objOffice.Init(); } else { MessageBox.Show("Connection Error!", "Error!"); } }
public AddOfficeForm() { InitializeComponent(); listDepartment = new List <VDepartment>(); bool confirm = ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString().Get <VDepartment>(ref listDepartment); comboDepartment.DataSource = listDepartment.Select(x => x.Deptname).ToList(); }
public override void Init() { List <VDepartment> list = new List <VDepartment>(); string url = ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString(); bool status = url.Get <VDepartment>(ref list); dataGridMain.DataSource = list; MessageBox.Confirm(status, "department", dataGridMain); }
public override void Init() { string url = ApiRouting.GetUrl("", "", "user", ApiFunction.GetAll).ToString(); bool confirm = url.Get <VUser>(ref listUser); if (confirm) { dataGridMain.DataSource = listUser; } }
public override void Init() { string url = ApiRouting.GetUrl("", "", "evaluationQuestion", ApiFunction.GetAll).ToString(); bool confirm = url.Get <Entity.VEvaluationQuestion>(ref listEvQ); if (confirm) { dataGridMain.DataSource = listEvQ; } }
public override void Init() { listRole = new List <VUsergroup>(); bool conRole = ApiRouting.GetUrl("", "", "usergroup", ApiFunction.GetAll).ToString().Get <VUsergroup>(ref listRole); if (conRole) { DataGridMain.DataSource = listRole; } }
public override void Init() { List <VStaff> listStaff = new List <VStaff>(); bool confirm = ApiRouting.GetUrl("", "", "staff", ApiFunction.GetAll).ToString().Get <VStaff>(ref listStaff); if (confirm) { dataGridMain.DataSource = listStaff; MessageBox.Confirm(confirm, "staff", dataGridMain); } }
public StaffView() { InitializeComponent(); List <VStaff> listStaff = new List <VStaff>(); bool confirm = ApiRouting.GetUrl("", "", "staff", ApiFunction.GetAll).ToString().Get <VStaff>(ref listStaff); if (confirm) { dataGridMain.DataSource = listStaff; } }
public EvaluatedHistroy() { InitializeComponent(); string url = ApiRouting.GetUrl("", "", "assignstaff", ApiFunction.GetEvByStaffId).ToString() + "?StaffId=" + GlobalVariable.StaffID; bool confirm = url.Get <VEvaluationHistoryOnStaff>(ref listEvH); if (confirm) { dataGridMain.DataSource = listEvH.Select(x => new { ID = x.EvId, Description = x.EvDescription, Duration = x.duration, Status = x.Status }).ToList(); } }
public void Init() { string url = ApiRouting.GetUrl("", "", "dailyactivitydetail", ApiFunction.GetByStaDAId).ToString() + "?StaDAId=" + StaDAId; bool confirm = url.Get <VDailyActivitiesNoQuestion>(ref listVAddActivity); if (!confirm) { MessageBox.Show("Cannot connect to server!!"); return; } dataGridMain.DataSource = listVAddActivity; }
public AddEvaluation() { InitializeComponent(); listEvaType = new List <VEvaluationType>(); string url = ApiRouting.GetUrl("", "", "evaluationType", ApiFunction.GetAll).ToString(); bool confirm = url.Get <VEvaluationType>(ref listEvaType); if (confirm) { comboType.DataSource = listEvaType.Select(x => x.EvTName).ToList(); } }
public void Init() { string url = ApiRouting.GetUrl("", "", "dailyactivity", ApiFunction.GetAll).ToString() + "?StaffId=" + GlobalVariable.StaffID; bool confirm = url.Get <VDailyActivities>(ref listDAct); if (!confirm) { MessageBox.Show("Cannot connect to server!"); return; } dataGridActivities.DataSource = listDAct; ConfigureGridAct(); }
public UserAccount() { InitializeComponent(); listDepartment = new List <VDepartment>(); listOffice = new List <VOffice>(); bool conDepartment = ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString().Get <VDepartment>(ref listDepartment); bool conOffice = ApiRouting.GetUrl("", "", "office", ApiFunction.GetAll).ToString().Get <VOffice>(ref listOffice); comboOffice.DataSource = listOffice.Select(x => x.OfficeName).ToList(); comboDepartment.DataSource = listDepartment.Select(x => x.Deptname).ToList(); comboOffice.SelectedIndex = -1; comboDepartment.SelectedIndex = -1; listUser = new List <VUser>(); }
public override void Init() { string url = ApiRouting.GetUrl("", "", "usergroup", ApiFunction.GetAll).ToString(); bool confirm = url.Get <VGroup>(ref listGroup); if (confirm) { dataGridMain.DataSource = listGroup; } else { MessageBox.Show("Cannot connect to server!", "Error"); } }
public override void Init() { string url = ApiRouting.GetUrl("", "", "position", ApiFunction.GetAll).ToString(); bool confirm = url.Get <VPosition>(ref listPosition); if (confirm) { dataGridMain.DataSource = listPosition; } else { MessageBox.Show("Cannot Connect To Server!", "Connection Error"); } }
public override void Init() { string url = ApiRouting.GetUrl("", "", "dailyactivity", ApiFunction.GetAllByManager).ToString() + "?StaffId=" + GlobalVariable.StaffID; bool confirm = url.Get <VAllDailyActivity>(ref listAllDActivity); dataGridMain.DataSource = listAllDActivity; foreach (DataGridViewRow dt in dataGridMain.Rows) { if ((string)dt.Cells["Status"].Value == "Pending") { dt.DefaultCellStyle.ForeColor = Color.Red; } } }
public override void Init() { string url = ApiRouting.GetUrl("", "", "evaluationType", ApiFunction.GetAll).ToString(); bool confirm = url.Get <VEvaluationType>(ref listEvT); if (confirm) { dataGridMain.DataSource = listEvT; } else { MessageBox.Show("Operation Failed"); } }
public EvaluationQuestionDetail(string EvQId, string Question) { InitializeComponent(); listEvQD = new List <VEvaluationQuestionDetail>(); string url = ApiRouting.GetUrl("", "", "evaluationQuestionDetail", ApiFunction.GetById).ToString() + "?EvQId=" + EvQId; bool confirm = url.Get <Entity.VEvaluationQuestionDetail>(ref listEvQD); if (confirm) { txtAnswer.Text = listEvQD[0].Answer; txtMaxScore.Text = listEvQD[0].MaxScore + ""; txtMinScore.Text = listEvQD[0].MinScore + ""; txtQuestion.Text = Question; } }
public AddStaffForm() { InitializeComponent(); listDepartment = new List <VDepartment>(); listOffice = new List <VOffice>(); listPosition = new List <VPosition>(); listUserGroup = new List <VUsergroup>(); ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString().Get <VDepartment>(ref listDepartment); ApiRouting.GetUrl("", "", "office", ApiFunction.GetAll).ToString().Get <VOffice>(ref listOffice); ApiRouting.GetUrl("", "", "position", ApiFunction.GetAll).ToString().Get <VPosition>(ref listPosition); ApiRouting.GetUrl("", "", "usergroup", ApiFunction.GetAll).ToString().Get <VUsergroup>(ref listUserGroup); comboDepartment.DataSource = listDepartment.Select(x => x.Deptname).ToList(); comboOffice.DataSource = listOffice.Select(x => x.OfficeName).ToList(); comboGroup.DataSource = listUserGroup.Select(x => x.Name).ToList(); comboPosition.DataSource = listPosition.Select(x => x.Pname).ToList(); }
private void BtnDeleteDepartment_Click(object sender, EventArgs e) { int index = dataGridMain.CurrentCell.RowIndex; string id = dataGridMain.Rows[index].Cells[0].Value.ToString(); Department department = new Department() { Deptname = "", DeptId = id }; string QueryString = department.GetQueryString <Department>(); string url = ApiRouting.GetUrl("", "", "department", ApiFunction.DeleteById).ToString() + QueryString; bool confirm = url.Detete <Department>(); if (confirm) { this.Init(); } }
private bool AddStaff() { string name = txtName.Text.Trim(); string sex = comboGender.SelectedItem.ToString(); string dob = dtDOB.Value.ToShortDateString(); string address = txtAddress.Text.Trim(); string phone = txtPhone.Text.Trim(); string email = txtEmail.Text.Trim(); string deptName = comboDepartment.SelectedItem.ToString(); string deptId = listDepartment.Where(x => x.Deptname == deptName).Select(x => x.DeptId).FirstOrDefault(); string officeName = comboOffice.SelectedItem.ToString(); string officeId = listOffice.Where(x => x.OfficeName == officeName).Select(x => x.OfficeId).FirstOrDefault(); string position = comboPosition.SelectedItem.ToString(); string positionId = listPosition.Where(x => x.Pname == position).Select(x => x.Pid).FirstOrDefault(); string group = comboGroup.SelectedItem.ToString(); string groupId = listUserGroup.Where(x => x.Name == group).Select(x => x.UserGroupID).FirstOrDefault(); Staff staff = new Staff() { CreatedBy = GlobalVariable.LoginStaffName, CurrentAddress = address, DeptID = deptId, Dob = dob, Email = email, OfficeId = officeId, Phone = phone, Pid = positionId, Pob = address, SName = name, Sex = sex, UserGroupID = groupId, StaffId = "" }; string json = JsonConvert.SerializeObject(staff); string url = ApiRouting.GetUrl("", "", "staff", ApiFunction.Add).ToString(); bool confirm = url.Post <Staff>(json); if (confirm) { MessageBox.Show("Staff Added Successful", "Successful"); var objStaff = Singleton.Instance.Container.Resolve <MainView>("staff"); objStaff.Init(); return(true); } return(false); }
public AddUserAccount() { InitializeComponent(); listDepartment = new List <VDepartment>(); bool conDepartment = ApiRouting.GetUrl("", "", "department", ApiFunction.GetAll).ToString().Get <VDepartment>(ref listDepartment); bool conOffice = ApiRouting.GetUrl("", "", "office", ApiFunction.GetAll).ToString().Get <VOffice>(ref listOffice); bool conStaff = ApiRouting.GetUrl("", "", "staff", ApiFunction.GetAll).ToString().Get <VStaff>(ref listStaff); bool conRole = ApiRouting.GetUrl("", "", "usergroup", ApiFunction.GetAll).ToString().Get <UserRole>(ref listRole); comboRole.DataSource = listRole.Select(x => x.Name).ToList(); comboStaff.DataSource = listStaff.Select(x => x.Sname).ToList(); comboDepartment.DataSource = listDepartment.Select(x => x.Deptname).ToList(); comboOffice.DataSource = listOffice.Select(x => x.OfficeName).ToList(); if (!conDepartment || !conOffice || !conStaff) { MessageBox.Show("Cannot connect to server!", "Error"); } }
public override void Init() { string url = ApiRouting.GetUrl("", "", "evaluation", ApiFunction.GetAll).ToString(); bool confirm = url.Get <VEvaluation>(ref listEva); if (confirm) { dataGridMain.DataSource = listEva.Select(x => new { ID = x.EvId, Description = x.EvDescription, Start_Date = x.fromDate, End_Date = x.toDate, Created_Date = x.CreatedDate, Created_By = x.StaffId, x.Status }).ToList(); } }