public void InsertCustInformation(UsercustInfo info) { db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities(); db.UsercustInfoes.Add(info); db.SaveChanges(); }
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); } }
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); } }
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); } }
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); } }