Ejemplo n.º 1
0
    public static string getConfig(int configID)
    {
        DataTable dt = WTS_Reports.HotlistConfig_Get(configID);
        config    c  = new config(dt);

        return(JsonConvert.SerializeObject(c));
    }
Ejemplo n.º 2
0
    public static void saveReportData(String SummaryOverviewsSection1, String SummaryOverviewsSection2, String Organization, String SelectedColumns, String filtersJSON, String Delimeter, String ddlValue, String Excel)
    {
        //this method calls the data base stored procedure in AJAX and binds the data to the session. The javascript will then trigger a post back, so the aspose stuff can execute and create the report.
        DataSet             ds      = new DataSet();
        List <FilterObject> filters = new JavaScriptSerializer().Deserialize <List <FilterObject> >(filtersJSON);

        // 13419 - 7
        var backLog = "";

        if (ddlValue.ToString().ToLower() == "default (backlog)")
        {
            backLog = "true";
        }
        else
        {
            backLog = "false";
        }

        ds = WTS_Reports.getWorkloadSummary(SummaryOverviewsSection1, SummaryOverviewsSection2, Organization, filters, Delimeter, backLog);
        HttpContext.Current.Session["WorkloadSummaryData"]     = ds;
        HttpContext.Current.Session["SelectedColumns"]         = SelectedColumns;
        HttpContext.Current.Session["SummaryOverviewsSecion1"] = SummaryOverviewsSection1;
        HttpContext.Current.Session["SummaryOverviewsSecion2"] = SummaryOverviewsSection2;
        HttpContext.Current.Session["filters"] = filters;

        // 13419 - 7:
        HttpContext.Current.Session["ddlValue"] = ddlValue;

        HttpContext.Current.Session["Excel"] = Excel;

        return;
    }
Ejemplo n.º 3
0
    private void loadGridData()
    {
        DataTable dt = null;

        dt = WTS_Reports.GetSRConfig();

        if (dt != null)
        {
            this.DCC = dt.Columns;
            Page.ClientScript.RegisterArrayDeclaration("_dcc", JsonConvert.SerializeObject(DCC, Newtonsoft.Json.Formatting.None));
            spanRowCount.InnerText = dt.Rows.Count.ToString();

            //dt.Columns["Name"].SetOrdinal(1); // Messes up save.
            //dt.Columns["ReceiveSREMail"].SetOrdinal(2);
            //dt.Columns["IncludeInSRCounts"].SetOrdinal(3);

            InitializeColumnData(ref dt);
            dt.AcceptChanges();

            int count = dt.Rows.Count;
            spanRowCount.InnerText = count.ToString();
        }

        grdMD.DataSource = dt;
        grdMD.DataBind();
    }
Ejemplo n.º 4
0
    public static void deleteConfig(int configID)
    {
        string errorMessage = WTS_Reports.HotlistConfig_Delete(configID);

        if (errorMessage.Length > 0)
        {
            throw new Exception(errorMessage);
        }
    }
Ejemplo n.º 5
0
    public static void updateReportParameters(string JSON, int paramsID)
    {
        string errorMessage = WTS_Reports.update_Report_Parameters(JSON, paramsID, HttpContext.Current.User.Identity.Name);

        if (errorMessage != "Success")
        {
            throw new Exception(errorMessage);
        }
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.reportID = WTS_Reports.getReportIDbyName("Workload Summary Report");
        DataTable      dt   = new DataTable();
        MembershipUser u    = Membership.GetUser();
        WTS_User       user = new WTS_User(u.ProviderUserKey.ToString());

        user.Load_GUID();
        this.userID = user.ID;
        string userName = HttpContext.Current.User.Identity.Name;

        WTS_Reports.get_Report_Parameter_List(ref dt, userID, this.reportID);
        if (dt != null && dt.Rows.Count > 0)
        {
            foreach (DataRow row in dt.Rows)
            {
                string   name  = row.Field <string>("Name");
                string   value = row.Field <Int32>("ParamsID").ToString();
                ListItem li    = new ListItem(name, value);
                if (row.Field <bool>("Process"))
                {
                    li.Attributes.Add("OptionGroup", "Process Views");
                }
                else
                {
                    li.Attributes.Add("OptionGroup", "Custom Views");
                }
                ddlParameters.Items.Insert(ddlParameters.Items.Count, li);
            }
        }
        ListItem def = new ListItem("Default", "Default");

        def.Attributes.Add("OptionGroup", "Process Views");
        ddlParameters.Items.Insert(0, def);

        // 13419 - 7:
        ListItem defBacklog = new ListItem("Default (Backlog)", "Default (Backlog)");

        def.Attributes.Add("OptionGroup", "Process Views");
        ddlParameters.Items.Insert(1, defBacklog);


        if (IsPostBack)
        {
            DataSet ds = (DataSet)Session["WorkloadSummaryData"];
            String  selectedColumns          = (String)Session["SelectedColumns"];
            String  SummaryOverviewsSection1 = (String)Session["SummaryOverviewsSecion1"];
            String  SummaryOverviewsSection2 = (String)Session["SummaryOverviewsSecion2"];


            String ddlValue = (String)Session["ddlValue"];

            Excel = (String)Session["Excel"];

            exportReport(ds, selectedColumns, SummaryOverviewsSection1, SummaryOverviewsSection2, ddlValue);
        }
    }
