Beispiel #1
0
        private void delSearchContact()
        {
            GV.MODE           = Mode.DeleteCustomer;
            btnDelete.Visible = true;
            List <FieldSearchModel> DelsearchTerms = new List <FieldSearchModel>();

            foreach (Control control in this.Controls)
            {
                if (control is TextBox & control.Text != "")
                {
                    FieldSearchModel model = new FieldSearchModel();
                    model.FieldName  = control.Tag.ToString();
                    model.FieldValue = control.Text;
                    DelsearchTerms.Add(model);
                    model = null;
                }
            }
            List <CustomerModel> customers = SearchOps.FieldSearchCI <CustomerModel>(DelsearchTerms, "tblCustContact",
                                                                                     true);
            frmMultiSelect delResultsForm = new frmMultiSelect();

            delResultsForm.CustomerData = customers;
            delResultsForm.CallingForm  = this;
            btnDelete.Visible           = true;
            delResultsForm.Show();
        }
Beispiel #2
0
        public FieldSearchModel GetFieldOptions
            (string GetFieldOptionsVal, string FormPublicId)
        {
            FieldSearchModel oReturn = new FieldSearchModel()
            {
                ProviderInfoType = new List <Customer.Models.Util.CatalogModel>(),
            };

            DocumentManagement.Customer.Models.Customer.CustomerModel oCustomerAux =
                DocumentManagement.Customer.Controller.Customer.CustomerGetByFormId(FormPublicId);

            List <DocumentManagement.Customer.Models.Util.CatalogModel> oItemsAux =
                DocumentManagement.Customer.Controller.Customer.CatalogGetCustomerOptions();

            oItemsAux.Where(cat => cat.CatalogId == 3).OrderBy(itm => itm.ItemName).All(itm =>
            {
                if (!oCustomerAux.RelatedForm.Any(f => f.RelatedStep.Any(s => s.RelatedField.Any(fi => fi.ProviderInfoType.ItemId == itm.ItemId))))
                {
                    oReturn.ProviderInfoType.Add(new Customer.Models.Util.CatalogModel()
                    {
                        ItemId   = itm.ItemId,
                        ItemName = itm.ItemName,
                    });
                }
                return(true);
            });

            return(oReturn);
        }
Beispiel #3
0
        public FieldSearchModel FieldSearch
            (string FieldSearchVal, string StepId)
        {
            FieldSearchModel oReturn = new FieldSearchModel();

            oReturn.RelatedField = DocumentManagement.Customer.Controller.Customer.FieldGetByStepId(Convert.ToInt32(StepId));

            return(oReturn);
        }
Beispiel #4
0
        private List <FieldSearchModel> collectSearchTerms()
        {
            List <FieldSearchModel> list  = new List <FieldSearchModel>();
            FieldSearchModel        model = new FieldSearchModel();

            foreach (Control ctl in this.Controls)
            {
                string   ctlname  = ctl.Name;
                string[] tagArray = null;
                if (ctl.Tag != null)
                {
                    tagArray = ctl.Tag.ToString().Split('|');
                }
                if (ctl.Text != "")
                {
                    switch (ctl?.GetType().Name)
                    {
                    case "DateTimePicker":
                        DateTimePicker   dtp = ctl as DateTimePicker;
                        FieldSearchModel fsm = new FieldSearchModel();
                        if (dtp.Format != DateTimePickerFormat.Custom)
                        {
                            fsm.FieldName  = tagArray[1];
                            fsm.FieldValue = dtp.Text;
                            list.Add(fsm);
                        }

                        break;

                    case "TextBox":
                    case "RichTextBox":
                        fsm            = new FieldSearchModel();
                        fsm.FieldName  = tagArray[1];
                        fsm.FieldValue = ctl.Text;
                        list.Add(fsm);

                        break;

                    case "ListBox":
                        switch (ctl.Name)
                        {
                        case "lstFE":
                            ListBox listBox = ctl as ListBox;
                            foreach (FE_Model fe in listBox.SelectedItems)
                            {
                                fsm = new FieldSearchModel();
                                FE_Model fE_Model = fe as FE_Model;
                                fsm.FieldName  = "FE_ListXML";
                                fsm.FieldValue = fE_Model.ID.ToString();
                                list.Add(fsm);
                            }
                            break;

                        case "lstTopics":
                            //    ListBox listBoxTopics = ctl as ListBox;
                            //    foreach (ProductModel prod in listBoxTopics.SelectedItems)
                            //    {
                            //        fsm = new FieldSearchModel();
                            //        ProductModel productModel = prod as ProductModel;
                            //        fsm.FieldName = "ProductListXML";
                            //        fsm.FieldValue = prod.ID.ToString();
                            //        list.Add(fsm);


                            break;

                        default:
                            break;
                        }
                        break;

                    case "ComboBox":
                        switch (ctl.Name)
                        {
                        case "cboMSO":
                        {
                            MSO_Model mso    = cboMSO.SelectedItem as MSO_Model;
                            int       mso_ID = mso.ID;
                            fsm            = new FieldSearchModel();
                            fsm.FieldName  = "MSO_ID";
                            fsm.FieldValue = mso_ID.ToString();
                            list.Add(fsm);
                        }
                        break;

                        case "cboActivity":
                        {
                            ActivityModel activity    = cboActivity.SelectedItem as ActivityModel;
                            int           activity_ID = activity.ID;
                            fsm            = new FieldSearchModel();
                            fsm.FieldName  = "Activity_ID";
                            fsm.FieldValue = activity_ID.ToString();
                            list.Add(fsm);
                        }
                        break;

                        case "cboRequestor":
                        {
                            RequestorModel requestor    = cboRequestor.SelectedItem as RequestorModel;
                            int            requestor_ID = requestor.ID;
                            fsm            = new FieldSearchModel();
                            fsm.FieldName  = "Requestor";
                            fsm.FieldValue = requestor_ID.ToString();
                            list.Add(fsm);
                        }
                        break;

                        default:
                            break;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            return(list);
        }