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; } }
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("", "")); }
private void InitialControl() { AppUtil.SetIntTextBox(txtSlaMinPopup); AppUtil.SetIntTextBox(txtSlaTimePopup); AppUtil.SetIntTextBox(txtSlaDayPopup); txtSlaMinPopup.Attributes.Add("OnBlur", "ChkIntOnBlurClear(this)"); txtSlaTimePopup.Attributes.Add("OnBlur", "ChkIntOnBlurClear(this)"); txtSlaDayPopup.Attributes.Add("OnBlur", "ChkIntOnBlurClear(this)"); //Search // cmbProductSearch.DataSource = ProductBiz.GetProductList(); cmbProductSearch.DataSource = ProductBiz.GetProductListNew(); cmbProductSearch.DataTextField = "TextField"; cmbProductSearch.DataValueField = "ValueField"; cmbProductSearch.DataBind(); cmbProductSearch.Items.Insert(0, new ListItem("", "")); cmbProductSearch.Items.Insert(1, new ListItem("DEFAULT", "DEFAULT")); //cmbCampaignSearch.DataSource = CampaignBiz.GetCampaignList(""); cmbCampaignSearch.DataSource = CampaignBiz.GetCampaignListNew(""); cmbCampaignSearch.DataTextField = "TextField"; cmbCampaignSearch.DataValueField = "ValueField"; cmbCampaignSearch.DataBind(); cmbCampaignSearch.Items.Insert(0, new ListItem("", "")); cmbCampaignSearch.Items.Insert(1, new ListItem("DEFAULT", "DEFAULT")); cmbChannelSearch.DataSource = ChannelBiz.GetChannelList(); cmbChannelSearch.DataTextField = "TextField"; cmbChannelSearch.DataValueField = "ValueField"; cmbChannelSearch.DataBind(); cmbChannelSearch.Items.Insert(0, new ListItem("", "")); cmbStatusSearch.DataSource = OptionBiz.GetOptionList(AppConstant.OptionType.LeadStatus); cmbStatusSearch.DataTextField = "TextField"; cmbStatusSearch.DataValueField = "ValueField"; cmbStatusSearch.DataBind(); cmbStatusSearch.Items.Insert(0, new ListItem("", "")); //Popup BindPopupProductCampaignCombo("load"); cmbChannelPopup.DataSource = ChannelBiz.GetChannelList(); cmbChannelPopup.DataTextField = "TextField"; cmbChannelPopup.DataValueField = "ValueField"; cmbChannelPopup.DataBind(); cmbChannelPopup.Items.Insert(0, new ListItem("", "")); cmbStatusPopup.DataSource = OptionBiz.GetOptionList(AppConstant.OptionType.LeadStatus); cmbStatusPopup.DataTextField = "TextField"; cmbStatusPopup.DataValueField = "ValueField"; cmbStatusPopup.DataBind(); cmbStatusPopup.Items.Insert(0, new ListItem("", "")); }
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); } }
private void InitialDropdownlist(LeadDataPhoneCallHistory data) { try { //ประเภทบุคคล cmbCardType.DataSource = CardTypeBiz.GetCardTypeList(); cmbCardType.DataTextField = "TextField"; cmbCardType.DataValueField = "ValueField"; cmbCardType.DataBind(); cmbCardType.Items.Insert(0, new ListItem("", "")); cmbOwnerBranch.DataSource = SlmScr010Biz.GetBranchListByAccessRight(SLMConstant.Branch.Active, data.CampaignId); cmbOwnerBranch.DataTextField = "TextField"; cmbOwnerBranch.DataValueField = "ValueField"; cmbOwnerBranch.DataBind(); cmbOwnerBranch.Items.Insert(0, new ListItem("", "")); cmbOwnerBranchSelectedIndexChanged(); //Do not remove cmbDelegateBranch.DataSource = SlmScr010Biz.GetBranchListByAccessRight(SLMConstant.Branch.Active, data.CampaignId); cmbDelegateBranch.DataTextField = "TextField"; cmbDelegateBranch.DataValueField = "ValueField"; cmbDelegateBranch.DataBind(); cmbDelegateBranch.Items.Insert(0, new ListItem("", "")); cmbDelegateBranchSelectedIndexChanged(); //Do not remove //Status cmbLeadStatus.DataSource = OptionBiz.GetStatusListByActivityConfig(data.ProductId, data.LeadStatus); cmbLeadStatus.DataTextField = "TextField"; cmbLeadStatus.DataValueField = "ValueField"; cmbLeadStatus.DataBind(); } catch (Exception ex) { throw ex; } }