/*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; }
/*Funcion: Insertar productos Param: ProductLineName,AuditDataFromWeb Return: status */ public CUDView insertProduct(String ProductLineName, AuditDataFromWeb audit) { ProcessDao Dao = new ProcessDao(); String state = Dao.insertProduct(ProductLineName); CUDView logic = CUDVerifyLogic.verifierInsertDeleteUpdate("insert", state); if (logic.insert == true) { AuditService auditservice = new AuditService(); String Action = "Insert new ProductLineName"; String NewValues = "ProductLineName: " + ProductLineName; auditservice.formInsert(Action, NewValues, audit); } return logic; }
/*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; }
public List<ProcessView> getProcess() { ProcessDao Dao = new ProcessDao(); DataTable DaoResult = Dao.getProcess(); return buildProcess(DaoResult); }
/*Funcion: buscar procesos por los datos consultados Param: dato de busqueda Return: status */ public List<ProcessView> searchProcess(String partial) { ProcessDao Dao = new ProcessDao(); DataTable DaoResult = Dao.searchProcess(partial); return buildProcess(DaoResult); }