示例#1
0
 public static UserLogin GetUserByEmail(string Email)
 {
     using (WebPresenceEntities _context = new WebPresenceEntities())
     {
         return _context.UserLogins.Include("Customer").Include("Role").Where(x => x.EmailId == Email).FirstOrDefault();
     }
 }
示例#2
0
        public string InsertOrUpdateUser(Customer usr)
        {
            try
            {
                using (WebPresenceEntities _context = new WebPresenceEntities())
                {
                    if (usr.ID > 0)
                    {
                        _context.Customers.Single(o => o.ID == usr.ID);
                        _context.Customers.ApplyCurrentValues(usr);
                    }
                    else
                    {
                        _context.Customers.AddObject(usr);
                    }

                    _context.SaveChanges();
                    return usr.ID.ToString();
                }
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }
示例#3
0
 public static UserLogin EmailVerification(int CustomerID, string EmailID, string VerificationCode)
 {
     try
     {
         using (WebPresenceEntities _context = new WebPresenceEntities())
         {
             return _context.UserLogins.Where(x => x.CustomerId == CustomerID && x.EmailId == EmailID && x.EmailVerificationCode == VerificationCode).FirstOrDefault();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#4
0
 public static DomainConfigure GetDomainConfigureInfo(int DomainID)
 {
     try
     {
         using (WebPresenceEntities _context = new WebPresenceEntities())
         {
             return _context.DomainConfigures.Where(x => x.DomainId == DomainID).FirstOrDefault();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#5
0
 public static bool ChangePassword(UserLogin user)
 {
     using (WebPresenceEntities _context = new WebPresenceEntities())
     {
         var NewPassword = (from n in _context.UserLogins
                             where n.EmailId == user.EmailId
                             select n).First();
         NewPassword.Password = user.Password;
         int i = _context.SaveChanges();
         if (i > 0)
             return true;
         else
             return false;
     }
 }
示例#6
0
 public static List<Role> GetRole()
 {
     try
     {
         using (WebPresenceEntities _context = new WebPresenceEntities())
         {
             return (from rl in _context.Roles
                     orderby rl.Name
                     select rl).ToList();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#7
0
 public static string InsertOrUpdateDomainConfigure(DomainConfigure domainConfigure)
 {
     try
     {
         using (WebPresenceEntities _context = new WebPresenceEntities())
         {
             if (domainConfigure.Id > 0)
             {
                 _context.DomainConfigures.Single(o => o.Id == domainConfigure.Id);
                 _context.DomainConfigures.ApplyCurrentValues(domainConfigure);
             }
             else
             {
                 _context.DomainConfigures.AddObject(domainConfigure);
             }
             _context.SaveChanges();
             return domainConfigure.Id.ToString();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#8
0
 public static string InsertOrUpdateDomain(Domain domainDtls)
 {
     try
     {
         using (WebPresenceEntities _context = new WebPresenceEntities())
         {
             if (domainDtls.ID > 0)
             {
                 _context.Domains.Single(o => o.ID == domainDtls.ID);
                 _context.Domains.ApplyCurrentValues(domainDtls);
             }
             else
             {
                 _context.Domains.AddObject(domainDtls);
             }
             _context.SaveChanges();
             return domainDtls.ID.ToString();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        protected void btnsave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                using (WebPresenceEntities _context = new WebPresenceEntities())
                {
                    try
                    {
                        Domain dom = new Domain();
                        DomainConfigure domconfg = new DomainConfigure();
                        dom.WebsiteName = txtwebname.Text;
                        dom.DomainUrl = txtWebAddress.Text;
                        dom.KeyWords = txtKeywords.Text;
                        dom.Country = txtLocation.Text;
                        dom.City = txtCity.Text;
                        dom.State = txtState.Text;
                        dom.IsActive = true;
                        dom.CreatedDate = CommonClass.CurrentTime();
                        dom.CreatedBy = 2;
                        dom.ModifiedBy = 2;
                        dom.ModifiedDate = CommonClass.CurrentTime();
                        string id = DomainManager.InsertOrUpdateDomain(dom);
                        if (Convert.ToInt32(id) > 0)
                        {
                            domconfg.DomainId = Convert.ToInt32(id);
                            domconfg.Advertising = false;
                            domconfg.AdvertisingToken = "";
                            domconfg.Traffic = false;
                            domconfg.TrafficToken = "";
                            domconfg.Facebook = false;
                            domconfg.FacebookToken = "";
                            domconfg.YouTube = false;
                            domconfg.YoutubeToken = "";
                            domconfg.Twitter = false;
                            domconfg.TwitterToken = "";
                            domconfg.Conversions = false;
                            domconfg.ConversionsToken = "";
                            domconfg.CallTracking = false;
                            domconfg.CallTrackingToken = "";
                            domconfg.CreatedDate = CommonClass.CurrentTime();
                            domconfg.CreatedBy = 2;
                            domconfg.IsDeleted = false;
                            domconfg.ModifiedDate = CommonClass.CurrentTime();
                            string ID = DomainManager.InsertOrUpdateDomainConfigure(domconfg);
                            if (Convert.ToInt32(ID) > 0)
                            {

                            }
                            else
                            {

                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
        }
示例#10
0
 public static UserLogin RecoverPassword(UserLogin user)
 {
     using (WebPresenceEntities _context = new WebPresenceEntities())
     {
         return (from login in _context.UserLogins
                 where login.EmailId.Equals(user.EmailId)
                 select login).FirstOrDefault();
     }
 }