Пример #1
0
        /*Funcion: insertar procesos
          Param: ProcessInsertView,AuditDataFromWeb
          Return: status
          */
        public CUDView insertProcess(ProcessInsertView process, AuditDataFromWeb audit)
        {
            ProcessDao Dao = new ProcessDao();
            String state = Dao.insertProcess(process);
            CUDView logic = CUDVerifyLogic.verifierInsertDeleteUpdate("insert", state);

            if (logic.insert == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Insert new process";
                String NewValues = "ProcessName: " + process.ProcessName
                    + ", ProcessParameterSet: " + process.ProcessParameterSet
                    + ", ProcessPlotEnable: " + process.ProcessPlotEnable
                    + ", ProductLineId: " + process.ProductLineId;

                auditservice.formInsert(Action, NewValues, audit);
            }
            return logic;
        }
        /*
        Metodo que se utiliza para hacer una insercion de un nuevo proceso
        */
        private void saveAuxiliar()
        {
            if (ProductText.SelectedItem != null)
            {
                if (ProcessText.Text != "" & ProductText.SelectedItem.Value != "")
                {

                    ProcessService processService = new ProcessService();
                    ProcessInsertView insertView = new ProcessInsertView();

                    insertView.ProcessName = ProcessText.Text;
                    insertView.ProductLineId = Int32.Parse(ProductText.SelectedItem.Value);
                    insertView.ProcessParameterSet = parameterSetText.Items[0].Selected;
                    insertView.ProcessPlotEnable = plotEnableText.Items[0].Selected;

                    String user = Context.User.Identity.Name;

                    AuditDataFromWeb audit = new AuditDataFromWeb();
                    audit.Reason = "N/A";
                    audit.StationIP = General.getIp(this.Page);
                    audit.UserName = user;

                    CUDView crud = processService.insertProcess(insertView, audit);

                    if (crud.insert == false)
                    {
                        this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Could not insert the Process')", true);
                    }
                    else
                    {
                        clearFields();
                        fillProcessTable();
                    }

                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true);
                }
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true);
            }
        }
Пример #3
0
 /*
   Funcion: Inserta un Proceso
   Param: ProductLineId,ProcessName,ProcessPlotEnable,ProcessParameterSet
   Return: Status
   */
 public String insertProcess(ProcessInsertView process)
 {
     return context.InsertUpdateDeleteMSQL("EXEC insertProcess @ProductLineId=" + process.ProductLineId + ", @ProcessName='" + process.ProcessName
         + "', @ProcessPlotEnable=" + process.ProcessPlotEnable + ", @ProcessParameterSet=" + process.ProcessParameterSet + ";");
 }
        private void saveAuxiliar()
        {
            if (ProductText.SelectedItem != null)
            {
                if (ProcessText.Text != "" & ProductText.SelectedItem.Value != "")
                {
                    string confirmValue = Request.Form["confirm_value"];
                    if (confirmValue == "Yes")
                    {
                        ProcessService processService = new ProcessService();
                        ProcessInsertView insertView = new ProcessInsertView();

                        insertView.ProcessName = ProcessText.Text;
                        insertView.ProductLineId = Int32.Parse(ProductText.SelectedItem.Value);
                        insertView.ProcessParameterSet = parameterSetText.Items[0].Selected;
                        insertView.ProcessPlotEnable = plotEnableText.Items[0].Selected;

                        CUDView crud = processService.insertProcess(insertView);

                        if (crud.insert == false)
                        {
                            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Could not insert the Process')", true);
                        }
                        else
                        {
                            clearFields();
                            fillProcessTable();
                        }
                    }
                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true);
                }
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true);
            }
        }