public int UpdateConnection(ConnectionProperty connection)
        {
            if (connection.ConnectionId != null)
            {
                _dbContext.Entry(connection).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #2
0
        public int AddOrEdit(NewsletterSubscriber newsletterSubscriber)
        {
            if (newsletterSubscriber.NewsletterSubscriberId == 0)
            {
                newsletterSubscriber.MachineIP        = HttpContext.Current.Request.UserHostAddress;
                newsletterSubscriber.SubscriptionDate = DateTime.Now;
                _dbContext.NewsletterSubscribers.Add(newsletterSubscriber);
            }
            else
            {
                newsletterSubscriber.MachineIP               = HttpContext.Current.Request.UserHostAddress;
                newsletterSubscriber.SubscriptionDate        = DateTime.Now;
                _dbContext.Entry(newsletterSubscriber).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #3
0
        public int AddOrEdit(NewsletterMail newsletterMail)
        {
            if (newsletterMail.NewsletterMailId == 0)
            {
                newsletterMail.CreatedBy   = "Ayesha";
                newsletterMail.CreatedDate = DateTime.Now;
                _dbContext.NewsletterMails.Add(newsletterMail);
            }
            else
            {
                newsletterMail.UpdatedBy               = "Ayesha";
                newsletterMail.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(newsletterMail).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #4
0
        public int AddOrEdit(OnlineUserFeedBackDetail onlineUserFeedBackDetail)
        {
            if (onlineUserFeedBackDetail.UserFeedBackId == 0)
            {
                onlineUserFeedBackDetail.MachineIP   = HttpContext.Current.Request.UserHostAddress;
                onlineUserFeedBackDetail.CreatedDate = DateTime.Now;
                _dbContext.OnlineUserFeedBackDetails.Add(onlineUserFeedBackDetail);
            }
            else
            {
                onlineUserFeedBackDetail.MachineIP               = HttpContext.Current.Request.UserHostAddress;
                onlineUserFeedBackDetail.CreatedDate             = DateTime.Now;
                _dbContext.Entry(onlineUserFeedBackDetail).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #5
0
        public int AddOrEdit(FeatureHeader featureHeader)
        {
            if (featureHeader.FeatureHeaderId == 0)
            {
                featureHeader.CreatedDate = DateTime.Now;
                featureHeader.UpdatedDate = DateTime.Now;
                featureHeader.CreatedBy   = 1;
                featureHeader.UpdatedBy   = 1;
                _dbContext.FeatureHeaders.Add(featureHeader);
            }
            else
            {
                featureHeader.UpdatedBy               = 1;
                featureHeader.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(featureHeader).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(HomeBanner homeBanner)
        {
            if (homeBanner.HomeBannerId == 0)
            {
                homeBanner.CreatedDate = DateTime.Now;
                homeBanner.UpdatedDate = DateTime.Now;
                homeBanner.CreatedBy   = 1;
                homeBanner.UpdatedBy   = 1;
                _dbContext.HomeBanners.Add(homeBanner);
            }
            else
            {
                homeBanner.UpdatedBy               = 1;
                homeBanner.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(homeBanner).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(SoftwareCategory softwareCategory)
        {
            if (softwareCategory.SoftwareCategoryId == 0)
            {
                softwareCategory.CreatedDate = DateTime.Now;
                softwareCategory.UpdatedDate = DateTime.Now;
                softwareCategory.CreatedBy   = 1;
                softwareCategory.UpdatedBy   = 1;
                _dbContext.SoftwareCategories.Add(softwareCategory);
            }
            else
            {
                softwareCategory.UpdatedBy               = 1;
                softwareCategory.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(softwareCategory).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #8
0
        public int AddOrEdit(ClientList clientList)
        {
            if (clientList.ClientID == 0)
            {
                clientList.CreatedDate = DateTime.Now;
                clientList.UpdatedDate = DateTime.Now;
                clientList.CreatedBy   = 1;
                clientList.UpdatedBy   = 1;
                _dbContext.ClientLists.Add(clientList);
            }
            else
            {
                clientList.UpdatedBy               = 1;
                clientList.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(clientList).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #9
0
        public int AddOrEdit(Blog blog)
        {
            if (blog.BlogId == 0)
            {
                blog.CreatedDate = DateTime.Now;
                blog.UpdatedDate = DateTime.Now;
                blog.CreatedBy   = 1;
                blog.UpdatedBy   = 1;
                _dbContext.Blogs.Add(blog);
            }
            else
            {
                blog.UpdatedBy               = 1;
                blog.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(blog).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #10
0
        public int AddOrEdit(ProductCategory productCategory)
        {
            if (productCategory.ProductCategoryId == 0)
            {
                productCategory.CreatedDate = DateTime.Now;
                productCategory.UpdatedDate = DateTime.Now;
                productCategory.CreatedBy   = 1;
                productCategory.UpdatedBy   = 1;
                _dbContext.ProductCategories.Add(productCategory);
            }
            else
            {
                productCategory.UpdatedBy               = 1;
                productCategory.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(productCategory).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(BlogCategory blogCategory)
        {
            if (blogCategory.BlogCategoryId == 0)
            {
                blogCategory.CreatedDate = DateTime.Now;
                blogCategory.UpdatedDate = DateTime.Now;
                blogCategory.CreatedBy   = 1;
                blogCategory.UpdatedBy   = 1;
                _dbContext.BlogCategories.Add(blogCategory);
            }
            else
            {
                blogCategory.UpdatedBy               = 1;
                blogCategory.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(blogCategory).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(Employee employee)
        {
            if (employee.EmployeeId == 0)
            {
                employee.CreatedDate = DateTime.Now;
                employee.UpdatedDate = DateTime.Now;
                employee.CreatedBy   = 1;
                employee.UpdatedBy   = 1;
                _dbContext.Employees.Add(employee);
            }
            else
            {
                employee.UpdatedBy               = 1;
                employee.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(employee).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(SocialAccountType socialAccountType)
        {
            if (socialAccountType.SocialAccountTypeId == 0)
            {
                socialAccountType.CreatedDate = DateTime.Now;
                socialAccountType.UpdatedDate = DateTime.Now;
                socialAccountType.CreatedBy   = 1;
                socialAccountType.UpdatedBy   = 1;
                _dbContext.SocialAccountTypes.Add(socialAccountType);
            }
            else
            {
                socialAccountType.UpdatedBy               = 1;
                socialAccountType.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(socialAccountType).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #14
0
        public int AddOrEdit(Designation designation)
        {
            if (designation.DesignationId == 0)
            {
                designation.CreatedDate = DateTime.Now;
                designation.UpdatedDate = DateTime.Now;
                designation.CreatedBy   = 1;
                designation.UpdatedBy   = 1;
                _dbContext.Designations.Add(designation);
            }
            else
            {
                designation.UpdatedBy               = 1;
                designation.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(designation).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #15
0
        public int AddOrEdit(PricingDetail pricingDetail)
        {
            if (pricingDetail.PricingDetailID == 0)
            {
                pricingDetail.CreatedDate = DateTime.Now;
                pricingDetail.UpdatedDate = DateTime.Now;
                pricingDetail.CreatedBy   = 1;
                pricingDetail.UpdatedBy   = 1;
                _dbContext.PricingDetails.Add(pricingDetail);
            }
            else
            {
                pricingDetail.UpdatedBy               = 1;
                pricingDetail.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(pricingDetail).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #16
0
        public int AddOrEdit(Service service)
        {
            if (service.ServiceId == 0)
            {
                service.CreatedDate = DateTime.Now;
                service.UpdatedDate = DateTime.Now;
                service.CreatedBy   = 1;
                service.UpdatedBy   = 1;
                _dbContext.Services.Add(service);
            }
            else
            {
                service.UpdatedBy               = 1;
                service.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(service).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #17
0
        public int AddOrEdit(CompanyDetail companyDetail)
        {
            if (companyDetail.CompanyId == 0)
            {
                companyDetail.CreatedDate = DateTime.Now;
                companyDetail.UpdatedDate = DateTime.Now;
                companyDetail.CreatedBy   = 1;
                companyDetail.UpdatedBy   = 1;
                _dbContext.CompanyDetails.Add(companyDetail);
            }
            else
            {
                companyDetail.UpdatedBy               = 1;
                companyDetail.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(companyDetail).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #18
0
        public int AddOrEdit(PricingTableType pricingTableType)
        {
            if (pricingTableType.PricingTableTypeID == 0)
            {
                pricingTableType.CreatedDate = DateTime.Now;
                pricingTableType.UpdatedDate = DateTime.Now;
                pricingTableType.CreatedBy   = 1;
                pricingTableType.UpdatedBy   = 1;
                _dbContext.PricingTableTypes.Add(pricingTableType);
            }
            else
            {
                pricingTableType.UpdatedBy               = 1;
                pricingTableType.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(pricingTableType).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #19
0
        public int AddOrEdit(FAQ FAQ)
        {
            if (FAQ.FAQId == 0)
            {
                FAQ.CreatedDate = DateTime.Now;
                FAQ.UpdatedDate = DateTime.Now;
                FAQ.CreatedBy   = 1;
                FAQ.UpdatedBy   = 1;
                _dbContext.FAQs.Add(FAQ);
            }
            else
            {
                FAQ.UpdatedBy               = 1;
                FAQ.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(FAQ).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
Пример #20
0
        public int AddOrEdit(FeatureDetail featureDetail)
        {
            if (featureDetail.FeatureDetailId == 0)
            {
                featureDetail.CreatedDate = DateTime.Now;
                featureDetail.UpdatedDate = DateTime.Now;
                featureDetail.CreatedBy   = 1;
                featureDetail.UpdatedBy   = 1;
                _dbContext.FeatureDetails.Add(featureDetail);
            }
            else
            {
                featureDetail.UpdatedBy               = 1;
                featureDetail.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(featureDetail).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(IconList iconList)
        {
            if (iconList.IconId == 0)
            {
                iconList.CreatedDate = DateTime.Now;
                iconList.UpdatedDate = DateTime.Now;
                iconList.CreatedBy   = 1;
                iconList.UpdatedBy   = 1;
                _dbContext.IconLists.Add(iconList);
            }
            else
            {
                iconList.UpdatedBy               = 1;
                iconList.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(iconList).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }
        public int AddOrEdit(SmtpHost smtpHost)
        {
            if (smtpHost.SmtpHostId == 0)
            {
                string password = new EncryptionDecryption().Encrypt(smtpHost.UserName, smtpHost.Password);
                smtpHost.Password = password;

                smtpHost.CreatedBy   = "Ayesha";
                smtpHost.CreatedDate = DateTime.Now;
                _dbContext.SmtpHosts.Add(smtpHost);
            }
            else
            {
                string password = new EncryptionDecryption().Encrypt(smtpHost.UserName, smtpHost.Password);
                smtpHost.Password = password;

                smtpHost.UpdatedBy               = "Ayesha";
                smtpHost.UpdatedDate             = DateTime.Now;
                _dbContext.Entry(smtpHost).State = EntityState.Modified;
            }

            return(_dbContext.SaveChanges());
        }