// User wants to create a new subprocess protected void Button1_Click(object sender, EventArgs e) { if (!AuthCheck()) { Server.Transfer("AuthFail.html"); return; } int IDprocess; OdbcConnection conn = HELPERS.NewOdbcConn(); string newname; string processname; // New process or existing process? if (ChooserProcess.SelectedItem != null) { // Existing process! IDprocess = int.Parse(ChooserProcess.SelectedItem.Value); processname = ChooserProcess.SelectedItem.Text; } else { IProcess Iprc = new IProcess(conn); newname = ChooserProcess.Text.Trim(); processname = newname; if (newname.Length < 2) { throw new Exception("Name for new process is empty or too brief."); } IDprocess = Iprc.NewProcess(newname); } // Create the new subprocess ISubProcess Isprc = new ISubProcess(conn); newname = this.TextBox_NewSubprocess.Text.Trim(); if (newname.Length < 2) { throw new Exception("Name for new subprocess is empty or too brief."); } int IDsubprocess = Isprc.NewSubProcess(newname, IDprocess); Isprc.SetSubProcess(IDsubprocess, newname, IDprocess, "Active"); // New subprocess now created. Record this with the session. LogInToSubprocess(IDsubprocess, processname, newname); Response.Redirect("HOME.aspx"); }
// This is still in use, even with the new GUI, as of Oct2009 private void Grid1_UpdateCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e) { int idSubpr = int.Parse(e.Item["c_id"] as string); int idProcess = int.Parse(e.Item["IdOfProcess"] as string); string nameSubpr = e.Item["NameOfSubprocess"] as string; string namePr = e.Item["NameOfProcess"] as string; string statusSubpr = e.Item["StatusOfSubprocess"] as string; string descrPr = e.Item["DescrOfProcess"] as string; IProcess engineProcess = new IProcess(HELPERS.NewOdbcConn()); ISubProcess engineSubProcess = new ISubProcess(HELPERS.NewOdbcConn()); engineProcess.SetProcess(idProcess, namePr, descrPr); engineSubProcess.SetSubProcess(idSubpr, nameSubpr, idProcess, statusSubpr); }