Ejemplo n.º 7
0
    public static string getReportParameters(int paramsID)
    {
        string JSON         = "";
        string errorMessage = WTS_Reports.get_Report_Parameters(ref JSON, paramsID);

        if (errorMessage != "Success")
        {
            throw new Exception(errorMessage);
        }
        return(JSON);
    }
Ejemplo n.º 8
0
    public static KeyValuePair <int, string> addReportParameters(string JSON, string name, int reportID, int userID, bool Process)
    {
        string userName     = HttpContext.Current.User.Identity.Name;
        int    paramsID     = 0;
        string errorMessage = WTS_Reports.createReportParameters(JSON, reportID, name, userID, userName, Process, ref paramsID);

        if (errorMessage != "Success")
        {
            throw new Exception(errorMessage);
        }
        return(new KeyValuePair <int, string>(paramsID, name));
    }
Ejemplo n.º 9
0
    private void initControls()
    {
        DataTable dtStatus     = MasterData.StatusList_Get(includeArchive: false);
        DataTable dtResources  = UserManagement.LoadUserList();
        DataTable dtConfigList = WTS_Reports.HostlistConfigList_Get();

        load_ListBoxAssigned(dtResources);
        load_ListBoxRecipients(dtResources);
        load_ListBoxStatus(dtStatus.Copy());
        load_ProductionPanel(dtStatus.Copy());
        load_ddlRank();
        load_ddlConfig(dtConfigList);
    }
Ejemplo n.º 10
0
    public static KeyValuePair <int, string> addConfig(string prodStatus, int techMin, int busMin, int techMax, int busMax, string status, string assigned, string recipients, string message, string name)
    {
        int configID = 0;

        string errorMessage = WTS_Reports.createHostlistConfig(prodStatus, techMin, techMax, busMin, busMax, status, assigned, recipients, message, name, ref configID);

        if (errorMessage.Length > 0)
        {
            throw new Exception(errorMessage);
        }

        return(new KeyValuePair <int, string>(configID, name));
    }
Ejemplo n.º 11
0
    public static string SaveChanges(string rows)
    {
        Dictionary <string, string> result = new Dictionary <string, string>()
        {
            { "saved", "" }, { "ids", "" }, { "error", "" }
        };
        bool   saved = false;
        string ids = string.Empty, errorMsg = string.Empty, tempMsg = string.Empty;

        try
        {
            DataTable dtjson = (DataTable)JsonConvert.DeserializeObject(rows, (typeof(DataTable)));
            if (dtjson.Rows.Count == 0)
            {
                errorMsg = "Unable to save. An invalid list of changes was provided.";
                saved    = false;
            }

            int id = 0, receiveSREMail = 0, includeInSRCounts = 0;

            HttpServerUtility server = HttpContext.Current.Server;
            //save
            foreach (DataRow dr in dtjson.Rows)
            {
                int.TryParse(dr["WTS_RESOURCEID"].ToString(), out id);
                int.TryParse(dr["ReceiveSREMail"].ToString(), out receiveSREMail);
                int.TryParse(dr["IncludeInSRCounts"].ToString(), out includeInSRCounts);

                WTS_Reports.SRRecipientSave(id, receiveSREMail, includeInSRCounts);
            }
            saved = true;
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);
            saved    = false;
            errorMsg = ex.Message;
        }

        result["saved"] = saved.ToString();
        result["error"] = errorMsg;

        return(JsonConvert.SerializeObject(result, Formatting.None));
    }
Ejemplo n.º 12
0
    private void loadGridData()
    {
        DataTable dt = null;

        dt = WTS_Reports.GetDashboardData();

        if (dt != null)
        {
            this.DCC         = dt.Columns;
            assignedToRanks  = dt.Rows[0]["Emergency Workload"].ToString();
            assignedToRanks += "," + dt.Rows[0]["Current Workload"].ToString();
            assignedToRanks += "," + dt.Rows[0]["Run The Business"].ToString();
            assignedToRanks += "," + dt.Rows[0]["Staged Workload"].ToString();
            assignedToRanks += "," + dt.Rows[0]["Unprioritized Workload"].ToString();

            assignedToRankLabels = "Emergency Workload,Current Workload,Run The Business,Staged Workload,Unprioritized Workload";
        }

        lblDateTime.InnerText = "My Work Tasks as of " + DateTime.Now.ToLongDateString() + ' ' + DateTime.Now.ToLongTimeString() + ':';

        //grdMD.DataSource = dt;
        //grdMD.DataBind();
    }
Ejemplo n.º 13
0
 public static void TESTSendSrReport()
 {
     WTS_Reports.TESTSendSrReport();
     return;
 }
Ejemplo n.º 14
0
 public static void TESTsendHotlist(string prodStatus, int techMin, int busMin, int techMax, int busMax, string status, string assigned, string recipients, string message)
 {
     WTS_Reports.TESTsendHotlistOnDemand(prodStatus, techMin, busMin, techMax, busMax, status, assigned, recipients, message);
     return;
 }
Ejemplo n.º 15
0
    public static string setActive(int configID)
    {
        string error = WTS_Reports.Hostlist_Config_SetActive(configID);

        return(error);
    }
Ejemplo n.º 16
0
 public static void deleteReportParameters(int paramsID)
 {
     string errorMessage = WTS_Reports.deleteReportParameters(paramsID);
 }