Beispiel #1
0
        private void SetOwnerBranchAccessRight()
        {
            try
            {
                List <BranchData> branch = new List <BranchData>();
                if (cmbCampaignId.SelectedItem.Value == "")
                {
                    txtOwnerBranchBefore.Text = "";
                    txtOwnerLeadBefore.Text   = "";
                    //Owner Branch
                    //SetComboOwnerBranch();
                    AppUtil.BuildCombo(cmbOwnerBranch, BranchBiz.GetBranchList(SLMConstant.Branch.Active));

                    cmbOwnerBranch.SelectedIndex = cmbOwnerBranch.Items.IndexOf(cmbOwnerBranch.Items.FindByValue(txtOwnerBranchBefore.Text.Trim()));
                    cmbOwnerBranchSelectedIndexChanged();
                    cmbOwner.SelectedIndex = cmbOwner.Items.IndexOf(cmbOwner.Items.FindByValue(txtOwnerLeadBefore.Text.Trim()));
                }
                else
                {
                    SetComboOwnerBranch();

                    if (SlmScr010Biz.CheckStaffAccessRightExist(cmbCampaignId.SelectedItem.Value, txtOwnerBranchBefore.Text.Trim(), txtOwnerLeadBefore.Text.Trim()))
                    {
                        if (cmbOwnerBranch.Items.Count > 1)
                        {
                            if (txtOwnerBranchBefore.Text.Trim() != "")
                            {
                                cmbOwnerBranch.SelectedIndex = cmbOwnerBranch.Items.IndexOf(cmbOwnerBranch.Items.FindByValue(txtOwnerBranchBefore.Text.Trim()));
                            }
                            else
                            {
                                cmbOwnerBranch.SelectedIndex = -1;
                            }
                        }
                        cmbOwnerBranchSelectedIndexChanged();
                        cmbOwner.SelectedIndex = cmbOwner.Items.IndexOf(cmbOwner.Items.FindByValue(txtOwnerLeadBefore.Text.Trim()));
                    }
                    else
                    {
                        cmbOwnerBranchSelectedIndexChanged();
                        txtOwnerBranchBefore.Text = "";
                        txtOwnerLeadBefore.Text   = "";
                    }
                }
            }
            catch
            {
                throw;
            }
        }