Esempio n. 1
0
        private void btnAddNewAssignee_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.AppStarting;
            frmGridMultiSelect frm = new frmGridMultiSelect(APP_ENTITIES.EMPLOYEES, MODEL.SOURCE_ENTITY, MODEL.SOURCE_ENTITY_ID);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                foreach (MultiSelectListItem item in frm.SelectedItems)
                {
                    if (MODEL.listAssignees.Where(x => x.ID == item.ID).FirstOrDefault() == null)
                    {
                        MODEL.listAssignees.Add(item);
                    }
                }
                PopulateAssigneeGrid();
            }
            this.Cursor = Cursors.Default;
        }
Esempio n. 2
0
        private void btnSearchLead_Click(object sender, EventArgs e)
        {
            frmGridMultiSelect frm = new frmGridMultiSelect(APP_ENTITIES.SALES_LEAD_APPROVED_OPEN, APP_ENTITIES.none, 0);

            frm.SingleSelect = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                BindingList <MultiSelectListItem> selectedIDs = frm.SelectedItems;
                if (selectedIDs != null)
                {
                    if (selectedIDs.Count > 0)
                    {
                        selectedSalesLeadID = selectedIDs[0].ID;
                        PopulateSaleLead();
                    }
                }
            }
        }
Esempio n. 3
0
        private void btnSelectSalesEnquiries_Click(object sender, EventArgs e)
        {
            frmGridMultiSelect frm = new frmGridMultiSelect(APP_ENTITIES.SALES_ENQUIRY_APPROVED_OPEN);

            frm.SingleSelect = true;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                BindingList <MultiSelectListItem> selectedIDs = frm.SelectedItems;
                if (selectedIDs != null)
                {
                    if (selectedIDs.Count > 0)
                    {
                        this.Cursor            = Cursors.WaitCursor;
                        SelectedSalesEnquiryID = selectedIDs[0].ID;
                        PopulateSelectedSalesEnquiryInfo();
                        this.Cursor = Cursors.Default;
                    }
                }
            }
        }
Esempio n. 4
0
        private void btnSearchGeneratedBy_Click(object sender, EventArgs e)
        {
            frmGridMultiSelect frm = null;

            switch (_EnqGeneratedBy)
            {
            case "A":
                frm = new frmGridMultiSelect(APP_ENTITIES.AGENTS, APP_ENTITIES.none, 0);
                frm.SingleSelect = true;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    BindingList <MultiSelectListItem> selectedIDs = frm.SelectedItems;
                    if (selectedIDs != null)
                    {
                        this.GeneratorEmployeeID = 0;
                        this.GeneratorAgentID    = selectedIDs[0].ID;
                        txtGeneratdBy.Text       = _UNIT.PartiesService.GetPartyNameByPartyID(GeneratorAgentID);
                    }
                }
                break;

            case "E":
                frm = new frmGridMultiSelect(APP_ENTITIES.EMPLOYEES, APP_ENTITIES.none, 0);
                frm.SingleSelect = true;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    BindingList <MultiSelectListItem> selectedIDs = frm.SelectedItems;
                    if (selectedIDs != null)
                    {
                        this.GeneratorEmployeeID = selectedIDs[0].ID;
                        this.GeneratorAgentID    = 0;
                        txtGeneratdBy.Text       = ServiceEmployee.GetEmployeeNameByID(GeneratorEmployeeID);
                    }
                }
                break;
            }
        }
Esempio n. 5
0
        private void ReceipentSelectionLink_Clicked(object sender, EventArgs e)
        {
            try
            {
                SELECTED_ENTITY = (APP_ENTITIES)((KryptonLinkLabel)sender).Tag;
                frmGridMultiSelect frm = new frmGridMultiSelect(SELECTED_ENTITY, SOURCE_ENTITY, SOURCE_ENTITY_ID);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    BindingList <MultiSelectListItem> selectedIDs = frm.SelectedItems;

                    if (selectedIDs != null)
                    {
                        string strAddresses = string.Empty;
                        if (txtMailTo.Text.Trim() != string.Empty)
                        {
                            if (!txtMailTo.Text.Trim().EndsWith(";"))
                            {
                                txtMailTo.Text += ";";
                            }
                        }
                        switch (SELECTED_ENTITY)
                        {
                        case APP_ENTITIES.EMPLOYEES:
                            foreach (MultiSelectListItem item in selectedIDs)
                            {
                                TBL_MP_Master_Employee emp = _UNIT.AppDBContext.TBL_MP_Master_Employee.Where(x => x.PK_EmployeeId == item.ID).FirstOrDefault();
                                if (emp != null)
                                {
                                    if (emp.EmailAddress.Trim() != string.Empty)
                                    {
                                        if (!txtMailTo.Text.Contains(emp.EmailAddress))
                                        {
                                            txtMailTo.Text += emp.EmailAddress + ";";
                                        }
                                    }
                                }
                            }
                            break;

                        case APP_ENTITIES.CONTACTS:
                            foreach (MultiSelectListItem item in selectedIDs)
                            {
                                Tbl_MP_Master_PartyContact_Detail contact = _UNIT.AppDBContext.Tbl_MP_Master_PartyContact_Detail.Where(x => x.PK_PartyContactDetails == item.ID).FirstOrDefault();
                                if (contact != null)
                                {
                                    if (contact.EmailID.Trim() != string.Empty)
                                    {
                                        if (!txtMailTo.Text.Contains(contact.EmailID))
                                        {
                                            txtMailTo.Text += contact.EmailID + ";";
                                        }
                                    }
                                }
                            }
                            break;

                        case APP_ENTITIES.PARTIES:
                            foreach (MultiSelectListItem item in selectedIDs)
                            {
                                Tbl_MP_Master_Party party = _UNIT.AppDBContext.Tbl_MP_Master_Party.Where(x => x.PK_PartyId == item.ID).FirstOrDefault();
                                if (party != null)
                                {
                                    if (party.EmailID.Trim() != string.Empty)
                                    {
                                        if (!txtMailTo.Text.Contains(party.EmailID))
                                        {
                                            txtMailTo.Text += party.EmailID + ";";
                                        }
                                    }
                                }
                            }
                            break;

                        case APP_ENTITIES.ASSOCIATES_AND_CONTACTS:
                            foreach (MultiSelectListItem item in selectedIDs)
                            {
                                switch (item.EntityType)
                                {
                                case APP_ENTITIES.EMPLOYEES:
                                    TBL_MP_Master_Employee emp = _UNIT.AppDBContext.TBL_MP_Master_Employee.Where(x => x.PK_EmployeeId == item.ID).FirstOrDefault();
                                    if (emp != null)
                                    {
                                        if (emp.EmailAddress.Trim() != string.Empty)
                                        {
                                            if (!txtMailTo.Text.Contains(emp.EmailAddress))
                                            {
                                                txtMailTo.Text += emp.EmailAddress + ";";
                                            }
                                        }
                                    }
                                    break;

                                case APP_ENTITIES.PARTIES:
                                    Tbl_MP_Master_Party party = _UNIT.AppDBContext.Tbl_MP_Master_Party.Where(x => x.PK_PartyId == item.ID).FirstOrDefault();
                                    if (party != null)
                                    {
                                        if (party.EmailID.Trim() != string.Empty)
                                        {
                                            if (!txtMailTo.Text.Contains(party.EmailID))
                                            {
                                                txtMailTo.Text += party.EmailID + ";";
                                            }
                                        }
                                    }
                                    break;

                                case APP_ENTITIES.CONTACTS:
                                    Tbl_MP_Master_PartyContact_Detail contact = _UNIT.AppDBContext.Tbl_MP_Master_PartyContact_Detail.Where(x => x.PK_PartyContactDetails == item.ID).FirstOrDefault();
                                    if (contact != null)
                                    {
                                        if (contact.EmailID.Trim() != string.Empty)
                                        {
                                            if (!txtMailTo.Text.Contains(contact.EmailID))
                                            {
                                                txtMailTo.Text += contact.EmailID + ";";
                                            }
                                        }
                                    }
                                    break;
                                }
                            }
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "frmSendMail::ReceipentSelectionLink_Clicked");
            }
        }