public bool InsertMaster(TB_M_Organization TB_M_Organizations) { TB_M_Organizations.CreateDate = DateTimeOffset.Now.LocalDateTime; TB_M_Organizations.EditDate = null; TB_M_Organizations.DeleteDate = null; myContext.TB_M_Organizations.Add(TB_M_Organizations); return(saveData(myContext)); }
public bool UpdateMaster(int id, TB_M_Organization TB_M_Organizations) { var get = GetMaster(id); if (get != null) { get.Name = TB_M_Organizations.Name; get.EditDate = DateTimeOffset.Now.LocalDateTime; myContext.Entry(get).State = EntityState.Modified; return(saveData(myContext)); } else { Console.WriteLine("Data tidak ditemukan"); return(false); } }