示例#1
0
 public static bool Add_LoaiSp(Loai_SP obj)
 {
     using (ThanhHa_MotorCycleEntities entities = new ThanhHa_MotorCycleEntities())
     {
         entities.Loai_SP.Add(obj);
         entities.SaveChanges();
         return(true);
     }
 }
示例#2
0
        public static bool Edit_LoaiSp(Loai_SP obj)
        {
            using (ThanhHa_MotorCycleEntities entities = new ThanhHa_MotorCycleEntities())
            {
                Loai_SP hang_SX = entities.Loai_SP.Find(obj.id_LoaiSP);
                hang_SX.name_LoaiSP    = obj.name_LoaiSP;
                hang_SX.descrip_LoaiSP = obj.descrip_LoaiSP;

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