public void gvCOAResult_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                try
                {
                    Label    lbl = (Label)e.Row.Cells[0].FindControl("lblPlanStepID");
                    GridView gv  = (GridView)e.Row.Cells[0].FindControl("gvMeasureGrid");

                    CTL_PLAN_STEP step = coaReport.CtlPlan.CtlPlan.CTL_PLAN_STEP.First(s => s.CTLPLANSTEP_ID == Convert.ToInt32(lbl.Text));
                    gv.DataSource             = step.CTL_PLAN_MEASURE;
                    gv.RowStyle.VerticalAlign = VerticalAlign.Top;
                    gv.DataBind();
                }
                catch
                {
                }
            }
        }
Exemplo n.º 2
0
        public void gvCtlPlan_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                try
                {
                    HiddenField  hf  = (HiddenField)e.Row.Cells[0].FindControl("hfSampleRate");
                    DropDownList ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlSampleRate");
                    ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("sampleRate"));
                    if (!String.IsNullOrEmpty(hf.Value))
                    {
                        ddl.SelectedValue = hf.Value;
                    }

                    hf  = (HiddenField)e.Row.Cells[0].FindControl("hfSampleUnit");
                    ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlSampleUnit");
                    ddl.Items.AddRange(WebSiteCommon.PopulateDropDownListItems("sampleUnit"));
                    if (!String.IsNullOrEmpty(hf.Value))
                    {
                        ddl.SelectedValue = hf.Value;
                    }

                    Label lbl;
                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfStepInstructions");
                    Image img = (Image)e.Row.Cells[0].FindControl("imgStepType");
                    img.ToolTip = hf.Value;

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfPlanStepLocation");
                    if (!string.IsNullOrEmpty(hf.Value))
                    {
                        decimal plantID = Convert.ToDecimal(hf.Value);
                        PLANT   plant   = SQMModelMgr.LookupPlant(entities, plantID, "");
                        if (plant != null)
                        {
                            img = (Image)e.Row.Cells[0].FindControl("imgPlanStepLocation");
                            if (plant.COMPANY_ID == SessionManager.SessionContext.ActiveCompany().COMPANY_ID)
                            {
                                img.ImageUrl = "~/images/icon_customer2.gif";
                                img.ToolTip  = "";   // mt - todo: remove constant
                            }
                            else
                            {
                                img.ImageUrl = "~/images/icon_supplier2.gif";
                                img.ToolTip  = "Supplier";   // mt - todo: remove constant
                            }
                        }
                    }

                    lbl      = (Label)e.Row.Cells[0].FindControl("lblSampleUnit_out");
                    lbl.Text = WebSiteCommon.GetXlatValueLong("sampleUnit", lbl.Text);
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblSampleRate_out");
                    lbl.Text = WebSiteCommon.GetXlatValueLong("sampleRate", lbl.Text);

                    lbl = (Label)e.Row.Cells[0].FindControl("lblPlanStepID");
                    GridView      gv   = (GridView)e.Row.Cells[0].FindControl("gvMeasureGrid");
                    CTL_PLAN_STEP step = ctlPlanMgr.CtlPlan.CTL_PLAN_STEP.First(s => s.CTLPLANSTEP_ID == Convert.ToInt32(lbl.Text));
                    gv.DataSource = step.CTL_PLAN_MEASURE;
                    gv.DataBind();
                    gv            = (GridView)e.Row.Cells[0].FindControl("gvMethodGrid");
                    gv.DataSource = step.CTL_PLAN_MEASURE;
                    gv.DataBind();
                }
                catch
                {
                }
            }
        }