public AdmAirForm() { InitializeComponent(); txtUser.Text = GlobalService.User; txtDepartment.Text = MasterUtil.Department(); }
public childQuestionBank() { InitializeComponent(); foreach (string s in MasterUtil.GetExaminations()) { comboGrade.Items.Add(s); } IsNew = true; }
public static string ValidateQuestionBank(QuestionBank qb) { string[] topics = new string[] { "Easy", "Moderate", "Hard" }; StringBuilder sb = new StringBuilder(); if (!MasterUtil.IsExamValid(qb.ExamGrade)) { sb.AppendLine(string.Format("Examination name {0} is invalid.", qb.ExamGrade)); } ImageProcessor _processor = new ImageProcessor(Path.GetTempPath()); int i = 1; foreach (Question q in qb.Questions) { if (!MasterUtil.IsSubjectValid(q.Subject, qb.ExamGrade)) { sb.AppendLine(string.Format("{0}. Subject name {1} is invalid for the selected examination/grade {2}.", i, q.Subject, qb.ExamGrade)); } if (!MasterUtil.IsTopicValid(q.Topic, q.Subject, qb.ExamGrade)) { sb.AppendLine(string.Format("{0}. Topic name {1} is invalid for the selected subject {2}.", i, q.Topic, q.Subject)); } if (q.Complexity < 1 && q.Complexity > 3) { sb.AppendLine(string.Format("Complexity is invalid for the question number {0}.", i)); } if (!_processor.ValidateImage(q.QuestionText)) { sb.AppendLine(string.Format("Image in the question text for question number {0} is invalid or corrupt.", i)); } if (!_processor.ValidateImage(q.AnswerExplanation)) { sb.AppendLine(string.Format("Image in the answer explanation text for question number {0} is invalid or corrupt.", i)); } int j = 1; foreach (Answer a in q.OptionTexts) { if (!_processor.ValidateImage(a.OptionText)) { sb.AppendLine(string.Format("Image in the option text {0} for question number {1} is invalid or corrupt.", j, i)); } j++; } i++; } return(sb.ToString()); }
public AdmVisaForm() { InitializeComponent(); txtUser.Text = GlobalService.User; txtDepartment.Text = MasterUtil.Department(); Application.Idle += new EventHandler(Application_Idle); }
public static void SetDefaultTopic(QuestionBank qb) { foreach (Question q in qb.Questions) { if (!MasterUtil.IsTopicValid(q.Topic, q.Subject, qb.ExamGrade)) { q.Topic = "Others"; } } QBManager.Save(); }
public AdmApplicationForm() { InitializeComponent(); txtApplicant.Text = GlobalService.User; txtDivision.Text = MasterUtil.Division(); txtCostCentre.Text = MasterUtil.CostCentre(); cbItems.SelectedIndex = 0; LoadStampInfo(); }
private void comboSubject_SelectedIndexChanged(object sender, EventArgs e) { QuestionBank qb = QBManager.QBank; comboTopic.Items.Clear(); string text = ((System.Windows.Controls.ContentControl)(comboSubject.SelectedItem)).Content.ToString(); string[] topics = MasterUtil.GetTopics(qb.ExamGrade, text); foreach (string t in topics) { comboTopic.Items.Add(t); } }
public AdmStampForm() { InitializeComponent(); string[] items = { "$0.10", "$0.20", "$0.50", "$1.00", "$1.70", "$2.00", "$2.90", "$3.70", "$5.00", "$10.00" }; foreach (string item in items) { dgvItems.Rows.Add(item, "0", "0"); } txtUser.Text = GlobalService.User; txtDepartment.Text = MasterUtil.Department(); }
public OutstandingForm() { InitializeComponent(); cbCurr.SelectedIndex = 0; //GlobalService.User = AdUtil.getUsername("kmhk.local"); txtInvoice.LostFocus += new EventHandler(txtInvoice_LostFocus); txtVendorCode.LostFocus += new EventHandler(txtInvoice_LostFocus); string costCentre = MasterUtil.CostCentre(); DataGridViewComboBoxColumn colAccountCode = (DataGridViewComboBoxColumn)dgvOutstanding.Columns[0]; colAccountCode.DataSource = AccountCodeColumn(costCentre); DataGridViewComboBoxColumn colCostCentre = (DataGridViewComboBoxColumn)dgvOutstanding.Columns[2]; colCostCentre.DataSource = CostCentreColumn(); }
private List <string> AccountCodeColumn(string costcentre) { List <string> list = new List <string>(); string query = "select a_code, a_name from TB_CM_MASTER_ACCOUNTCODE order by a_code asc"; list.Add(""); bool isAc5 = costcentre != "" ? MasterUtil.IsAc5(costcentre) : true; bool isAc6 = costcentre != "" ? MasterUtil.IsAc6(costcentre) : true; using (IDataReader reader = DataServiceCM.GetInstance().ExecuteReader(query)) { while (reader.Read()) { string code = reader.GetString(0).Trim(); string name = reader.GetString(1).Trim(); if (code.StartsWith("5") && isAc5) { list.Add(code + " (" + name + ")"); list.Add("1003070001 (PREPAID EXPENSES THIRD PARTY)"); list.Add("1003090001 (SUSPENSE PAYMENT - STAFF)"); list.Add("1104010001 (GUARANTEE MONEY)"); list.Add("2001190001 (ACCRUED EXPENSES - THIRD PARTY)"); list.Add("6005010002 (TEMPORARY ACCOUNT FOR KDTCN)"); list.Add("6005010003 (TEMPORARY ACCOUNT FOR KDC)"); list.Add("6005010004 (TEMPORARY ACCOUNT FOR VENDOR)"); list.Add("6005010005 (TEMPORARY ACCOUNT FOR KDAS)"); list.Add("6005010006 (TEMPORARY ACCOUNT FOR KDTVN)"); } else if (code.StartsWith("6") && isAc6) { list.Add(code + " (" + name + ")"); } /*else * { * list.Add(code + " (" + name + ")"); * list.Add("1003070001 (PREPAID EXPENSES THIRD PARTY)"); * list.Add("1003090001 (SUSPENSE PAYMENT - STAFF)"); * list.Add("1104010001 (GUARANTEE MONEY)"); * list.Add("2001190001 (ACCRUED EXPENSES - THIRD PARTY)"); * list.Add("6005010002 (TEMPORARY ACCOUNT FOR KDTCN)"); * list.Add("6005010003 (TEMPORARY ACCOUNT FOR KDC)"); * list.Add("6005010004 (TEMPORARY ACCOUNT FOR VENDOR)"); * list.Add("6005010005 (TEMPORARY ACCOUNT FOR KDAS)"); * list.Add("6005010006 (TEMPORARY ACCOUNT FOR KDTVN)"); * }*/ } } list = list.Distinct().ToList(); list.Sort(); foreach (string item in list) { Debug.WriteLine(item); } return(list); }