Ejemplo n.º 1
0
 public static bool Add_TaiKhoan(TaiKhoan taiKhoan, TT_TaiKhoan tT_TaiKhoan)
 {
     using (ThanhHa_MotorCycleEntities entities = new ThanhHa_MotorCycleEntities())
     {
         entities.TaiKhoan.Add(taiKhoan);
         entities.TT_TaiKhoan.Add(tT_TaiKhoan);
         entities.SaveChanges();
         return(true);
     }
 }
Ejemplo n.º 2
0
        public static bool Edit_TaiKhoan(TaiKhoan taiKhoan, TT_TaiKhoan tT_TaiKhoan)
        {
            using (ThanhHa_MotorCycleEntities entities = new ThanhHa_MotorCycleEntities())
            {
                TaiKhoan taiKhoan_Tmp = entities.TaiKhoan.Where(p => p.user_Acc == taiKhoan.user_Acc).FirstOrDefault();
                taiKhoan_Tmp.status    = taiKhoan.status;
                taiKhoan_Tmp.id_LoaiTK = taiKhoan.id_LoaiTK;
                TT_TaiKhoan tT_TaiKhoan_Tmp = entities.TT_TaiKhoan.Where(p => p.user_Acc == taiKhoan.user_Acc).FirstOrDefault();
                tT_TaiKhoan_Tmp.name_User    = tT_TaiKhoan.name_User;
                tT_TaiKhoan_Tmp.phone_User   = tT_TaiKhoan.phone_User;
                tT_TaiKhoan_Tmp.email_User   = tT_TaiKhoan.email_User;
                tT_TaiKhoan_Tmp.address_User = tT_TaiKhoan.address_User;

                entities.SaveChanges();
                return(true);
            }
        }