Exemple #1
0
 protected void grvwContract_RowDataBound(Object sender, GridViewRowEventArgs e)
 {
     //Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             // Hndling GridView RowDataBound  Event for Binding vendorid to Vendor name
             int vendorid = Convert.ToInt32(e.Row.Cells[5].Text);
             objVendor           = objVendor.Get_By_id(vendorid);
             e.Row.Cells[5].Text = objVendor.Vendorname.ToString();
             int contractid = Convert.ToInt32(e.Row.Cells[1].Text);
             objContract = objContract.Get_By_id(contractid);
             int   TotalSpentTimeInMins = objContract.Get_Contract_Status(objContract.Activeto);
             Label lbl = ((Label)e.Row.FindControl("lblActive"));
             if (TotalSpentTimeInMins > 0)
             {
                 lbl.Text = "Active";
             }
             else
             {
                 lbl.Text = "Not Active";
             }
         }
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }
Exemple #2
0
 protected void grvwContract_RowDataBound(Object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         // Hndling GridView RowDataBound  Event for Binding vendorid to Vendor name
         int vendorid = Convert.ToInt16(e.Row.Cells[5].Text);
         objVendor           = objVendor.Get_By_id(vendorid);
         e.Row.Cells[5].Text = objVendor.Vendorname.ToString();
         int contractid = Convert.ToInt16(e.Row.Cells[1].Text);
         objContract = objContract.Get_By_id(contractid);
         int   TotalSpentTimeInMins = objContract.Get_Contract_Status(objContract.Activeto);
         Label lbl = ((Label)e.Row.FindControl("lblActive"));
         if (TotalSpentTimeInMins > 0)
         {
             lbl.Text = "Active";
         }
         else
         {
             lbl.Text = "Not Active";
         }
     }
 }
    protected void grvwContract_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            // Hndling GridView RowDataBound  Event for Binding vendorid to Vendor name
            int vendorid = Convert.ToInt16(e.Row.Cells[5].Text);
            objVendor = objVendor.Get_By_id(vendorid);
            e.Row.Cells[5].Text = objVendor.Vendorname.ToString();
            int contractid = Convert.ToInt16(e.Row.Cells[1].Text);
            objContract = objContract.Get_By_id(contractid);
            int TotalSpentTimeInMins = objContract.Get_Contract_Status(objContract.Activeto);
            Label lbl = ((Label)e.Row.FindControl("lblActive"));
            if (TotalSpentTimeInMins > 0)
            {
                lbl.Text = "Active";

            }
            else { lbl.Text = "Not Active"; }

        }
    }
    protected void grvwContract_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        //Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                // Hndling GridView RowDataBound  Event for Binding vendorid to Vendor name
                int vendorid = Convert.ToInt32(e.Row.Cells[5].Text);
                objVendor = objVendor.Get_By_id(vendorid);
                e.Row.Cells[5].Text = objVendor.Vendorname.ToString();
                int contractid = Convert.ToInt32(e.Row.Cells[1].Text);
                objContract = objContract.Get_By_id(contractid);
                int TotalSpentTimeInMins = objContract.Get_Contract_Status(objContract.Activeto);
                Label lbl = ((Label)e.Row.FindControl("lblActive"));
                if (TotalSpentTimeInMins > 0)
                {
                    lbl.Text = "Active";

                }
                else { lbl.Text = "Not Active"; }

            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }