private void Save() { LearningAreaServiceClient laService = new LearningAreaServiceClient(); Boolean ret = false; string message = String.Empty; LearningArea learningArea = new LearningArea() { LearningAreaCode = txtLearningAreaCode.Text.ToString(), Description = txtDescription.Text.ToString(), Units = Double.Parse(txtUnits.Text.ToString()), Subjects = subjects.ToArray(), RatePerUnit = Double.Parse(txtRate.Text.ToString()), Academic = checkAcademic.Checked }; if (Op.Equals("edit")) { ret = laService.UpdateLearningArea(ref learningArea, ref message); } else { ret = laService.CreateLearningArea(ref learningArea, ref message); } if (ret) { MessageBox.Show("Saved Successfully"); } else { MessageBox.Show("Error Saving"); } Close(); }
private void Save() { LearningAreaServiceClient laService = new LearningAreaServiceClient(); Boolean ret = false; string message = String.Empty; LearningArea learningArea = new LearningArea() { LearningAreaCode = txtLearningAreaCode.Text.ToString(), Description = txtDescription.Text.ToString(), Units = Double.Parse(txtUnits.Text.ToString()), Subjects = subjects.ToArray(), RatePerUnit = Double.Parse(txtRate.Text.ToString()), Academic = checkAcademic.Checked }; if (Op.Equals("edit")) ret = laService.UpdateLearningArea(ref learningArea, ref message); else ret = laService.CreateLearningArea(ref learningArea, ref message); if (ret) MessageBox.Show("Saved Successfully"); else MessageBox.Show("Error Saving"); Close(); }
private void LoadLearningAreas() { LearningAreaServiceClient laService = new LearningAreaServiceClient(); string message = String.Empty; try { var lAreas = laService.GetAllLearningAreas(); learningAreaList = new List<LearningArea>(lAreas); gvLearningArea.DataSource = lAreas; gvLearningArea.Refresh(); if (gvLearningArea.RowCount != 0) gvLearningArea.Rows[0].IsSelected = true; } catch (Exception ex) { message = "Error Loading LearningArea List"; MessageBox.Show(ex.ToString()); } }
private void LoadLearningAreas() { LearningAreaServiceClient laService = new LearningAreaServiceClient(); string message = String.Empty; try { var lAreas = laService.GetAllLearningAreas(); learningAreaList = new List <LearningArea>(lAreas); gvLearningArea.DataSource = lAreas; gvLearningArea.Refresh(); if (gvLearningArea.RowCount != 0) { gvLearningArea.Rows[0].IsSelected = true; } } catch (Exception ex) { message = "Error Loading LearningArea List"; MessageBox.Show(ex.ToString()); } }
private void frmManageSubject_Load(object sender, EventArgs e) { LearningAreaServiceClient laService = new LearningAreaServiceClient(); GradeLevelServiceClient glService = new GradeLevelServiceClient(); gradeLevel = new List <GradeLevel>(glService.GetAllGradeLevels()); if (gradeLevel.Count < 1) { gvSubjects.Enabled = false; } colGradeLevel = new GridViewComboBoxColumn("GradeLevel"); //colGradeLevel colGradeLevel.HeaderText = "Grade Level"; colGradeLevel.FieldName = "GradeLevel"; colGradeLevel.ValueMember = "GradeLev"; colGradeLevel.DisplayMember = "Description"; colGradeLevel.Width = 115; colGradeLevel.DataSource = gradeLevel; gvSubjects.Columns.Add(colGradeLevel); if (Op.Equals("edit")) { SetFields(); SetSubjectGrid(); } if (Op.Equals("new")) { BindSubjectGrid(); } }
private void frmManageSubject_Load(object sender, EventArgs e) { LearningAreaServiceClient laService = new LearningAreaServiceClient(); GradeLevelServiceClient glService = new GradeLevelServiceClient(); gradeLevel = new List<GradeLevel>(glService.GetAllGradeLevels()); colGradeLevel = new GridViewComboBoxColumn("GradeLevel"); colGradeLevel.HeaderText = "Grade Level"; colGradeLevel.FieldName = "GradeLevel"; colGradeLevel.ValueMember = "GradeLev"; colGradeLevel.DisplayMember = "Description"; colGradeLevel.Width = 110; colGradeLevel.DataSource = gradeLevel; gvSubjects.Columns.Add(colGradeLevel); if (Op.Equals("edit")) { SetFields(); SetSubjectGrid(); } if (Op.Equals("new")) { BindSubjectGrid(); gvSubjects.Enabled = false; btnSave.Enabled = false; this.Size = new Size(772, 485); } }
private void txtLearningAreaCode_Leave(object sender, EventArgs e) { LearningArea la = new LearningArea(); string msg = string.Empty; LearningAreaServiceClient laService = new LearningAreaServiceClient(); la = laService.GetLearningArea(txtLearningAreaCode.Text); if (la.LearningAreaCode != null) { MessageBox.Show("Learning Area already exist!"); txtLearningAreaCode.Text = string.Empty; txtLearningAreaCode.Focus(); return; } }
private void Save() { LearningAreaServiceClient laService = new LearningAreaServiceClient(); Boolean ret = false; string message = String.Empty; bool chec = checkAcademic.Checked; LearningArea learningArea = new LearningArea() { LearningAreaCode = txtLearningAreaCode.Text.ToString(), Description = txtDescription.Text.ToString(), Units = Double.Parse(txtUnits.Text.ToString()), Subjects = subjects.ToArray(), RatePerUnit = Double.Parse(txtRate.Text.ToString()), RatePerSubject = Double.Parse(txtRatePerSubject.Text.ToString()), Academic = chec }; if (Op.Equals("edit")) { ret = laService.UpdateLearningArea(ref learningArea, ref message); Log("U", "LearningArea", learningArea); foreach (Subject s in subjects) { Log("U", "Subject", s); } if (ret) MessageBox.Show("Saved Successfully"); else MessageBox.Show("Error Saving"); if (Op.Equals("edit")) Close(); } else { String la = txtLearningAreaCode.Text.ToString(); if (la.Equals(String.Empty)) { MessageBox.Show("Provide Learning Area Code"); } else { ret = laService.CreateLearningArea(ref learningArea, ref message); Log("C", "LearningAreas", learningArea); if (ret) MessageBox.Show("Saved Successfully"); else MessageBox.Show("Error Saving"); if (Op.Equals("new")) { Op = "edit"; txtLearningAreaCode.Enabled = false; this.Size = new Size(704, 568); gvSubjects.Enabled = true; } } } }