예제 #1
0
 private void CreateNewProfileLine()
 {
     if (this.Parameters != null)
     {
         if (this.Parameters.Length.Equals(4))
         {
             SetStarsLevel1InfoBL.AddStarslevel1Info(this.Parameters[0], this.Parameters[1], ((ListItem)(cmbLineType.SelectedItem)).Value.ToString(), txtDescription.Text, Convert.ToDateTime(this.Parameters[2]), Convert.ToBoolean(this.Parameters[3]));
             SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, this.Parameters[1], string.Empty, DateTime.Now);
             ucProfileSearch.star1Info.Clear();
             ucProfileSearch.star1Info    = Star1stLevelInfoBL.GetStar1stLevelInfo(this.Parameters[0], this.Parameters[1]);
             frmProfiles._ucProfileSearch = null;
             LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_PROFILE_INFO_DISPLAY);
         }
         else if (this.Parameters.Length.Equals(5))
         {
             SetStarsLevel2InfoBL.AddStarsLevel2Info(this.Parameters[0], this.Parameters[1], this.Parameters[2], ((ListItem)(cmbLineType.SelectedItem)).Value.ToString(), txtDescription.Text, Convert.ToDateTime(this.Parameters[3]), Convert.ToBoolean(this.Parameters[4]));
             SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, this.Parameters[1], this.Parameters[2], DateTime.Now);
             ucProfileSearch.star1Info.Clear();
             ucProfileSearch.star2Info.Clear();
             ucProfileSearch.star1Info    = Star1stLevelInfoBL.GetStar1stLevelInfo(this.Parameters[0], this.Parameters[1]);
             ucProfileSearch.star2Info    = Star2ndLevelInfoBL.GetStar2ndLevelInfo(this.Parameters[0], this.Parameters[1], this.Parameters[2]);
             frmProfiles._ucProfileSearch = null;
             LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_PROFILE_INFO_DISPLAY);
         }
     }
 }
        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();
        }
예제 #3
0
 /// <summary>
 /// Renombra el nombre de la estrella
 /// </summary>
 private void RenameProfile()
 {
     if (this.Parameters != null)
     {
         if (this.Parameters.Length.Equals(2))
         {
             DialogResult result = MessageBox.Show(Resources.Profiles.Constants.SAVE_CHANGES, Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
             if (result.Equals(DialogResult.Yes))
             {
                 Update1stLevelBL.Update1stLevel(this.Parameters[0], this.Parameters[1], txtStar1name.Text, 0);
                 SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, this.Parameters[1], string.Empty, DateTime.Now);
                 CatAllStarsBL.ListAllStars.Clear();
                 ucProfileSearch.star1Info.Clear();
                 ucProfileSearch.star1Info    = Star1stLevelInfoBL.GetStar1stLevelInfo(this.Parameters[0], txtStar1name.Text);
                 frmProfiles._ucProfileSearch = null;
                 LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_PROFILE_INFO_DISPLAY);
             }
             else
             {
                 frmProfiles._ucProfileSearch = null;
                 LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES);
             }
         }
         else if (this.Parameters.Length.Equals(3))
         {
             DialogResult result = MessageBox.Show(Resources.Profiles.Constants.SAVE_CHANGES, Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
             if (result.Equals(DialogResult.Yes))
             {
                 //Update2ndLevelBL.Update2ndLevel(this.Parameters[0], this.Parameters[1], this.Parameters[2], txtStar2Name.Text);
                 SetProfileChangesBL.SetProfile(Login.PCC, Login.Agent, this.Parameters[1], this.Parameters[2], DateTime.Now);
                 CatAllStarsBL.ListAllStars.Clear();
                 ucProfileSearch.star1Info.Clear();
                 ucProfileSearch.star2Info.Clear();
                 ucProfileSearch.star1Info    = Star1stLevelInfoBL.GetStar1stLevelInfo(this.Parameters[0], this.Parameters[1]);
                 ucProfileSearch.star2Info    = Star2ndLevelInfoBL.GetStar2ndLevelInfo(this.Parameters[0], this.Parameters[1], txtStar2Name.Text);
                 frmProfiles._ucProfileSearch = null;
                 LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_PROFILE_INFO_DISPLAY);
             }
             else
             {
                 frmProfiles._ucProfileSearch = null;
                 LoaderProfiles.AddToPanel(LoaderProfiles.Zone.Modal_Profile, this, Resources.Profiles.Constants.UC_WELCOME_PROFILES);
             }
         }
     }
 }