コード例 #1
0
        public void InsertCustInformation(UsercustInfo info)
        {
            db_1525591_co5027_aziimEntities db = new db_1525591_co5027_aziimEntities();

            db.UsercustInfoes.Add(info);
            db.SaveChanges();
        }
コード例 #2
0
ファイル: PwTypeModel.cs プロジェクト: Aziim28/1525591-Aziim
        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);
            }
        }
コード例 #3
0
ファイル: PwTypeModel.cs プロジェクト: Aziim28/1525591-Aziim
        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);
            }
        }
コード例 #4
0
ファイル: PwTypeModel.cs プロジェクト: Aziim28/1525591-Aziim
        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);
            }
        }
コード例 #5
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);
            }
        }