protected void gvPopupAccounts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "SelectAccount") { string[] parts = e.CommandArgument.ToString().Split('|'); /* * OrganizationUser account = new OrganizationUser(); * account.AccountName = parts[0]; * account.DisplayName = parts[1]; * account.PrimaryEmailAddress = parts[2]; * account.AccountId = Utils.ParseInt(parts[3]); * account.SamAccountName = parts[4]; * account.SubscriberNumber = parts[5]; */ int AccountId = Utils.ParseInt(parts[3]); OrganizationUser account = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, AccountId); // set account BindSelectedAccount(account); // hide popup SelectAccountsModal.Hide(); // update parent panel MainUpdatePanel.Update(); } }
protected void ShowOtherData(string DataArg, string DataMessage) { ClearPageMessages(); try { ResultPanel.Visible = true; ResultEditUpdatePanel.Visible = false; DisableEdit.Value = "1"; dt = CheckError(mrpCalc.WorkProcessResults(ProcessID.Value.ToString(), DataArg)); if ((dt != null) && (dt.Rows.Count > 0)) { ResultsGrid.Visible = true; ResultsGrid.DataSource = dt; Session["MRPResults"] = dt; } else { ShowPageMessage(DataMessage, 1); } ResultsGrid.DataBind(); MainUpdatePanel.Update(); } catch (Exception ex) { ShowPageMessage("OtherData Error " + ex.Message.ToString(), 2); } }
private void FillGrid() { try { ResultPanel.Visible = true; ResultEditUpdatePanel.Visible = false; DisableEdit.Value = "0"; ShowPageMessage("Results for process " + ProcessID.Value + ".", 0); dt = CheckError(mrpCalc.WorkProcessResults(ProcessID.Value.ToString(), "Fed")); if ((dt != null) && (dt.Rows.Count > 0)) { ResultsGrid.Visible = true; ResultsGrid.DataSource = dt; ResultsGrid.DataBind(); Session["MRPResults"] = dt; MainUpdatePanel.Update(); } else { ShowPageMessage("No Results were produced", 0); } } catch (Exception ex) { ShowPageMessage("Fill Error " + ex.Message.ToString(), 0); } }
protected void DisplayParseText() { CKY_TableCell[,] TbCells = CKY_TABLECELLS; if (TbCells[0, N_Word].Tag != "") { string ParseText = CKY_Trace(0, N_Word, TbCells); var msg = String.Format("<strong>Success!</strong> Parse: {0}", ParseText); ScriptManager.RegisterStartupScript(MainUpdatePanel, MainUpdatePanel.GetType(), "alert", "ShowSuccessAlert('" + msg + "')", true); } else { var msg = String.Format("<strong>Fail!</strong> This is not a Sentence."); ScriptManager.RegisterStartupScript(MainUpdatePanel, MainUpdatePanel.GetType(), "alert", "ShowDangerAlert('" + msg + "')", true); } }
protected void UpdateRunStat() { String StatLabel; try { //IAsyncResult MRPStarter; //MRPStarter = (IAsyncResult)Session["MRPChecker"]; DateTime RunStartTime = (DateTime)Session["RunStartTime"]; if (StatusCd.Value.ToString() == "XX") { AllowProcess(true); MRPTimer.Enabled = false; RunStatPanel.Visible = false; StatLabel = "Process complete."; RunStatLabel.Text = StatLabel; RunStatUpdatePanel.Update(); FillGrid(); FillStats(); LoadPreviousDDL(); MainUpdatePanel.Update(); } else { DateTime.Now.Subtract(RunStartTime); StatLabel = "Process '" + ProcessID.Value + "' started at " + RunStartTime.ToString(); StatLabel += ". Process is still running (" + StatusCd.Value.ToString() + ")."; ExecuteLabel.Text = " Process has been executing " + DateTime.Now.Subtract(RunStartTime).Minutes.ToString() + " minutes and " + DateTime.Now.Subtract(RunStartTime).Seconds.ToString() + " seconds. "; dt = CheckError(mrpCalc.GetProcessStatus(ProcessID.Value)); if (dt != null) { StatusCd.Value = dt.Rows[0]["StatusCd"].ToString(); ExecuteGrid.Visible = true; ExecuteGrid.DataSource = dt; ExecuteGrid.DataBind(); } RunStatLabel.Text = StatLabel; RunStatUpdatePanel.Update(); } } catch (Exception ex) { StatLabel = "Process Error " + ex.Message.ToString(); MRPTimer.Enabled = false; } }
protected void RunService() { DateTime RunStartTime; String StatLabel; ResultPanel.Visible = false; MainUpdatePanel.Update(); RunStatPanel.Visible = true; MRPTimer.Enabled = true; ExecuteGrid.DataBind(); ProcessLabel.Text = "MRP now starting. Your Process is number " + ProcessID.Value + "."; RunStatLabel.Text = "Running MRP Process......."; RunStatUpdatePanel.Update(); Session["RunStartTime"] = DateTime.Now; MRPWebReference.MRPWebService mrpWebService = new MRPWebReference.MRPWebService(); MRPStarter = mrpWebService.BeginStartMRPProcess(ProcessID.Value, null, null); //RunStatLabel.Text = MRPStarter.IsCompleted.ToString(); //RunStatLabel.Text = mrpWebService.StartMRPProcess(ProcessID.Value); RunStatUpdatePanel.Update(); }
protected void gvPopupAccounts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "SelectAccount") { string[] parts = e.CommandArgument.ToString().Split('|'); OrganizationUser account = new OrganizationUser(); account.AccountName = parts[0]; account.DisplayName = parts[1]; account.PrimaryEmailAddress = parts[2]; account.AccountId = Utils.ParseInt(parts[3]); // set account BindSelectedAccount(account); // hide popup SelectAccountsModal.Hide(); // update parent panel MainUpdatePanel.Update(); } }
private void FillStats() { try { dt = CheckError(mrpCalc.WorkProcessResults(ProcessID.Value.ToString(), "Stats")); if ((dt != null) && (dt.Rows.Count > 0)) { StatGrid.DataSource = dt; StatGrid.DataBind(); ExcelUpdatePanel.Visible = true; MainUpdatePanel.Update(); } else { ShowPageMessage("No Stats on file", 0); } } catch (Exception ex) { ShowPageMessage("Stats Error " + ex.Message.ToString(), 0); } }
protected bool Start() { List <CNF_Rule> cnf_rules = new List <CNF_Rule>(); List <string> words = new List <string>(); List <string> sentence_words = new List <string>(); string CNF_text = CNF_Text.Value; string sentence = Sentence_Text.Value; string[] lines = CNF_text.Split(new string[] { "\n" }, StringSplitOptions.None); //string[] lines = CNF_text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); for (int i = 0; i < lines.Length; i++) { CNF_Rule rule = new CNF_Rule(i + 1, lines[i], words); cnf_rules.Add(rule); } Display_CNF_Table(cnf_rules); string[] wordsinSentence = sentence.Split(new char[] { ' ', ',', '.' }, StringSplitOptions.RemoveEmptyEntries); if (wordsinSentence.Count() == 0) { var msg = "<strong>Warning!</strong> The Sentence is empty."; ScriptManager.RegisterStartupScript(MainUpdatePanel, MainUpdatePanel.GetType(), "alert", "ShowWarningAlert('" + msg + "')", true); return(false); } List <string> Outlier_words = new List <string>(); // Check if error not have word in Global CNF WORDS foreach (string w in wordsinSentence) { if (words.IndexOf(w) == -1) { Outlier_words.Add(w); } else { sentence_words.Add(w); } } if (Outlier_words.Count() > 0) { var str_words = String.Join(", ", Outlier_words.ToArray()); var msg = String.Format("<strong>Warning!</strong> Words:<strong>{0}</strong> in the Sentence are not in CNF-Terminal words.", str_words); ScriptManager.RegisterStartupScript(MainUpdatePanel, MainUpdatePanel.GetType(), "alert", "ShowWarningAlert('" + msg + "')", true); //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowWarningAlert('" + msg + "')", true); return(false); } this.CNF_RULES = cnf_rules; this.WORDS = words; this.SENTENCE_WORDS = sentence_words; Display_CKY_Table(wordsinSentence); return(true); }
protected void ClearPageMessages() { MessageLabel.Text = ""; MainUpdatePanel.Update(); }