public bool updateSmartPhone(Smartphone smartPhone)
        {
            Smartphone smartphoneUpdate = db.Smartphones.SingleOrDefault(x => x.Code == smartPhone.Code);

            if (smartphoneUpdate != null)
            {
                smartphoneUpdate.Name  = smartPhone.Name;
                smartphoneUpdate.Price = smartPhone.Price;
                smartphoneUpdate.Color = smartPhone.Color;
                smartphoneUpdate.Brand = smartPhone.Brand;

                db.SubmitChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        public bool updateSmartPhone(Smartphone smartPhone)
        {
            bool rs = new SmartPhoneDAO().updateSmartPhone(smartPhone);

            return(rs);
        }
예제 #3
0
        public bool addSmartPhone(Smartphone smartPhone)
        {
            bool rs = new SmartPhoneDAO().addSmartPhone(smartPhone);

            return(rs);
        }
 partial void DeleteSmartphone(Smartphone instance);
 partial void UpdateSmartphone(Smartphone instance);
 partial void InsertSmartphone(Smartphone instance);