/* Metodo que se utiliza para realizar una actualizacion */ private void updateAuxiliar() { //Se verifica que se haya seleccionado un equipo if (HttpContext.Current.Session["EquipmentId"] != null) { //Se verifica que se hayan completado los espacios HMI, PLC y Location if (HMIAddressText.Text != "" & PLCAddressText.Text != "" & LocationText.Text != "") { //Se obtienen los datos EquipmentService equipmentService = new EquipmentService(); EquipmentUpdateView equipment = new EquipmentUpdateView(); equipment.HMIAddress = HMIAddressText.Text; equipment.Location = LocationText.Text; equipment.PLCAddress = PLCAddressText.Text; equipment.PLCLink = ethernetLink.Items[0].Selected; equipment.Status = EquipmentEnable.Items[0].Selected; equipment.Id = EquipmentIdText.Text; //Se muestra la ventana de justificacion para la actualizacion String reason = Session["reason"].ToString(); String user = Context.User.Identity.Name; //Se llenan los datos para la auditoria AuditDataFromWeb audit = new AuditDataFromWeb(); audit.Reason = reason; audit.StationIP = General.getIp(this.Page); audit.UserName = user; //Se realiza la actualizacion CUDView crud = equipmentService.updateEquipment(equipment, audit); if (crud.update == false) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Could not update the Equipment')", true); } clearFields1(); fillEquipmentTable(); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true); } } }
private void updateAuxiliar() { if (HttpContext.Current.Session["EquipmentId"] != null) { if (HMIAddressText.Text != "" & PLCAddressText.Text != "" & LocationText.Text != "") { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Yes") { EquipmentService equipmentService = new EquipmentService(); EquipmentUpdateView equipment = new EquipmentUpdateView(); equipment.HMIAddress = HMIAddressText.Text; equipment.Location = LocationText.Text; equipment.PLCAddress = PLCAddressText.Text; equipment.PLCLink = ethernetLink.Items[0].Selected; equipment.Status = EquipmentEnable.Items[0].Selected; equipment.Id = EquipmentIdText.Text; CUDView crud = equipmentService.updateEquipment(equipment); if (crud.update == false) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Could not update the Equipment')", true); } clearFields1(); fillEquipmentTable(); } } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please complete all fields.')", true); } } }