Example #1
0
        private void button8_Click(object sender, EventArgs e)
        {
            frmEnquiryViewContactInformation frm = new frmEnquiryViewContactInformation();

            frm.ShowDialog();
        }
Example #2
0
        private void dgvNewEnquiryCurrent_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //toolStrip1 catch which of the options where selected
            switch (e.ColumnIndex)
            {
            //Accept the Enquiry
            case 1:
                frmEnquiryViewContactInformation frm = new frmEnquiryViewContactInformation();
                frm.CurrentEnquiry = (Data.Models.Enquiry)NewEnquiryWorkbench_NewEnquiryBindingSource.Current;
                frm.ShowDialog();
                break;

            //Close the Equiry
            case 2:

                frmSendEmail         frm1 = new frmSendEmail();
                Data.Models.Enquiry  CurrentEnquiryObj = (Data.Models.Enquiry)NewEnquiryWorkbench_NewEnquiryBindingSource.Current;
                List <ContactDetail> you = (from a in CurrentEnquiryObj.Individuals
                                            from b in a.ContactDetails
                                            where b.ContactTypeID == (int)Common.Enum.EnumContactTypes.Email_Address
                                            select b).ToList <ContactDetail>();

                //Sets the Email Address For the Currently Selected Contact For this Enquiry
                foreach (ContactDetail ConDetObj in you)
                {
                    if (frm1.txtTestingToAddress.Text.Length > 0)
                    {
                        frm1.txtTestingToAddress.Text += ";";
                    }
                    frm1.txtTestingToAddress.Text += ConDetObj.ContactDetailValue;
                }



                using (var Dbconnection = new MCDEntities())
                {
                    List <MessageTemplate> MT = (from a in Dbconnection.MessageTemplates
                                                 from b in a.Files
                                                 where a.ProcessStepID == (int)EnumProcessSteps.Enquiry__Apprenticeship__Step_1__Documentation_To_Send
                                                 select a).ToList <MessageTemplate>();

                    MessageTemplate CurrentMessageTemplate = MT.FirstOrDefault <MessageTemplate>();
                    frm1.txtTestMessage.Text = CurrentMessageTemplate.Message;
                    foreach (MessageTemplate MTObj in MT)
                    {
                        foreach (Data.Models.File FileObj in MTObj.Files)
                        {
                            frm1.AttachmentsUsingDbImageFileID.Add(FileObj.FileID);
                        }
                    }
                };
                frm1.ShowDialog();
                break;

            //SEnd Email Message
            case 3:
                break;

            //View Enquiry History
            case 4:
                break;
            }
        }