Ejemplo n.º 1
0
    private bool DoesNameExist(string name)
    {
        name = name.Trim().ToLower();
        SlaLevels levels = new SlaLevels(UserSession.LoginUser);

        levels.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);
        if (_slaLevelID > -1)
        {
            SlaLevel current = SlaLevels.GetSlaLevel(UserSession.LoginUser, _slaLevelID);
            if (current.Name.Trim().ToLower() == name)
            {
                return(false);
            }
        }



        foreach (SlaLevel level in levels)
        {
            if (level.Name.Trim().ToLower() == name)
            {
                return(true);
            }
        }

        return(false);
    }
Ejemplo n.º 2
0
    private void LoadSlas()
    {
        SlaLevels levels = new SlaLevels(UserSession.LoginUser);

        levels.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);

        cmbSlas.Items.Clear();
        cmbSlas.Items.Add(new RadComboBoxItem("Unassigned", "-1"));
        foreach (SlaLevel level in levels)
        {
            cmbSlas.Items.Add(new RadComboBoxItem(level.Name, level.SlaLevelID.ToString()));
        }
        cmbSlas.SelectedIndex = 0;
    }
Ejemplo n.º 3
0
        public static string GetSlaLevels(RestCommand command)
        {
            SlaLevels slaLevels = new SlaLevels(command.LoginUser);

            slaLevels.LoadByOrganizationID(command.Organization.OrganizationID);

            if (command.Format == RestFormat.XML)
            {
                return(slaLevels.GetXml("SlaLevels", "SlaLevel", true, command.Filters));
            }
            else
            {
                throw new RestException(HttpStatusCode.BadRequest, "Invalid data format");
            }
        }
Ejemplo n.º 4
0
    private void LoadLevels()
    {
        cmbLevels.Items.Clear();
        SlaLevels levels = new SlaLevels(UserSession.LoginUser);

        levels.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);

        foreach (SlaLevel level in levels)
        {
            cmbLevels.Items.Add(new RadComboBoxItem(level.Name, level.SlaLevelID.ToString()));
        }
        if (cmbLevels.Items.Count > 0)
        {
            cmbLevels.SelectedIndex = 0;
        }
    }
Ejemplo n.º 5
0
    public static RadComboBoxItemData[] GetComboLevels()
    {
        SlaLevels levels = new SlaLevels(UserSession.LoginUser);

        levels.LoadByOrganizationID(UserSession.LoginUser.OrganizationID);

        List <RadComboBoxItemData> data = new List <RadComboBoxItemData>();

        foreach (SlaLevel level in levels)
        {
            RadComboBoxItemData item = new RadComboBoxItemData();
            item.Text  = level.Name;
            item.Value = level.SlaLevelID.ToString();
            data.Add(item);
        }

        return(data.ToArray());
    }