Ejemplo n.º 1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            //int AuditId = Convert.ToInt32(dgvAudits.SelectedRows[0].Cells["Id"].Value.ToString());
            //Audit thisAudit = auditList.Where(i => i.Id == AuditId).First();

            if (!UserAction.IsLegal(Action.Header_Create, glAudit.Auditor1ID, glAudit.Auditor2ID, glAudit.SupervisorID))
            {
                return;
            }

            FIHeaderEdit frmHeaderEdit = new FIHeaderEdit(glAudit);

            frmHeaderEdit.ShowDialog();

            if (frmHeaderEdit.success)
            {
                Audit_Headers = SelectHeaders(glAudit.Id);

                if (AdminAccess == false)
                {
                    Audit_Headers = Audit_Headers.Where(i => i.IsDeleted == false).ToList();
                }

                FillHeadersDataGridView(dgvHeaders, Audit_Headers);
            }
        }
Ejemplo n.º 2
0
        private void MIeditHeader_Click(object sender, EventArgs e)
        {
            if (dgvHeaders.SelectedRows.Count > 0)
            {
                int      HeaderId       = Convert.ToInt32(dgvHeaders.SelectedRows[0].Cells["HeaderId"].Value.ToString());
                FIHeader selectedHeader = Audit_Headers.Where(i => i.Id == HeaderId).First();

                //Audit selectedAudit = auditList.Where(i => i.Id == selAuditId).First();

                FIHeaderEdit frmHeaderEdit = new FIHeaderEdit(glAudit, selectedHeader);
                frmHeaderEdit.ShowDialog();

                if (frmHeaderEdit.success)
                {
                    Audit_Headers = SelectHeaders(glAudit.Id);

                    if (AdminAccess == false)
                    {
                        Audit_Headers = Audit_Headers.Where(i => i.IsDeleted == false).ToList();
                    }

                    FillHeadersDataGridView(dgvHeaders, Audit_Headers);
                }
            }
        }