示例#1
0
        private void viewButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (list.SelectedRows.Count == 0)
                    throw new ArgumentException("لطفا یکی از موارد را برای حسابرسی انتخاب کنید");

                var task = list.SelectedRows[0].Cells[0].Value as Task;
                var audits =
                    from audit in TaskAuditStorage.getInstance().all()
                    where audit.AuditTask == task
                    select audit;
                var form = new AuditSelectForm(task, audits);
                var res = form.ShowDialog();
                if(res == System.Windows.Forms.DialogResult.OK)
                    (new AuditTaskForm(form.Audit as TaskAudit)).Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
        private void viewButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (list.SelectedRows.Count == 0)
                    throw new ArgumentException("لطفا یکی از موارد را برای حسابرسی انتخاب کنید");

                var goal = list.SelectedRows[0].Cells[0].Value as GeneralGoal;
                var audits =
                    from audit in GeneralGoalAuditStorage.getInstance().all()
                    where audit.Goal == goal
                    select audit;
                var form = new AuditSelectForm(goal, audits);
                var res = form.ShowDialog();
                if(res == System.Windows.Forms.DialogResult.OK)
                    (new AuditGeneralForm(form.Audit as GeneralGoalAudit)).Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading| MessageBoxOptions.RightAlign);
            }
        }