private void btnOK_Click(object sender, System.EventArgs e)
        {
            InputResponse = this.txtInput.Text;
            Parameter pass = ParameterBL.GetParameterValue("PasswordProfilesDelete");

            if (InputResponse.Equals(pass.Values))
            {
                if (!string.IsNullOrEmpty(firstStarName) && string.IsNullOrEmpty(secondStarName))
                {
                    DialogResult result = MessageBox.Show(string.Format("¿DESEAS BORRAR LA ESTRELLA DE PRIMER NIVEL {0}?", firstStarName), Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (result.Equals(DialogResult.Yes))
                    {
                        Delete1stLevelBL.Delete1stLevel(pcc, firstStarName);
                        //Active1stLevelBL.Active1stLevel(pcc, firstStarName);
                        SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, firstStarName, string.Empty, DateTime.Now);
                        CatAllStarsBL.ListAllStars.Clear();
                        LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES);
                    }
                }
                else if (!string.IsNullOrEmpty(firstStarName) && !string.IsNullOrEmpty(secondStarName))
                {
                    DialogResult result = MessageBox.Show(string.Format("¿DESEAS BORRAR LA ESTRELLA DE SEGUNDO NIVEL {0}?", secondStarName), Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (result.Equals(DialogResult.Yes))
                    {
                        Delete2ndLevelBL.Delete2ndLevel(secondStarName);
                        //Active2ndLevelBL.Active2ndLevel(pcc, firstStarName, secondStarName);
                        SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, firstStarName, secondStarName, DateTime.Now);
                        bool noSecondStar             = true;
                        List <CatAllStars> Star2Count = CatAllStarsBL.GetAll2ndStarDetailed_Profile(ucProfileSearch.star1Info[0].Pccid, ucProfileSearch.star1Info[0].Level1, Login.OrgId);
                        if (Star2Count != null)
                        {
                            foreach (CatAllStars item in Star2Count)
                            {
                                if (item.Active)
                                {
                                    noSecondStar = false;
                                    break;
                                }
                            }
                        }
                        if (noSecondStar)
                        {
                            Update1stLevelBL.Update1stLevel(pcc, firstStarName, string.Empty, 2);
                        }
                        LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES);
                    }
                }
            }
            else
            {
                MessageBox.Show(Resources.Profiles.Constants.PASSWORD_ERROR, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            this.Close();
        }
Пример #2
0
 //Evento Load
 private void ucSearchProfileDetailed_Load(object sender, EventArgs e)
 {
     ucAvailability.IsInterJetProcess = false;
     CatAllStarsBL.ListAllStars.Clear();
     CatAllStarsBL.GetElements(ref CatAllStarsBL.ListAllStars, Login.OrgId);
     if (frmProfiles.IsReservationFlow)
     {
         this.Height = 545;
     }
     txtPCC.Focus();
 }
        /// <summary>
        /// Carga el resultado de la busqueda de perfil en el listview
        /// </summary>
        public int LoadProfileSearchResult(string strToSearch, string sTipoBusqueda, Boolean refresh)
        {
            listViewProfiles.Items.Clear();
            listViewProfiles.Enabled = true;
            StarsList = CatAllStarsBL.GetAllStars(Login.OrgId, strToSearch, sTipoBusqueda);

            int starsCount = StarsList.Count;

            if (starsCount > 0)
            {
                listViewProfiles.View = View.Details;
                for (int i = 0; i < starsCount; i++)
                {
                    if (StarsList[i].Active)
                    {
                        var itemStar = new ListViewItem(StarsList[i].ToString(), (StarsList[i].Level.Equals(Resources.Profiles.Constants.STAR_LEVEL_ONE)) ? 0 : 1);
                        //itemStar.ToolTipText = StarsList[i].Star1Ref;
                        itemStar.SubItems.Add(StarsList[i].Level);
                        itemStar.SubItems.Add(StarsList[i].Star1Ref);
                        itemStar.SubItems.Add(StarsList[i].Email);
                        listViewProfiles.Items.Add(itemStar);
                    }
                }
                return(starsCount);
            }
            else
            {
                try
                {
                    var itemStar = new ListViewItem(string.Concat(Resources.Profiles.Constants.NO_RESULTS_FOR, " ", strToSearch));
                    itemStar.SubItems.Add("");
                    listViewProfiles.Items.Add(itemStar);
                    listViewProfiles.Columns[0].Width = 250;
                    listViewProfiles.Enabled          = false;
                }
                catch (Exception ex)
                {
                    new EventsManager.EventsManager(ex, EventsManager.EventsManager.OrigenError.BaseDeDatos);
                }
            }

            return(0);
        }
Пример #4
0
        /// <summary>
        /// Carga el resultado de la busqueda de perfil en el listview
        /// </summary>
        private void LoadProfileSearchResult()
        {
            listViewProfiles.Items.Clear();
            listViewProfiles.Enabled = true;

            listViewProfiles.LargeImageList = imageProfileList;
            listViewProfiles.SmallImageList = imageProfileList;
            StarsList = CatAllStarsBL.GetAllStarsDetailed_Profile(txtPCC.Text, txtStar1name.Text, txtStar2Name.Text, Login.OrgId);
            if (StarsList.Count != 0)
            {
                listViewProfiles.View = View.Details;
                for (int i = 0; i < StarsList.Count; i++)
                {
                    if (StarsList[i].Active)
                    {
                        if (StarsList[i].Level.Equals(Resources.Profiles.Constants.STAR_LEVEL_ONE))
                        {
                            ListViewItem itemStar = new ListViewItem(string.Concat(StarsList[i].StarName, " ", StarsList[i].PccId), 0);
                            itemStar.SubItems.Add(StarsList[i].Level);
                            listViewProfiles.Items.Add(itemStar);
                        }
                        else
                        {
                            ListViewItem itemStar = new ListViewItem(string.Concat(StarsList[i].StarName, " ", StarsList[i].PccId), 1);
                            itemStar.SubItems.Add(StarsList[i].Level);
                            listViewProfiles.Items.Add(itemStar);
                        }
                    }
                }
            }
            else
            {
                ListViewItem itemStar = new ListViewItem(Resources.Profiles.Constants.NO_RESULTS_TRY_AGAIN);
                itemStar.SubItems.Add("");
                listViewProfiles.Items.Add(itemStar);
                listViewProfiles.Enabled = false;
            }
        }