Example #1
0
        private void InitialControl()
        {
            //ประเภทบุคคล
            cmbCardType.DataSource     = CardTypeBiz.GetCardTypeList();
            cmbCardType.DataTextField  = "TextField";
            cmbCardType.DataValueField = "ValueField";
            cmbCardType.DataBind();
            cmbCardType.Items.Insert(0, new ListItem("", ""));

            //cmbCampaign.DataSource = SlmScr003Biz.GetAllActiveCampaignData();
            cmbCampaign.DataSource     = SlmScr003Biz.GetSaleAndBothCampaignData();
            cmbCampaign.DataTextField  = "TextField";
            cmbCampaign.DataValueField = "ValueField";
            cmbCampaign.DataBind();
            cmbCampaign.Items.Insert(0, new ListItem("", ""));

            //GetOwnerLead(cmbCampaign.SelectedItem.Value);

            cmbChannel.DataSource     = SlmScr003Biz.GetChannelData();
            cmbChannel.DataTextField  = "TextField";
            cmbChannel.DataValueField = "ValueField";
            cmbChannel.DataBind();
            cmbChannel.Items.Insert(0, new ListItem("", ""));

            //Owner Lead
            //cmbOwnerLeadSearch.DataSource = SlmScr003Biz.GetOwnerList(HttpContext.Current.User.Identity.Name);
            //cmbOwnerLeadSearch.DataTextField = "TextField";
            //cmbOwnerLeadSearch.DataValueField = "ValueField";
            //cmbOwnerLeadSearch.DataBind();
            //cmbOwnerLeadSearch.Items.Insert(0, new ListItem("", ""));

            var branchList = BranchBiz.GetBranchList(SLMConstant.Branch.All);

            //Owner Branch
            cmbOwnerBranchSearch.DataSource     = branchList;
            cmbOwnerBranchSearch.DataTextField  = "TextField";
            cmbOwnerBranchSearch.DataValueField = "ValueField";
            cmbOwnerBranchSearch.DataBind();
            cmbOwnerBranchSearch.Items.Insert(0, new ListItem("", ""));
            cmbOwnerLeadSearch.Items.Insert(0, new ListItem("", ""));
            //BindOwnerLead();

            //Delegate Branch
            cmbDelegateBranchSearch.DataSource     = branchList;
            cmbDelegateBranchSearch.DataTextField  = "TextField";
            cmbDelegateBranchSearch.DataValueField = "ValueField";
            cmbDelegateBranchSearch.DataBind();
            cmbDelegateBranchSearch.Items.Insert(0, new ListItem("", ""));
            cmbDelegateLeadSearch.Items.Insert(0, new ListItem("", ""));
            //BindDelegateLead();

            //CreateBy Branch
            cmbCreatebyBranchSearch.DataSource     = branchList;
            cmbCreatebyBranchSearch.DataTextField  = "TextField";
            cmbCreatebyBranchSearch.DataValueField = "ValueField";
            cmbCreatebyBranchSearch.DataBind();
            cmbCreatebyBranchSearch.Items.Insert(0, new ListItem("", ""));
            cmbCreatebySearch.Items.Insert(0, new ListItem("", ""));
            //BindCreateByLead();

            var             statusList = SlmScr003Biz.GetOptionList(AppConstant.OptionType.LeadStatus);
            ControlListData data       = statusList.Where(p => p.ValueField == "16").FirstOrDefault();

            if (data != null)
            {
                statusList.Remove(data);
            }

            cbOptionList.DataSource     = statusList;
            cbOptionList.DataTextField  = "TextField";
            cbOptionList.DataValueField = "ValueField";
            cbOptionList.DataBind();

            //ListItem lst = cbOptionList.Items.FindByValue("00");
            //if (lst != null) lst.Selected = true;
            //lst = cbOptionList.Items.FindByValue("01");
            //if (lst != null) lst.Selected = true;

            pcTop.SetVisible = false;
        }
Example #2
0
        private void InitialControl()
        {
            //ประเภทบุคคล
            cmbCardType.DataSource     = CardTypeBiz.GetCardTypeList();
            cmbCardType.DataTextField  = "TextField";
            cmbCardType.DataValueField = "ValueField";
            cmbCardType.DataBind();
            cmbCardType.Items.Insert(0, new ListItem("", ""));

            cmbCampaign.DataSource     = SlmScr003Biz.GetSaleAndBothCampaignData();
            cmbCampaign.DataTextField  = "TextField";
            cmbCampaign.DataValueField = "ValueField";
            cmbCampaign.DataBind();
            cmbCampaign.Items.Insert(0, new ListItem("", ""));

            cmbChannel.DataSource     = SlmScr003Biz.GetChannelData();
            cmbChannel.DataTextField  = "TextField";
            cmbChannel.DataValueField = "ValueField";
            cmbChannel.DataBind();
            cmbChannel.Items.Insert(0, new ListItem("", ""));

            var branchList = BranchBiz.GetBranchList(SLMConstant.Branch.All);

            //Owner Branch
            cmbOwnerBranchSearch.DataSource     = branchList;
            cmbOwnerBranchSearch.DataTextField  = "TextField";
            cmbOwnerBranchSearch.DataValueField = "ValueField";
            cmbOwnerBranchSearch.DataBind();
            cmbOwnerBranchSearch.Items.Insert(0, new ListItem("", ""));
            cmbOwnerLeadSearch.Items.Insert(0, new ListItem("", ""));

            //Delegate Branch
            cmbDelegateBranchSearch.DataSource     = branchList;
            cmbDelegateBranchSearch.DataTextField  = "TextField";
            cmbDelegateBranchSearch.DataValueField = "ValueField";
            cmbDelegateBranchSearch.DataBind();
            cmbDelegateBranchSearch.Items.Insert(0, new ListItem("", ""));
            cmbDelegateLeadSearch.Items.Insert(0, new ListItem("", ""));

            //CreateBy Branch
            cmbCreatebyBranchSearch.DataSource     = branchList;
            cmbCreatebyBranchSearch.DataTextField  = "TextField";
            cmbCreatebyBranchSearch.DataValueField = "ValueField";
            cmbCreatebyBranchSearch.DataBind();
            cmbCreatebyBranchSearch.Items.Insert(0, new ListItem("", ""));
            cmbCreatebySearch.Items.Insert(0, new ListItem("", ""));

            var             statusList = SlmScr003Biz.GetOptionList(AppConstant.OptionType.LeadStatus);
            ControlListData data       = statusList.Where(p => p.ValueField == "16").FirstOrDefault();

            if (data != null)
            {
                statusList.Remove(data);
            }

            cbOptionList.DataSource     = statusList;
            cbOptionList.DataTextField  = "TextField";
            cbOptionList.DataValueField = "ValueField";
            cbOptionList.DataBind();

            pcTop.SetVisible = false;
        }