public int add(DETAIL_ASPEK detailaspek) { var result = 0; try { context.DETAIL_ASPEK.Add(detailaspek); result = context.SaveChanges(); } catch { result = -1; } return(result); }
public int Add(DETAIL_ASPEK detailaspek) { var result = 0; try { context.DETAIL_ASPEK.Add(detailaspek); result = context.SaveChanges(); } catch (Exception ex) { result = -1; logger.Error(ex.Message); logger.Error(ex.InnerException); } logger.Debug(result); return(result); }
public int edit(int id, DETAIL_ASPEK detailaspek) { var result = 0; try { var exsitingdetailaspek = context.DETAIL_ASPEK.Find(id); exsitingdetailaspek.NILAI_K_A = detailaspek.NILAI_K_A; exsitingdetailaspek.NILAI_K_B = detailaspek.NILAI_K_B; result = context.SaveChanges(); } catch { result = -1; } return(result); }
public int Edit(int id, DETAIL_ASPEK detailaspek) { var result = 0; try { var exsitingdetailaspek = context.DETAIL_ASPEK.Find(id); exsitingdetailaspek.NILAI_K_A = detailaspek.NILAI_K_A; exsitingdetailaspek.NILAI_K_B = detailaspek.NILAI_K_B; result = context.SaveChanges(); } catch (Exception ex) { result = -1; logger.Error(ex.Message); logger.Error(ex.InnerException); } logger.Debug(result); return(result); }