コード例 #1
0
 public void NewProduct(Products products)
 {
     using (ProductEva_Entities1 entiti = new ProductEva_Entities1())
     {
         entiti.Products.Add(products);
         entiti.SaveChanges();
     }
 }
コード例 #2
0
 public void NewADmin(Company admins)
 {
     using (ProductEva_Entities1 product = new ProductEva_Entities1())
     {
         product.Company.Add(admins);
         product.SaveChanges();
     }
 }
コード例 #3
0
 public void UserBuy(Sells sells)
 {
     using (ProductEva_Entities1 product = new ProductEva_Entities1())
     {
         product.Sells.Add(sells);
         product.SaveChanges();
     }
 }
コード例 #4
0
 public void NewUser(Users users)
 {
     try
     {
         using (ProductEva_Entities1 product = new ProductEva_Entities1())
         {
             product.Users.Add(users);
             product.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
 public void flag(Sells sells)
 {
     try
     {
         using (ProductEva_Entities1 product = new ProductEva_Entities1())
         {
             var sel = product.Sells.Where(x => x.Sell_Id == sells.Sell_Id).FirstOrDefault();
             sel.DeliveryFlag = sells.DeliveryFlag;
             product.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
 public void NewPerCategory(ProductCategory productCategory, string categoryName)
 {
     try
     {
         using (ProductEva_Entities1 product = new ProductEva_Entities1())
         {
             var category = product.Category.Where(x => x.CategoryName == categoryName).FirstOrDefault();
             int id       = category.CategoryID;
             productCategory.CategoryID = id;
             product.ProductCategory.Add(productCategory);
             product.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #7
0
        public void AddFeedBAck(FeedBack feedBack, FeedBackDetail detail)
        {
            using (ProductEva_Entities1 product = new ProductEva_Entities1())
            {
                product.FeedBackDetail.Add(detail);
                product.FeedBack.Add(feedBack);

                var feedBackID = feedBack.ReturnID;
                var feedBDID   = detail.FeedBackDetail_ID;

                FeedBack_FeedBackDetail feed = new FeedBack_FeedBackDetail();
                feed.FeedBack_ID      = feedBackID;
                feed.FeedBakcDetailID = feedBDID;

                product.FeedBack_FeedBackDetail.Add(feed);
                product.SaveChanges();
            }
        }
コード例 #8
0
 public void NewCategory(Category category)
 {
     try
     {
         using (ProductEva_Entities1 product = new ProductEva_Entities1())
         {
             var serach = product.V_Categories.Where(x => x.CategoryName == category.CategoryName).Select(x => x.CategoryName).FirstOrDefault();
             if (serach == null)
             {
                 product.Category.Add(category);
                 product.SaveChanges();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #9
0
 public void feedFlag(FeedBackDetail feedBackDetail)
 {
     try
     {
         using (ProductEva_Entities1 product = new ProductEva_Entities1())
         {
             var feedbackflag = product.FeedBackDetail.Where(x => x.FeedBackDetail_ID == feedBackDetail.FeedBackDetail_ID).FirstOrDefault();
             feedbackflag.Flag = feedBackDetail.Flag;
             if (feedBackDetail.CompanyReview != null && feedBackDetail.CompanyReview != "")
             {
                 feedbackflag.CompanyReview = feedBackDetail.CompanyReview;
             }
             product.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #10
0
        public void UpdateUser(Users users, bool clikControl)
        {
            try
            {
                using (ProductEva_Entities1 product = new ProductEva_Entities1())
                {
                    var userRow = product.Users.Where(X => X.UserID == users.UserID).FirstOrDefault();
                    if (clikControl == true)
                    {
                        userRow.UserAdress   = users.UserAdress;
                        userRow.UserDisct    = users.UserDisct;
                        userRow.UserMail     = users.UserMail;
                        userRow.UserName     = users.UserName;
                        userRow.UserPostaKod = users.UserPostaKod;
                        userRow.UserProvi    = users.UserProvi;
                        userRow.UserTel      = users.UserTel;
                        userRow.profilPhoto  = users.profilPhoto;
                    }
                    else
                    {
                        userRow.UserAdress   = users.UserAdress;
                        userRow.UserDisct    = users.UserDisct;
                        userRow.UserMail     = users.UserMail;
                        userRow.UserName     = users.UserName;
                        userRow.UserPostaKod = users.UserPostaKod;
                        userRow.UserProvi    = users.UserProvi;
                        userRow.UserTel      = users.UserTel;
                        userRow.profilPhoto  = users.profilPhoto;
                        userRow.UserPassword = users.UserPassword;
                    }

                    product.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }