public bool UpdateRecipe(Recipes rcp, CameraRecipe camrcp, ScanRecipe scanrcp, ControlRecipe ctrlrcp) { bool rect = false; try { RecipesDao dao = new RecipesDao(); rect = dao.Update(rcp); CameraRecipeDao camdao = new CameraRecipeDao(); if (camdao.GetCameraRecipe(rcp.RecipeId) == null) { rect = camdao.Insert(camrcp); } else { rect = camdao.Update(camrcp); } ScanRecipeDao scandao = new ScanRecipeDao(); if (scandao.GetScanRecipe(rcp.RecipeId) == null) { rect = scandao.Insert(scanrcp); } else { rect = scandao.Update(scanrcp); } ControlRecipeDao ctrldao = new ControlRecipeDao(); if (ctrldao.GetControlRecipe(ctrlrcp.RecipeId) == null) { rect = ctrldao.Insert(ctrlrcp); } else { rect = ctrldao.Update(ctrlrcp); } } catch (Exception ex) { LogHelper.AppLoger.Error(ex); } return(rect); }
public bool AddRecipe(Recipes rcp, CameraRecipe camrcp, ScanRecipe scanrcp, ControlRecipe ctrlrcp) { bool rect = false; try { RecipesDao dao = new RecipesDao(); rect = dao.Insert(rcp); CameraRecipeDao camdao = new CameraRecipeDao(); rect = camdao.Insert(camrcp); ScanRecipeDao scandao = new ScanRecipeDao(); rect = scandao.Insert(scanrcp); ControlRecipeDao ctrldao = new ControlRecipeDao(); rect = ctrldao.Insert(ctrlrcp); } catch (Exception ex) { LogHelper.AppLoger.Error(ex); } return(rect); }