示例#1
0
 protected void DashboardRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "DeleteDashboard")
     {
         try
         {
             int dashboardId = Convert.ToInt32(e.CommandArgument);
             int userId      = Convert.ToInt32(UserIdHiddenField.Value);
             int kpiId       = Convert.ToInt32(KpiIdHiddenField.Value);
             KpiDashboardBLL.DeleteKpiDashboard(dashboardId, userId, kpiId);
             IsAddedInMainDashboard.Value = "false";
             DashboardRepeater.DataBind();
             DashboardsComboBox.DataBind();
         }
         catch (Exception ex)
         {
             log.Error("Error deleting kpi from dashboard", ex);
         }
     }
 }
示例#2
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        try
        {
            int kpiId       = Convert.ToInt32(KpiIdHiddenField.Value);
            int dashboardId = Convert.ToInt32(DashboardsComboBox.SelectedValue);
            int userId      = Convert.ToInt32(UserIdHiddenField.Value);
            KpiDashboardBLL.InsertKpiToDashboard(kpiId, dashboardId, userId);
            DashboardRepeater.DataBind();
            DashboardsComboBox.DataBind();
        }
        catch (Exception ex)
        {
            log.Error("Error saving KPI in dashboard", ex);
            return;
        }

        Session["KpiId"] = KpiIdHiddenField.Value;
        Response.Redirect("~/Kpis/KpiDetails.aspx");
    }