Beispiel #1
0
        public void InsertCustInformation(UsercustInfo info)
        {
            db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();

            db.UsercustInfoes.Add(info);
            db.SaveChanges();
        }
Beispiel #2
0
        public UsercustInfo GetUsercustInfo(string wguId)
        {
            db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();
            UsercustInfo info = (from x in db.UsercustInfoes
                                 where x.GUID == wguId
                                 select x).FirstOrDefault();

            return(info);
        }
Beispiel #3
0
        public string InsertwatchProd(watchProdType watchproductType)
        {
            try
            {
                db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();
                db.watchProdTypes.Add(watchproductType);
                db.SaveChanges();

                return(watchproductType.watchName + "was just added to your cart");
            }
            catch (Exception e)
            {
                return("Error:" + e);
            }
        }
Beispiel #4
0
 public watchProduct GetwatchProduct(int id)
 {
     try
     {
         using (db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities())
         {
             watchProduct watchproduct = db.watchProducts.Find(id);
             return(watchproduct);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #5
0
 public List <watchProduct> GetAllwatchProducts()
 {
     try
     {
         using (db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities())
         {
             List <watchProduct> watchproducts = (from x in db.watchProducts
                                                  select x).ToList();
             return(watchproducts);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #6
0
 public List <watchProduct> GetwatchProductsByType(int watchprotypeid)
 {
     try
     {
         using (db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities())
         {
             List <watchProduct> watchproducts = (from x in db.watchProducts
                                                  where x.watchProID == watchprotypeid
                                                  select x).ToList();
             return(watchproducts);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #7
0
        public string DeletewatchProd(int id)
        {
            try
            {
                db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();
                watchProdType watchproductType     = db.watchProdTypes.Find(id);

                db.watchProdTypes.Attach(watchproductType);
                db.watchProdTypes.Remove(watchproductType);
                db.SaveChanges();

                return(watchproductType.watchName + "was just removed");
            }
            catch (Exception e)
            {
                return("Error:" + e);
            }
        }
Beispiel #8
0
        public string UpdatewatchProd(int id, watchProdType watchproductType)
        {
            try
            {
                db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();
                //take object from database
                watchProdType prod = db.watchProdTypes.Find(id);

                prod.watchName = watchproductType.watchName;

                db.SaveChanges();

                return(watchproductType.watchName + "was just updated");
            }
            catch (Exception e)
            {
                return("Error:" + e);
            }
        }
Beispiel #9
0
        public string UpdatewatchProd(int id, watchProduct watchproduct)
        {
            try
            {
                db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();
                //take object from database
                watchProduct prod = db.watchProducts.Find(id);

                prod.watchName        = watchproduct.watchName;
                prod.watchPrice       = watchproduct.watchPrice;
                prod.watchProID       = watchproduct.watchProID;
                prod.watchDescription = watchproduct.watchDescription;
                prod.watchImage       = watchproduct.watchImage;

                db.SaveChanges();

                return(watchproduct.watchName + "was just updated");
            }
            catch (Exception e)
            {
                return("Error:" + e);
            }
        }