public int GetLevel2EscalationTimeInMins(int slaid)
    {
        int varDays   = 0;
        int varHours  = 0;
        int VarMins   = 0;
        int TotalMins = 0;

        objLevel2 = objLevel2.Get_By_Slaid(slaid);
        if (objLevel2.Slaid != 0)
        {
            varDays   = objLevel2.Days;
            varHours  = objLevel2.Hours;
            VarMins   = objLevel2.Min;
            TotalMins = (varDays * 24 * 60) + (varHours * 60) + VarMins;
        }

        return(TotalMins);
    }
    protected void Level2Escalate()
    {
        int Slaid = Convert.ToInt32(Request.QueryString[0]);

        objLevel2 = objLevel2.Get_By_Slaid(Slaid);
        if (objLevel2.Slaid != 0)
        {
            string   varEmail = objLevel2.Emailid;
            string[] arrEmail = varEmail.Split(',');
            if (arrEmail.Length > 2)
            {
                selectLevale2.Text = objLevel2.Emailid;
            }
            else
            {
                selectLevale2.Text = arrEmail[0].ToString();
            }
            chkLevel2.Checked = true;
            if (objLevel2.Before == true)
            {
                radio1Level2.Checked = true;
            }
            else
            {
                radio2Level2.Checked = true;
            }
            txtDaysLevel2.Text           = Convert.ToString(objLevel2.Days);
            drpHoursLevel2.SelectedIndex = objLevel2.Hours;
            drpMinLevel2.SelectedIndex   = objLevel2.Min;
        }
        else
        {
            selectLevale2.Visible = false;
            listLevel2.Visible    = true;
            radio1Level2.Checked  = true;
        }
    }
    protected void UpdateLevel2Escalate(int Slaid)
    {
        EscalateLevel2 obj      = new EscalateLevel2();
        string         varemail = "";

        if (radio1Level2.Checked == true)
        {
            objLevel2.After  = false;
            objLevel2.Before = true;
        }
        else
        {
            objLevel2.After  = true;
            objLevel2.Before = false;
        }
        objLevel2.Slaid = Slaid;
        for (int i = listLevel2.Items.Count - 1; i >= 0; i--)
        {
            if (listLevel2.Items[i].Selected == true)
            {
                varemail = varemail + listLevel2.Items[i].Text + ",";
            }
        }
        objLevel2.Days  = Convert.ToInt32(txtDaysLevel2.Text);
        objLevel2.Hours = Convert.ToInt32(drpHoursLevel2.SelectedValue);
        objLevel2.Min   = Convert.ToInt32(drpMinLevel2.SelectedValue);
        obj             = obj.Get_By_Slaid(Slaid);
        if (obj.Slaid != 0)
        {
            if (varemail == "")
            {
                varemail = obj.Emailid;
            }
            objLevel2.Emailid  = varemail;
            objLevel2.Level2id = obj.Level2id;
            objLevel2.Update();
        }
        else
        {
            objLevel2.Emailid = varemail;
            objLevel2.Insert();
        }
    }
 protected void UpdateLevel2Escalate(int Slaid)
 {
     EscalateLevel2 obj = new EscalateLevel2();
     string varemail = "";
     if (radio1Level2.Checked == true)
     {
         objLevel2.After = false;
         objLevel2.Before = true;
     }
     else
     {
         objLevel2.After = true;
         objLevel2.Before = false;
     }
     objLevel2.Slaid = Slaid;
     for (int i = listLevel2.Items.Count - 1; i >= 0; i--)
     {
         if (listLevel2.Items[i].Selected == true)
         {
             varemail = varemail + listLevel2.Items[i].Text + ",";
         }
     }
     objLevel2.Days = Convert.ToInt32(txtDaysLevel2.Text);
     objLevel2.Hours = Convert.ToInt32(drpHoursLevel2.SelectedValue);
     objLevel2.Min = Convert.ToInt32(drpMinLevel2.SelectedValue);
     obj = obj.Get_By_Slaid(Slaid);
     if (obj.Slaid != 0)
     {
         if (varemail == "")
         {
             varemail = obj.Emailid;
         }
         objLevel2.Emailid = varemail;
         objLevel2.Level2id = obj.Level2id;
         objLevel2.Update();
     }
     else
     {
         objLevel2.Emailid = varemail;
         objLevel2.Insert();
     }
 }