Beispiel #1
0
        private void SetAvailableStatusForEdit(string productId, string leadStatus, string rightAdd)
        {
            try
            {
                var list = ActivityConfigBiz.SearchActivityConfig(productId, leadStatus, rightAdd, "");
                List <ControlListData> selectedList = list.Where(p => !string.IsNullOrEmpty(p.LeadAvailableStatusCode) && !string.IsNullOrEmpty(p.LeadAvailableStatusDesc)).Select(p => new ControlListData {
                    TextField = p.LeadAvailableStatusDesc, ValueField = p.LeadAvailableStatusCode
                }).OrderBy(p => p.TextField).ToList();
                BindListBox(lboxLeadStatusSelected, selectedList);

                List <ControlListData> allAvailableStatusList = OptionBiz.GetOptionListForActivityConfig(AppConstant.OptionType.LeadStatus).OrderBy(p => p.TextField).ToList();
                foreach (ControlListData data in selectedList)
                {
                    ControlListData obj = allAvailableStatusList.Where(p => p.ValueField == data.ValueField).FirstOrDefault();
                    if (obj != null)
                    {
                        allAvailableStatusList.Remove(obj);
                    }
                }

                BindListBox(lboxLeadStatusAll, allAvailableStatusList);

                lblLeadStatusAllTotal.Text      = lboxLeadStatusAll.Items.Count.ToString();
                lblLeadStatusSelectedTotal.Text = lboxLeadStatusSelected.Items.Count.ToString();
            }
            catch
            {
                throw;
            }
        }
Beispiel #2
0
        private void InitialControl()
        {
            //Search
            cmbProductSearch.DataSource     = ProductBiz.GetProductList();
            cmbProductSearch.DataTextField  = "TextField";
            cmbProductSearch.DataValueField = "ValueField";
            cmbProductSearch.DataBind();
            cmbProductSearch.Items.Insert(0, new ListItem("", ""));

            cmbLeadStatusSearch.DataSource     = OptionBiz.GetOptionListForActivityConfig(AppConstant.OptionType.LeadStatus);
            cmbLeadStatusSearch.DataTextField  = "TextField";
            cmbLeadStatusSearch.DataValueField = "ValueField";
            cmbLeadStatusSearch.DataBind();
            cmbLeadStatusSearch.Items.Insert(0, new ListItem("", ""));

            cmbLeadStatusAvailableSearch.DataSource     = OptionBiz.GetOptionListForActivityConfig(AppConstant.OptionType.LeadStatus);
            cmbLeadStatusAvailableSearch.DataTextField  = "TextField";
            cmbLeadStatusAvailableSearch.DataValueField = "ValueField";
            cmbLeadStatusAvailableSearch.DataBind();
            cmbLeadStatusAvailableSearch.Items.Insert(0, new ListItem("", ""));

            //Popup
            cmbProductPopup.DataSource     = ProductBiz.GetProductList();
            cmbProductPopup.DataTextField  = "TextField";
            cmbProductPopup.DataValueField = "ValueField";
            cmbProductPopup.DataBind();
            cmbProductPopup.Items.Insert(0, new ListItem("", ""));

            cmbLeadStatusPopup.DataSource     = OptionBiz.GetOptionListForActivityConfig(AppConstant.OptionType.LeadStatus);
            cmbLeadStatusPopup.DataTextField  = "TextField";
            cmbLeadStatusPopup.DataValueField = "ValueField";
            cmbLeadStatusPopup.DataBind();
            cmbLeadStatusPopup.Items.Insert(0, new ListItem("", ""));
        }
Beispiel #3
0
        protected void btnAddCondition_Click(object sender, EventArgs e)
        {
            try
            {
                BindProductNew();
                cbEdit.Checked = false;
                cmbProductPopup.SelectedIndex       = -1;
                cmbLeadStatusPopup.SelectedIndex    = -1;
                cmbActivityRightPopup.SelectedIndex = -1;

                cmbProductPopup.Enabled       = true;
                cmbLeadStatusPopup.Enabled    = true;
                cmbActivityRightPopup.Enabled = true;

                lboxLeadStatusAll.Enabled      = false;
                lboxLeadStatusSelected.Enabled = false;
                btnSelectAll.Enabled           = false;
                btnSelect.Enabled      = false;
                btnDeselect.Enabled    = false;
                btnDeselectAll.Enabled = false;

                BindListBox(lboxLeadStatusAll, OptionBiz.GetOptionListForActivityConfig(AppConstant.OptionType.LeadStatus).OrderBy(p => p.TextField).ToList());
                lblLeadStatusAllTotal.Text = lboxLeadStatusAll.Items.Count.ToString();

                lboxLeadStatusSelected.Items.Clear();
                lblLeadStatusSelectedTotal.Text = lboxLeadStatusSelected.Items.Count.ToString();

                upPopup.Update();
                mpePopup.Show();
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }