Ejemplo n.º 1
0
        /*Funcion: actualizar parametros
          Param: ParameterUpdateView,AuditDataFromWeb
          Return: status
          */
        public CUDView updateParameter(ParameterUpdateView parameter, AuditDataFromWeb audit)
        {
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getParameterByParameterID(parameter.ParameterId);
            String OldValues = "ParameterId: " + parameter.ParameterId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("ParameterMinValue") && row["ParameterMinValue"] != DBNull.Value) { OldValues = OldValues + ", ParameterMinValue: " + Convert.ToDouble(row["ParameterMinValue"]); }
                if (auditDaoResult.Columns.Contains("ParameterName") && row["ParameterName"] != DBNull.Value) { OldValues = OldValues + ", ParameterName: " + row["ParameterName"].ToString(); }
                if (auditDaoResult.Columns.Contains("ParameterXPlot") && row["ParameterXPlot"] != DBNull.Value) { OldValues = OldValues + ", ParameterXPlot: " + (bool)row["ParameterXPlot"]; }
                if (auditDaoResult.Columns.Contains("ParameterYPlot") && row["ParameterYPlot"] != DBNull.Value) { OldValues = OldValues + ", ParameterYPlot: " + (bool)row["ParameterYPlot"]; }
                if (auditDaoResult.Columns.Contains("ParameterYPlotRange") && row["ParameterYPlotRange"] != DBNull.Value) { OldValues = OldValues + ", ParameterYPlotRange: " + Convert.ToInt32(row["ParameterYPlotRange"]); }
                if (auditDaoResult.Columns.Contains("ProcessId") && row["ProcessId"] != DBNull.Value) { OldValues = OldValues + ", ProcessId: " + Convert.ToInt32(row["ProcessId"]); }
                if (auditDaoResult.Columns.Contains("UnitId") && row["UnitId"] != DBNull.Value) { OldValues = OldValues + ", UnitId: " + row["UnitId"].ToString(); }

            }

            ParameterDao Dao = new ParameterDao();
            String state = Dao.updateParameter(parameter);
            CUDView logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update parameter";
                String NewValues = "ParameterId: " + parameter.ParameterId
                    + ", ParameterMinValue: " + parameter.ParameterMinValue
                    + ", ParameterName: " + parameter.ParameterName
                    + ", ParameterXPlot: " + parameter.ParameterXPlot
                    + ", ParameterYPlot: " + parameter.ParameterYPlot
                    + ", ParameterYPlotRange: " + parameter.ParameterYPlotRange
                    + ", ProcessId: " + parameter.ProcessId
                    + ", UnitId: " + parameter.UnitId;
                auditservice.formUpdate(Action, NewValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 2
0
        /*Funcion: Actualizar Units
          Param: UnitView,AuditDataFromWeb
          Return: Status
          */
        public CUDView updateUnits(UnitView unit, AuditDataFromWeb audit)
        {
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getUnitByUnitId(unit.UnitId);
            String OldValues = "UnitId: " + unit.UnitId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("UnitName") && row["UnitName"] != DBNull.Value) { OldValues = OldValues + ", UnitName: " + row["UnitName"].ToString(); }
                if (auditDaoResult.Columns.Contains("UnitSymbol") && row["UnitSymbol"] != DBNull.Value) { OldValues = OldValues + ", UnitSymbol: " + row["UnitSymbol"].ToString(); }

            }

            ParameterDao Dao = new ParameterDao();
            String state = Dao.updateUnits(unit);
            CUDView logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update unit";
                String NewValues = "UnitId: " + unit.UnitId
                    + ", UnitName: " + unit.UnitName
                    + ", UnitSymbol: " + unit.UnitSymbol;

                auditservice.formUpdate(Action, NewValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 3
0
        /*Funcion: actualizar equipos de la receta
          Param: RecipeEquipmentView,AuditDataFromWeb
          Return: status
          */
        public CUDView updateRecipeEquipment(RecipeEquipmentView recipe, AuditDataFromWeb audit)
        {
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getRecipeEquipmentByRecipeEquipMentIdAndRecipeId(recipe.RecipeId, recipe.RecipeEquipmentId);
            String OldValues = "RecipeId: " + recipe.RecipeId;
            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("RecipeEquipmentId") && row["RecipeEquipmentId"] != DBNull.Value) { OldValues = OldValues + ", RecipeEquipmentId: " + Convert.ToInt32(row["RecipeEquipmentId"]); }

                if (auditDaoResult.Columns.Contains("Link") && row["Link"] != DBNull.Value) { OldValues = OldValues + ", Link: " + (bool)row["Link"]; }

            }

            //Update
            RecipeDao Dao = new RecipeDao();
            String state = Dao.updateRecipeEquipment(recipe);
            CUDView logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);
            //Fin update

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update recipe equipment";
                String NewValues = "RecipeId: " + recipe.RecipeId
                    + ", RecipeEquipmentId: " + recipe.RecipeEquipmentId
                    + ", Link: " + recipe.Link;
                auditservice.formUpdate(Action, NewValues, OldValues, audit);
            }
            return logic;
        }
Ejemplo n.º 4
0
        /*Funcion: actualizar datos receta
          Param: RecipeUpdateValueView,AuditDataFromWeb
          Return: status
          */
        public CUDView updateRecipeValue(RecipeUpdateValueView recipe, AuditDataFromWeb audit)
        {
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getRecipeParameterByRecipeIdAndParameterId(recipe.RecipeId, recipe.ParameterId);
            String OldValues = "RecipeId: " + recipe.RecipeId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("ParameterId") && row["ParameterId"] != DBNull.Value) { OldValues = OldValues + ", ParameterId: " + Convert.ToInt32(row["ParameterId"]); }
                if (auditDaoResult.Columns.Contains("ParameterValue") && row["ParameterValue"] != DBNull.Value) { OldValues = OldValues + ", ParameterValue: " + Convert.ToInt32(row["ParameterValue"]); }

            }

            //Update
            RecipeDao Dao = new RecipeDao();
            String state = Dao.updateRecipeValue(recipe);
            CUDView logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);
            //Fin update

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update recipe parameter value";
                String NewValues = "RecipeId: " + recipe.RecipeId
                    + ", ParameterId: " + recipe.ParameterId
                    + ", ParameterValue: " + recipe.ParameterValue;

                auditservice.formUpdate(Action, NewValues, OldValues, audit);
            }
            return logic;
        }
Ejemplo n.º 5
0
        /*Funcion: actualizar productos
          Param: ProductUpdateView,AuditDataFromWeb
          Return: Lista Units
          */
        public CUDView updateProduct(ProductUpdateView product, AuditDataFromWeb audit)
        {
            CUDView logic = new CUDView();
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getProductsOldValues(product.ProductLineId);
            String OldValues = "ProductId: " + product.ProductLineId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("Product") && row["Product"] != DBNull.Value) { OldValues = OldValues + ", Product: " + row["Product"].ToString(); }
            }

            ProcessDao Dao = new ProcessDao();
            String state = Dao.updateProduct(product);
            logic=CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update Product";
                String newValues = "ProductId: " + product.ProductLineId;
                newValues = newValues + ", Product: " + product.ProductLineName;

                auditservice.formUpdate(Action, newValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 6
0
        /*Funcion: actualizar una receta
          Param: recipeId,AuditDataFromWeb
          Return: status
          */
        public CUDView updateRecipe(RecipeUpdateView recipe, AuditDataFromWeb audit)
        {
            CUDView logic = new CUDView();
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getRecipeOldValues(recipe.RecipeId);
            String OldValues = "RecipeId: " + recipe.RecipeId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("RecipeStatus") && row["RecipeStatus"] != DBNull.Value) { OldValues = OldValues + ", RecipeEnable: " + (bool)row["RecipeStatus"]; }
            }

            RecipeDao Dao = new RecipeDao();
            String state = Dao.updateRecipe(recipe);
            logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update recipe";
                String NewValues = "RecipeId: " + recipe.RecipeId
                    + ", RecipeEnable: " + recipe.RecipeEnable
                    ;
                auditservice.formUpdate(Action, NewValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 7
0
        /*Funcion: actualiza un Upn por operacion
          Param:  upnUpdateView, AuditDataFromWeb
          Return: Status
          */
        public CUDView updateUpnOperation(UpnOperationView upnUpdateView, AuditDataFromWeb audit)
        {
            CUDView logic = new CUDView();
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getUpnOperatoinOldValues(upnUpdateView.UpnId,upnUpdateView.ProcessId,upnUpdateView.OperationId);
            String OldValues = "UpnId: " + upnUpdateView.UpnId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("RecipeId") && row["RecipeId"] != DBNull.Value) { OldValues = OldValues + ", RecipeId: " + row["RecipeId"].ToString(); }
                if (auditDaoResult.Columns.Contains("Enable") && row["Enable"] != DBNull.Value) { OldValues = OldValues + ", Enable: " + row["Enable"].ToString(); }
            }

            UpnDao Dao = new UpnDao();
            String state = Dao.updateUpnOperation(upnUpdateView);
            logic=CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update upnOperation";
                String newValues = "UpnId: " + upnUpdateView.UpnId;
                newValues = newValues + ", RecipeId: " + upnUpdateView.RecipeId;
                newValues = newValues + ", Enable: " + upnUpdateView.Enable;

                auditservice.formUpdate(Action, newValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 8
0
        /*Funcion: actualiza un Upn
          Param:  UpnUpdateView, AuditDataFromWeb
          Return: Status
          */
        public CUDView updateUpn(UpnUpdateView upnUpdateView, AuditDataFromWeb audit)
        {
            CUDView logic = new CUDView();
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getUpnOldValues(upnUpdateView.UpnId);
            String OldValues = "UpnId: " + upnUpdateView.UpnId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("UPNStatus") && row["UPNStatus"] != DBNull.Value) { OldValues = OldValues + ", Enable: " + (bool)row["UPNStatus"]; }
                if (auditDaoResult.Columns.Contains("UpnMultipleSessions") && row["UpnMultipleSessions"] != DBNull.Value) { OldValues = OldValues + ", UpnMultipleSession: " + (bool)row["UpnMultipleSessions"]; }
            }

            UpnDao Dao = new UpnDao();
            String state = Dao.updateUpn(upnUpdateView);
            logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update Upn";
                String NewValues = "UpnId: " + upnUpdateView.UpnId
                    + ", Enable: " + upnUpdateView.UpnStatus
                    + ", UpnMultipleSession: " + upnUpdateView.Multisession;

                auditservice.formUpdate(Action, NewValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 9
0
 /*Funcion: actualiza un  Audit Trail
   Param: UpdateActionServerAuditTrailView
   Return: status
   */
 public CUDView updateAuditTrail(UpdateActionServerAuditTrailView serverAudit)
 {
     AuditDao Dao = new AuditDao();
     String state = Dao.updateAudit(serverAudit);
     return CUDVerifyLogic.verifierInsertDeleteUpdate("insert", state);
 }
Ejemplo n.º 10
0
        /*Funcion: actualizar equipos por grupos
          Param: EquipmentGroupView,AuditDataFromWeb
          Return: status
          */
        public CUDView UpdateEquipmentGroup(EquipmentGroupView groupEquipment, AuditDataFromWeb audit)
        {
            CUDView logic = new CUDView();
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getEquipmentGroupOldValues(groupEquipment.EquipmentGroupId);
            String OldValues = "EquipmentGroupId: " + groupEquipment.EquipmentGroupId;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("EquipmentGroupName") && row["EquipmentGroupName"] != DBNull.Value) { OldValues = OldValues + ", EquipmentGroupName: " + row["EquipmentGroupName"].ToString(); }
            }

            EquipmentDao Dao = new EquipmentDao();
            String state = Dao.updateEquipmentGroup(groupEquipment);
            logic= CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update EquipmentGroup";
                String newValues = "EquipmentGroupId: " + groupEquipment.EquipmentGroupId;
                newValues = newValues + ", EquipmentGroupName: " + groupEquipment.EquipmentGroupName;

                auditservice.formUpdate(Action, newValues, OldValues, audit);
            }

            return logic;
        }
Ejemplo n.º 11
0
        /*Funcion: actualizar equipos
          Param: EquipmentUpdateView,AuditDataFromWeb
          Return: status
          */
        public CUDView updateEquipment(EquipmentUpdateView equipment, AuditDataFromWeb audit)
        {
            CUDView logic = new CUDView();
            AuditDao auditDao = new AuditDao();
            DataTable auditDaoResult = auditDao.getEquipmentOldValues(equipment.Id);
            String OldValues = "EquipmentId: " + equipment.Id;

            foreach (DataRow row in auditDaoResult.Rows)
            {
                if (auditDaoResult.Columns.Contains("HMI") && row["HMI"] != DBNull.Value) { OldValues = OldValues + ", HMIAddress: " + row["HMI"].ToString(); }
                if (auditDaoResult.Columns.Contains("Location") && row["Location"] != DBNull.Value) { OldValues = OldValues + ", Location: " + row["Location"].ToString(); }
                if (auditDaoResult.Columns.Contains("PLC") && row["PLC"] != DBNull.Value) { OldValues = OldValues + ", PLCAddress: " + row["PLC"].ToString(); }
                if (auditDaoResult.Columns.Contains("PLCLink") && row["PLCLink"] != DBNull.Value) { OldValues = OldValues + ", PLCLink: " + row["PLCLink"].ToString(); }
                if (auditDaoResult.Columns.Contains("Enabled") && row["Enabled"] != DBNull.Value) { OldValues = OldValues + ", Status: " + row["Enabled"].ToString(); }
            }

            EquipmentDao Dao = new EquipmentDao();
            String state = Dao.updateEquipment(equipment);
            logic = CUDVerifyLogic.verifierInsertDeleteUpdate("update", state);

            if (logic.update == true)
            {
                AuditService auditservice = new AuditService();
                String Action = "Update Equipment";
                String newValues = "EquipmentId: " + equipment.Id;
                newValues = newValues + ", HMIAddress: " + equipment.HMIAddress;
                newValues = newValues + ", Location: " + equipment.Location;
                newValues = newValues + ", PLCAddress: " + equipment.PLCAddress;
                newValues = newValues + ", PLCLink: " + equipment.PLCLink;
                newValues = newValues + ", Status: " + equipment.Status;

                auditservice.formUpdate(Action, newValues, OldValues, audit);
            }

            return logic;
        }