Example #1
0
 public bool InsertTransaction(TB_T_Organization TB_T_Organizations)
 {
     TB_T_Organizations.CreateDate = DateTimeOffset.Now.LocalDateTime;
     TB_T_Organizations.EditDate   = null;
     TB_T_Organizations.DeleteDate = null;
     myContext.TB_T_Organizations.Add(TB_T_Organizations);
     return(saveData(myContext));
 }
Example #2
0
        public bool UpdateTransaction(int id, TB_T_Organization TB_T_Organizations)
        {
            var get = GetTransaction(id);

            if (get != null)
            {
                get.Name                   = TB_T_Organizations.Name;
                get.EditDate               = DateTimeOffset.Now.LocalDateTime;
                get.TB_M_Organizations     = TB_T_Organizations.TB_M_Organizations;
                myContext.Entry(get).State = EntityState.Modified;
                return(saveData(myContext));
            }
            else
            {
                Console.WriteLine("Data tidak ditemukan");
                return(false);
            }
        }