public usrStep(RenderForm parent,usrProcedure brother,Etape prevStep, Etape step,Procedure procedure,Operation operation) { InitializeComponent(); pParent = parent; Brother = brother; this.Step = step; this.Procedure = procedure; this._Operation = operation; this.prevStep = prevStep; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new CustomMessageBox()); { frm_Login frm = new frm_Login(); frm.ShowDialog(); try { if (frm.Tag != null) { // Application.Run(new AdministratorApp()); // Make the form. //Manager.ExpertManager.Expert expert = new Manager.ExpertManager.Expert(); //expert = expert.getExpert(frm.getLogin()); //Manager.Helper.service = new Service1(); //if (!Manager.Helper.service.ConnectExpert(expert.getLogin(), expert.getFirstName(), expert.getLastName(), "")) // MessageBox.Show("Expert Not Connected", "Program"); RenderForm frmRender = new RenderForm((string)frm.Tag); // Initialize Direct3D. if (frmRender.InitializeGraphics()) { //frmRender.Show(); // While the form is valid, // render the scene and process messages. //MessageBox.Show(frmRender.Created+" "+frmRender.isRunning); //while (frmRender.Created && frmRender.isRunning) //{ // frmRender.Render(); // Application.DoEvents(); //} Application.Run(frmRender); } } } catch (Exception x) { } } }
public usrProcedure(RenderForm parent, TypePanne type, Panne failure, Procedure procedure, Operation operation) { InitializeComponent(); this.pParent = parent; //Initialize the attributes. failureType = type; Failure = failure; this.procedure = procedure; this.StepsRemoved = false; this._Operation = operation; //Use the GUI to add a new procedure. if (this._Operation == Operation.AddNew) { if (this.procedure == null) { this.procedure = new Procedure(); //Create the list of steps for the current procedure. this.procedure.steps = new List<Etape>(); } } //Use the GUI to update a procedure. else { if (type != null) { //txtBx_FailureType.ReadOnly = true; //txtBx_FailureType.Enabled = false; txtBx_FailureType.Text = failureType.getName(); FailureTypeDesc = type.getDescription(); } else { MessageBox.Show("Type est null", "frm_AddProcedure.Constructor"); throw new ArgumentNullException(); } if (failure != null) { //txtBx_Failure.ReadOnly = true; //txtBx_Failure.Enabled = false; txtBx_Failure.Text = failure.getName(); FailureDesc = failure.getDescription(); } else { MessageBox.Show("Panne est null", "frm_AddProcedure.Constructor"); throw new ArgumentNullException(); } if (this.procedure != null) { txtBx_Title.Text = this.procedure.getName(); txtBx_Description.Text = this.procedure.getDescription(); if (this.procedure.steps != null && this.procedure.steps.Count > 0) { foreach (Etape step in this.procedure.getEtapes()) { //Fill the list view with the step's data. ListViewItem item = new ListViewItem(new string[] { step.getId().ToString(), step.getName(), step.getDescription() }); lstVew_Steps.Items.Add(item); } } } else { MessageBox.Show("Procedure est null", "frm_AddProcedure.Constructor"); throw new ArgumentNullException(); } } //Set the value of the Id textBox. txtBx_Id.Text = this.procedure.getId().ToString(); #region Load the form text fields to Fields list. Fields.Add(txtBx_Title); if (failureType == null) Fields.Add(txtBx_FailureType); if (Failure == null) Fields.Add(txtBx_Failure); #endregion #region Load the form labels to FieldLabels list. FieldLabels.Add(lbl_Title); if (failureType == null) FieldLabels.Add(lbl_FailureType); if (Failure == null) FieldLabels.Add(lbl_Failure); #endregion }
public usrProcedure(RenderForm parent, TypePanne type, Panne failure, Procedure procedure, Operation operation) { InitializeComponent(); this.pParent = parent; //Initialize the attributes. failureType = type; Failure = failure; this.procedure = procedure; this.StepsRemoved = false; this._Operation = operation; //Use the GUI to add a new procedure. if (this._Operation == Operation.AddNew) { if (this.procedure == null) { this.procedure = new Procedure(); //Create the list of steps for the current procedure. this.procedure.steps = new List <Etape>(); } } //Use the GUI to update a procedure. else { if (type != null) { //txtBx_FailureType.ReadOnly = true; //txtBx_FailureType.Enabled = false; txtBx_FailureType.Text = failureType.getName(); FailureTypeDesc = type.getDescription(); } else { MessageBox.Show("Type est null", "frm_AddProcedure.Constructor"); throw new ArgumentNullException(); } if (failure != null) { //txtBx_Failure.ReadOnly = true; //txtBx_Failure.Enabled = false; txtBx_Failure.Text = failure.getName(); FailureDesc = failure.getDescription(); } else { MessageBox.Show("Panne est null", "frm_AddProcedure.Constructor"); throw new ArgumentNullException(); } if (this.procedure != null) { txtBx_Title.Text = this.procedure.getName(); txtBx_Description.Text = this.procedure.getDescription(); if (this.procedure.steps != null && this.procedure.steps.Count > 0) { foreach (Etape step in this.procedure.getEtapes()) { //Fill the list view with the step's data. ListViewItem item = new ListViewItem(new string[] { step.getId().ToString(), step.getName(), step.getDescription() }); lstVew_Steps.Items.Add(item); } } } else { MessageBox.Show("Procedure est null", "frm_AddProcedure.Constructor"); throw new ArgumentNullException(); } } //Set the value of the Id textBox. txtBx_Id.Text = this.procedure.getId().ToString(); #region Load the form text fields to Fields list. Fields.Add(txtBx_Title); if (failureType == null) { Fields.Add(txtBx_FailureType); } if (Failure == null) { Fields.Add(txtBx_Failure); } #endregion #region Load the form labels to FieldLabels list. FieldLabels.Add(lbl_Title); if (failureType == null) { FieldLabels.Add(lbl_FailureType); } if (Failure == null) { FieldLabels.Add(lbl_Failure); } #endregion }