Ejemplo n.º 1
0
        protected void Page_Init(object sender, EventArgs e)
        {
            switch (Mode)
            {
            case enMode.PIEdit:
                phAddNew.Visible = false;
                cgvMetric.AutoGenerateDeleteButton = ShowDeleteColumn;
                cgvMetric.DeleteButtonCaption      = DeleteButtonCaptionType.Remove;
                ((Micajah.Common.WebControls.HyperLinkField)cgvMetric.Columns[1]).DataNavigateUrlFormatString += "&PI=" + PerformanceIndicatorID.ToString();
                if (FirstMetricID != null)
                {
                    MetricCache.Add((Guid)FirstMetricID);
                }
                break;

            case enMode.PIAdd:
                cgvMetric.AutoGenerateDeleteButton = false;
                phAddNew.Visible             = false;
                cgvMetric.Columns[0].Visible = true;
                cgvMetric.Columns[1].Visible = false;
                cgvMetric.FindField("InputUnitOfMeasureName").HeaderText = "Input Unit";
                cgvMetric.FindField("UnitOfMeasureName").HeaderText      = "Output Unit";
                break;

            case enMode.PiRef:
                cgvMetric.AutoGenerateDeleteButton = false;
                phAddNew.Visible = false;
                ((Micajah.Common.WebControls.HyperLinkField)cgvMetric.Columns[1]).DataNavigateUrlFormatString += "&PI=" + PerformanceIndicatorID.ToString();
                break;
            }
        }
Ejemplo n.º 2
0
 protected void cgvMetric_RowEditing(object sender, GridViewEditEventArgs e)
 {
     if (e.NewEditIndex < 0 || e.NewEditIndex >= cgvMetric.DataKeys.Count)
     {
         return;
     }
     if (Mode == enMode.List)
     {
         Response.Redirect("MetricEdit.aspx?MetricID=" + cgvMetric.DataKeys[e.NewEditIndex].Value.ToString());
     }
     else
     if (Mode == enMode.PIEdit || Mode == enMode.PiRef)
     {
         Response.Redirect("MetricEdit.aspx?MetricID=" + cgvMetric.DataKeys[e.NewEditIndex].Value.ToString() + "&PI=" + PerformanceIndicatorID.ToString());
     }
 }