protected void Bindgrid()
 {
     string complaintid = txtticket.Text ;
     objCalls = objCalls.Get_By_id(complaintid);
     colCalls.Add(objCalls);
     grdvwRequest.DataSource = colCalls;
     grdvwRequest.DataBind();
 }
    protected void Bindgrid()
    {
        string complaintid = txtticket.Text;

        objCalls = objCalls.Get_By_id(complaintid);
        colCalls.Add(objCalls);
        grdvwRequest.DataSource = colCalls;
        grdvwRequest.DataBind();
    }
    public object Generatecsm_callsObject(ref IDataReader returnData)
    {
        csm_calls obj = new csm_calls();
        while (returnData.Read())
        {
            obj.Customername = (string)returnData["Customer Name"];
            obj.User = (string)returnData["User"];
            if (returnData["Start Time"] != DBNull.Value)
            {
                DateTime Mydatetime = new DateTime();
                Mydatetime = (DateTime)returnData["Start Time"];
                obj.StartTime = Mydatetime.ToString();
            }
            if (returnData["Start Date"] != DBNull.Value)
            {
                DateTime Mydatetime1 = new DateTime();
                Mydatetime1 = (DateTime)returnData["Start Date"];
                obj.StartDate = Mydatetime1.ToString();
            }

            if (returnData["SLA Type"] != DBNull.Value)
            {
                obj.SLAType = (string)returnData["SLA Type"];
            }
            if (returnData["Severity Level"] != DBNull.Value)
            {
                obj.Severitylevel = (string)returnData["Severity Level"];
            }
            if (returnData["Response Time in Minutes"] != DBNull.Value)
            {
                obj.Responsetimeinminutes = (string)returnData["Response Time in Minutes"];
            }
            if (returnData["Resolution Time in Minutes"] != DBNull.Value)
            {
                obj.ResolutionTimeinMinutes = (string)returnData["Resolution Time in Minutes"];
            }
            if (returnData["Problem Desc"] != DBNull.Value)
            {
                obj.ProblemDesc = (string)returnData["Problem Desc"];
            }

            if (returnData["Log Time"] != DBNull.Value)
            {
                DateTime Mydatetime2 = new DateTime();
                Mydatetime2 = (DateTime)returnData["Log Time"];
                obj.Logtime = Mydatetime2.ToString();
            }
            if (returnData["Log Date"] != DBNull.Value)
            {
                DateTime Mydatetime3 = new DateTime();
                Mydatetime3 = (DateTime)returnData["Log Date"];
                obj.LogDate = Mydatetime3.ToString();
            }

            if (returnData["Location"] != DBNull.Value)
            {
                obj.Location = (string)returnData["Location"];
            }
            if (returnData["Engineer"] != DBNull.Value)
            {
                obj.Engineer = (string)returnData["Engineer"];
            }

            if (returnData["Closed Time"] != DBNull.Value)
            {
                DateTime Mydatetime4 = new DateTime();
                Mydatetime4 = (DateTime)returnData["Closed Time"];
                obj.ClosedTime = Mydatetime4.ToString();
            }

            if (returnData["Closed Date"] != DBNull.Value)
            {
                DateTime Mydatetime5 = new DateTime();
                Mydatetime5 = (DateTime)returnData["Closed Date"];
                obj.Closeddate = Mydatetime5.ToString();
            }

            if (returnData["Case History Last Update"] != DBNull.Value)
            {
                obj.CaseHistoryLastUpdate = (string)returnData["Case History Last Update"];
            }
            if (returnData["Call Type"] != DBNull.Value)
            {
                obj.CallType = (string)returnData["Call Type"];
            }
            if (returnData["Call Status"] != DBNull.Value)
            {
                obj.CallStatus = (string)returnData["Call Status"];
            }

            obj.CallNo = (string)returnData["Call No"];
            if (returnData["Allowed Response Time in Minutes"] != DBNull.Value)
            {
                obj.AllowedResponseTimeinminutes = (string)returnData["Allowed Response Time in Minutes"];
            }
            if (returnData["Allowed Resolution Time in Minutes"] != DBNull.Value)
            {
                obj.AllowedResolutionTimeinMinutes = (string)returnData["Allowed Resolution Time in Minutes"];
            }

        }
        returnData.Close();
        returnData.Dispose();
        return obj;
    }
    public CollectionBase Generatecsm_callsCollection(ref IDataReader returnData)
    {
        BLLCollection<csm_calls> col = new BLLCollection<csm_calls>();
        while (returnData.Read())
        {

            csm_calls obj = new csm_calls();
            obj.User = (string)returnData["User"];
            if (returnData["Start Time"] != DBNull.Value)
            {
                DateTime Mydatetime = new DateTime();
                Mydatetime = (DateTime)returnData["Start Time"];
                obj.StartTime = Mydatetime.ToString();
            }
            if (returnData["Start Date"] != DBNull.Value)
            {
                DateTime Mydatetime1 = new DateTime();
                Mydatetime1 = (DateTime)returnData["Start Date"];
                obj.StartDate = Mydatetime1.ToString();
            }

            if (returnData["SLA Type"] != DBNull.Value)
            {
                obj.SLAType = (string)returnData["SLA Type"];
            }
            if (returnData["Severity Level"] != DBNull.Value)
            {
                obj.Severitylevel = (string)returnData["Severity Level"];
            }
            if (returnData["Response Time in Minutes"] != DBNull.Value)
            {
                obj.Responsetimeinminutes = (string)returnData["Response Time in Minutes"];
            }
            if (returnData["Resolution Time in Minutes"] != DBNull.Value)
            {
                obj.ResolutionTimeinMinutes = (string)returnData["Resolution Time in Minutes"];
            }
            if (returnData["Problem Desc"] != DBNull.Value)
            {
                obj.ProblemDesc = (string)returnData["Problem Desc"];
            }

            if (returnData["logtime"] != DBNull.Value)
            {

                obj.Logtime = (string)returnData["logtime"];

            }
            if (returnData["logdate"] != DBNull.Value)
            {
                obj.LogDate = (string)returnData["logdate"];

            }

            if (returnData["Location"] != DBNull.Value)
            {
                obj.Location = (string)returnData["Location"];
            }
            if (returnData["Customer Name"] != DBNull.Value)
            {
                obj.Location = (string)returnData["Customer Name"];
            }
            if (returnData["Engineer"] != DBNull.Value)
            {
                obj.Engineer = (string)returnData["Engineer"];
            }

            if (returnData["Closetime"] != DBNull.Value)
            {
                obj.ClosedTime = (string)returnData["Closetime"];

            }

            if (returnData["ClosedDate"] != DBNull.Value)
            {

                obj.Closeddate = (string)returnData["ClosedDate"];

            }

            if (returnData["Case History Last Update"] != DBNull.Value)
            {
                obj.CaseHistoryLastUpdate = (string)returnData["Case History Last Update"];
            }
            if (returnData["Call Type"] != DBNull.Value)
            {
                obj.CallType = (string)returnData["Call Type"];
            }
            if (returnData["Call Status"] != DBNull.Value)
            {
                obj.CallStatus = (string)returnData["Call Status"];
            }

            obj.CallNo = (string)returnData["Call No"];
            if (returnData["Allowed Response Time in Minutes"] != DBNull.Value)
            {
                obj.AllowedResponseTimeinminutes = (string)returnData["Allowed Response Time in Minutes"];
            }
            if (returnData["Allowed Resolution Time in Minutes"] != DBNull.Value)
            {
                obj.AllowedResolutionTimeinMinutes = (string)returnData["Allowed Resolution Time in Minutes"];
            }

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }