Example #1
0
        private void dgvOverview_DoubleClick(object sender, EventArgs e)
        {
            if (dgvOverview.SelectedRows == null)
            {
                return;
            }

            string category = dgvOverview.SelectedRows[0].Cells[3].Value.ToString().Trim();
            string approval = dgvOverview.SelectedRows[0].Cells[10].Value.ToString();

            /*if (approval != "Approve" && category != "IT技術支援" && category != "IT意見箱")
             * {
             *  MessageBox.Show("Form is not approved.");
             *  return;
             * }*/

            GlobalService.FormList = new List <FormList>();

            GlobalService.ChaseNo = dgvOverview.SelectedRows[0].Cells[1].Value.ToString();
            GlobalService.Creator = dgvOverview.SelectedRows[0].Cells[5].Value.ToString();

            if (category.StartsWith("R3"))
            {
                FormR3 form = new FormR3(GlobalService.ChaseNo);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    LoadData(_mode);
                }
            }
            else
            {
                FormITUsage2 form = new FormITUsage2(GlobalService.ChaseNo);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    LoadData(_mode);
                }
            }

            /*FormApplication form = new FormApplication(GlobalService.ChaseNo);
             * form.ShowDialog();
             *
             * if (GlobalService.FormList.Count > 0)
             * {
             *  FormITUsage ituse = new FormITUsage(GlobalService.FormList);
             *  if (ituse.ShowDialog() == DialogResult.OK)
             *  {
             *
             *  }
             * }*/
        }
Example #2
0
        private void dgvForm_DoubleClick(object sender, EventArgs e)
        {
            if (dgvForm.SelectedRows == null)
            {
                return;
            }

            try
            {
                string status  = dgvForm.SelectedRows[0].Cells[0].Value.ToString().Trim();
                string type    = dgvForm.SelectedRows[0].Cells[1].Value.ToString().Trim();
                string chaseno = dgvForm.SelectedRows[0].Cells[6].Value.ToString().Trim();

                if (type.StartsWith("R3"))
                {
                    FormR3 formR3 = new FormR3(chaseno);
                    if (formR3.ShowDialog() == DialogResult.OK)
                    {
                        LoadData();
                    }
                }
                else if (type.ToLower().StartsWith("debit") || type.ToLower().StartsWith("credit"))
                {
                    DebitNoteForm2 formDebit = new DebitNoteForm2(type.ToLower(), "view", chaseno);
                    //DebitCreditNoteFormView2 formDebit = new DebitCreditNoteFormView2(chaseno, "view");
                    if (formDebit.ShowDialog() == DialogResult.OK)
                    {
                        LoadData();
                    }
                }
                else if (type.StartsWith("Outstanding"))
                {
                    OutstandingViewForm formOutstanding = new OutstandingViewForm(chaseno);
                    if (formOutstanding.ShowDialog() == DialogResult.OK)
                    {
                        LoadData();
                    }
                }
                else
                {
                    FormITApplication form = new FormITApplication("view", type, chaseno, status);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        LoadData();
                    }
                }
            }
            catch { }
        }
Example #3
0
        private void dgvFormHistory_DoubleClick(object sender, EventArgs e)
        {
            if (dgvFormHistory.SelectedRows == null)
            {
                return;
            }

            string type    = dgvFormHistory.SelectedRows[0].Cells[1].Value.ToString();
            string chaseno = dgvFormHistory.SelectedRows[0].Cells[7].Value.ToString();

            if (type == "IT技術支援")
            {
                FormSupport form = new FormSupport(chaseno);
                form.ShowDialog();
            }

            if (type == "IT意見箱")
            {
                FormComment form = new FormComment(chaseno);
                form.ShowDialog();
            }

            if (type == "權限關連及軟件安裝")
            {
                FormPermission form = new FormPermission(chaseno);
                form.ShowDialog();
            }

            if (type == "工具開發/修改")
            {
            }

            if (type == "資產外借")
            {
            }

            if (type == "R3申請")
            {
                FormR3 form = new FormR3(chaseno);
                form.ShowDialog();
            }

            if (type.ToLower().StartsWith("debit") || type.ToLower().StartsWith("credit"))
            {
                DebitNoteForm2 formDebit = new DebitNoteForm2(type.ToLower(), "view", chaseno);
                //DebitCreditNoteFormView2 formDebit = new DebitCreditNoteFormView2(chaseno, "view");
                if (formDebit.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                }
            }

            if (type.StartsWith("Outstanding"))
            {
                OutstandingViewForm formOutstanding = new OutstandingViewForm(chaseno);
                if (formOutstanding.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                }
            }
        }