示例#1
0
        /// <summary>
        /// 获取邮箱地址
        /// </summary>
        /// <param name="emailAddressInfo">邮箱地址实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList <EmailAddressInfo> GetEmailAddress(EmailAddressInfo emailAddressInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable <EmailAddressInfo> emailAddressInfos =
                    (
                        from item in DB.GetTable <EmailAddressInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (emailAddressInfo != null && emailAddressInfo.ID != 0)
                {
                    emailAddressInfos = emailAddressInfos.Where <EmailAddressInfo>(m => m.ID == emailAddressInfo.ID);
                }
                if (emailAddressInfo != null && emailAddressInfo.UserID != 0)
                {
                    emailAddressInfos = emailAddressInfos.Where <EmailAddressInfo>(m => m.UserID == emailAddressInfo.UserID);
                }

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = emailAddressInfos.Count();
                    return(emailAddressInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList <EmailAddressInfo>());
                }
                else
                {
                    return(emailAddressInfos.ToList <EmailAddressInfo>());
                }
            }
        }
示例#2
0
 /// <summary>
 /// 获取帮助
 /// </summary>
 /// <param name="ID">帮助编号</param>
 public HelpInfo GetHelpByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return(DB.GetTable <HelpInfo>().FirstOrDefault <HelpInfo>(u => u.ID == ID));
     }
 }
示例#3
0
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="userInfo">用户实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList<UsersInfo> GetUser(UsersInfo userInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable<UsersInfo> userInfos =
                    (
                        from item in DB.GetTable<UsersInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (userInfo != null && userInfo.ID != 0)
                    userInfos = userInfos.Where<UsersInfo>(m => m.ID == userInfo.ID);
                if (userInfo != null && !string.IsNullOrEmpty(userInfo.Name))
                    userInfos = userInfos.Where<UsersInfo>(m => m.Name.Contains(userInfo.Name));
                if (userInfo != null && userInfo.UserGroup != 0)
                    userInfos = userInfos.Where<UsersInfo>(m => m.UserGroup == userInfo.UserGroup);

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = userInfos.Count();
                    return userInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList<UsersInfo>();
                }
                else
                    return userInfos.ToList<UsersInfo>();
            }
        }
示例#4
0
 /// <summary>
 /// 获取用户
 /// </summary>
 /// <param name="name">用户名</param>
 /// <param name="password">密码</param>
 /// <returns></returns>
 public UsersInfo GetUserByNameAndPassword(string name, string password)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return DB.GetTable<UsersInfo>().FirstOrDefault<UsersInfo>(u => u.Name == name && u.Password == password);
     }
 }
示例#5
0
 /// <summary>
 /// 获取用户
 /// </summary>
 /// <param name="ID">用户编号</param>
 public UsersInfo GetUserByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return DB.GetTable<UsersInfo>().FirstOrDefault<UsersInfo>(u => u.ID == ID);
     }
 }
示例#6
0
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="userInfo">用户实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList <UsersInfo> GetUser(UsersInfo userInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable <UsersInfo> userInfos =
                    (
                        from item in DB.GetTable <UsersInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (userInfo != null && userInfo.ID != 0)
                {
                    userInfos = userInfos.Where <UsersInfo>(m => m.ID == userInfo.ID);
                }
                if (userInfo != null && !string.IsNullOrEmpty(userInfo.Name))
                {
                    userInfos = userInfos.Where <UsersInfo>(m => m.Name.Contains(userInfo.Name));
                }
                if (userInfo != null && userInfo.UserGroup != 0)
                {
                    userInfos = userInfos.Where <UsersInfo>(m => m.UserGroup == userInfo.UserGroup);
                }

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = userInfos.Count();
                    return(userInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList <UsersInfo>());
                }
                else
                {
                    return(userInfos.ToList <UsersInfo>());
                }
            }
        }
示例#7
0
 /// <summary>
 /// 获取用户
 /// </summary>
 /// <param name="ID">用户编号</param>
 public UsersInfo GetUserByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return(DB.GetTable <UsersInfo>().FirstOrDefault <UsersInfo>(u => u.ID == ID));
     }
 }
示例#8
0
 /// <summary>
 /// 获取用户
 /// </summary>
 /// <param name="name">用户名</param>
 /// <param name="password">密码</param>
 /// <returns></returns>
 public UsersInfo GetUserByNameAndPassword(string name, string password)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return(DB.GetTable <UsersInfo>().FirstOrDefault <UsersInfo>(u => u.Name == name && u.Password == password));
     }
 }
示例#9
0
 /// <summary>
 /// 获取邮件发送
 /// </summary>
 /// <param name="ID">邮件发送编号</param>
 public EmailSendInfo GetEmailSendByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return DB.GetTable<EmailSendInfo>().FirstOrDefault<EmailSendInfo>(u => u.ID == ID);
     }
 }
示例#10
0
 /// <summary>
 /// 获取短信配置
 /// </summary>
 /// <param name="ID">短信配置编号</param>
 public MessageProfileInfo GetMessageProfileByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return DB.GetTable<MessageProfileInfo>().FirstOrDefault<MessageProfileInfo>(u => u.ID == ID);
     }
 }
示例#11
0
        /// <summary>
        /// 获取短信配置
        /// </summary>
        /// <param name="messageProfileInfo">短信配置实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList <MessageProfileInfo> GetMessageProfile(MessageProfileInfo messageProfileInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable <MessageProfileInfo> messageProfileInfos =
                    (
                        from item in DB.GetTable <MessageProfileInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (messageProfileInfo != null && messageProfileInfo.ID != 0)
                {
                    messageProfileInfos = messageProfileInfos.Where <MessageProfileInfo>(m => m.ID == messageProfileInfo.ID);
                }
                if (messageProfileInfo != null && messageProfileInfo.UserID != 0)
                {
                    messageProfileInfos = messageProfileInfos.Where <MessageProfileInfo>(m => m.UserID == messageProfileInfo.UserID);
                }

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = messageProfileInfos.Count();
                    return(messageProfileInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList <MessageProfileInfo>());
                }
                else
                {
                    return(messageProfileInfos.ToList <MessageProfileInfo>());
                }
            }
        }
示例#12
0
 /// <summary>
 /// 获取短信配置
 /// </summary>
 /// <param name="ID">短信配置编号</param>
 public MessageProfileInfo GetMessageProfileByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return(DB.GetTable <MessageProfileInfo>().FirstOrDefault <MessageProfileInfo>(u => u.ID == ID));
     }
 }
示例#13
0
 /// <summary>
 /// 获取手机联系人
 /// </summary>
 /// <param name="ID">手机联系人编号</param>
 public PhoneAddressInfo GetPhoneAddressByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return DB.GetTable<PhoneAddressInfo>().FirstOrDefault<PhoneAddressInfo>(u => u.ID == ID);
     }
 }
示例#14
0
 /// <summary>
 /// 获取邮箱地址
 /// </summary>
 /// <param name="ID">邮箱地址编号</param>
 public EmailAddressInfo GetEmailAddressByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return(DB.GetTable <EmailAddressInfo>().FirstOrDefault <EmailAddressInfo>(u => u.ID == ID));
     }
 }
示例#15
0
        /// <summary>
        /// 获取帮助
        /// </summary>
        /// <param name="helpInfo">帮助实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList <HelpInfo> GetHelp(HelpInfo helpInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable <HelpInfo> helpInfos =
                    (
                        from item in DB.GetTable <HelpInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (helpInfo != null && helpInfo.ID != 0)
                {
                    helpInfos = helpInfos.Where <HelpInfo>(m => m.ID == helpInfo.ID);
                }

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = helpInfos.Count();
                    return(helpInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList <HelpInfo>());
                }
                else
                {
                    return(helpInfos.ToList <HelpInfo>());
                }
            }
        }
示例#16
0
 /// <summary>
 /// 获取帮助
 /// </summary>
 /// <param name="ID">帮助编号</param>
 public HelpInfo GetHelpByID(int ID)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         return DB.GetTable<HelpInfo>().FirstOrDefault<HelpInfo>(u => u.ID == ID);
     }
 }
示例#17
0
 /// <summary>
 /// 添加短信配置
 /// </summary>
 /// <param name="messageProfileInfo">短信配置实体</param>
 public int InsertMessageProfile(MessageProfileInfo messageProfileInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable <MessageProfileInfo>().InsertOnSubmit(messageProfileInfo);
             DB.SubmitChanges();
             return(1);
         }
         catch (Exception e)
         {
             string error = e.Message;
             return(-1);
         }
     }
 }
示例#18
0
 /// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="userInfo">用户实体</param>
 public int InsertUser(UsersInfo userInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable <UsersInfo>().InsertOnSubmit(userInfo);
             DB.SubmitChanges();
             return(1);
         }
         catch (Exception e)
         {
             string error = e.Message;
             return(-1);
         }
     }
 }
示例#19
0
 /// <summary>
 /// 添加邮箱地址
 /// </summary>
 /// <param name="emailAddressInfo">邮箱地址实体</param>
 public int InsertEmailAddress(EmailAddressInfo emailAddressInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable <EmailAddressInfo>().InsertOnSubmit(emailAddressInfo);
             DB.SubmitChanges();
             return(1);
         }
         catch (Exception e)
         {
             string error = e.Message;
             return(-1);
         }
     }
 }
示例#20
0
 /// <summary>
 /// 修改短信配置
 /// </summary>
 /// <param name="messageProfileInfo">短信配置实体</param>
 public int UpdateMessageProfile(MessageProfileInfo messageProfileInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<MessageProfileInfo>().Attach(messageProfileInfo, true);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#21
0
 /// <summary>
 /// 修改短信配置
 /// </summary>
 /// <param name="messageProfileInfo">短信配置实体</param>
 public int UpdateMessageProfile(MessageProfileInfo messageProfileInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable <MessageProfileInfo>().Attach(messageProfileInfo, true);
             DB.SubmitChanges();
             return(1);
         }
         catch (Exception e)
         {
             string error = e.Message;
             return(-1);
         }
     }
 }
示例#22
0
 /// <summary>
 /// 添加短信配置
 /// </summary>
 /// <param name="messageProfileInfo">短信配置实体</param>
 public int InsertMessageProfile(MessageProfileInfo messageProfileInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<MessageProfileInfo>().InsertOnSubmit(messageProfileInfo);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#23
0
 /// <summary>
 /// 添加帮助
 /// </summary>
 /// <param name="helpInfo">帮助实体</param>
 public int InsertHelp(HelpInfo helpInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<HelpInfo>().InsertOnSubmit(helpInfo);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#24
0
 /// <summary>
 /// 修改邮箱地址
 /// </summary>
 /// <param name="emailAddressInfo">邮箱地址实体</param>
 public int UpdateEmailAddress(EmailAddressInfo emailAddressInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable <EmailAddressInfo>().Attach(emailAddressInfo, true);
             DB.SubmitChanges();
             return(1);
         }
         catch (Exception e)
         {
             string error = e.Message;
             return(-1);
         }
     }
 }
示例#25
0
 /// <summary>
 /// 修改邮件发送
 /// </summary>
 /// <param name="emailSendInfo">邮件发送实体</param>
 public int UpdateEmailSend(EmailSendInfo emailSendInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<EmailSendInfo>().Attach(emailSendInfo, true);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#26
0
 /// <summary>
 /// 添加邮件发送
 /// </summary>
 /// <param name="emailSendInfo">邮件发送实体</param>
 public int InsertEmailSend(EmailSendInfo emailSendInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<EmailSendInfo>().InsertOnSubmit(emailSendInfo);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#27
0
 /// <summary>
 /// 修改用户
 /// </summary>
 /// <param name="userInfo">用户实体</param>
 public int UpdateUser(UsersInfo userInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable <UsersInfo>().Attach(userInfo, true);
             DB.SubmitChanges();
             return(1);
         }
         catch (Exception e)
         {
             string error = e.Message;
             return(-1);
         }
     }
 }
示例#28
0
 /// <summary>
 /// 修改手机联系人
 /// </summary>
 /// <param name="phoneAddressInfo">手机联系人实体</param>
 public int UpdatePhoneAddress(PhoneAddressInfo phoneAddressInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<PhoneAddressInfo>().Attach(phoneAddressInfo, true);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#29
0
 /// <summary>
 /// 添加手机联系人
 /// </summary>
 /// <param name="phoneAddressInfo">手机联系人实体</param>
 public int InsertPhoneAddress(PhoneAddressInfo phoneAddressInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<PhoneAddressInfo>().InsertOnSubmit(phoneAddressInfo);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }
示例#30
0
        /// <summary>
        /// 获取帮助
        /// </summary>
        /// <param name="helpInfo">帮助实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList<HelpInfo> GetHelp(HelpInfo helpInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable<HelpInfo> helpInfos =
                    (
                        from item in DB.GetTable<HelpInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (helpInfo != null && helpInfo.ID != 0)
                    helpInfos = helpInfos.Where<HelpInfo>(m => m.ID == helpInfo.ID);

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = helpInfos.Count();
                    return helpInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList<HelpInfo>();
                }
                else
                    return helpInfos.ToList<HelpInfo>();
            }
        }
示例#31
0
        /// <summary>
        /// 获取邮件发送
        /// </summary>
        /// <param name="emailSendInfo">邮件发送实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList<EmailSendInfo> GetEmailSend(EmailSendInfo emailSendInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable<EmailSendInfo> emailSendInfos =
                    (
                        from item in DB.GetTable<EmailSendInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (emailSendInfo != null && emailSendInfo.ID != 0)
                    emailSendInfos = emailSendInfos.Where<EmailSendInfo>(m => m.ID == emailSendInfo.ID);
                if (emailSendInfo != null && emailSendInfo.UserID != 0)
                    emailSendInfos = emailSendInfos.Where<EmailSendInfo>(m => m.UserID == emailSendInfo.UserID);

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = emailSendInfos.Count();
                    return emailSendInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList<EmailSendInfo>();
                }
                else
                    return emailSendInfos.ToList<EmailSendInfo>();
            }
        }
示例#32
0
        /// <summary>
        /// 获取手机联系人
        /// </summary>
        /// <param name="phoneAddressInfo">手机联系人实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList<PhoneAddressInfo> GetPhoneAddress(PhoneAddressInfo phoneAddressInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable<PhoneAddressInfo> phoneAddressInfos =
                    (
                        from item in DB.GetTable<PhoneAddressInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (phoneAddressInfo != null && phoneAddressInfo.ID != 0)
                    phoneAddressInfos = phoneAddressInfos.Where<PhoneAddressInfo>(m => m.ID == phoneAddressInfo.ID);
                if (phoneAddressInfo != null && phoneAddressInfo.UserID != 0)
                    phoneAddressInfos = phoneAddressInfos.Where<PhoneAddressInfo>(m => m.UserID == phoneAddressInfo.UserID);

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = phoneAddressInfos.Count();
                    return phoneAddressInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList<PhoneAddressInfo>();
                }
                else
                    return phoneAddressInfos.ToList<PhoneAddressInfo>();
            }
        }
示例#33
0
        /// <summary>
        /// 获取短信配置
        /// </summary>
        /// <param name="messageProfileInfo">短信配置实体</param>
        /// <param name="pageInfo">分页实体</param>
        /// <returns></returns>
        public IList<MessageProfileInfo> GetMessageProfile(MessageProfileInfo messageProfileInfo, PageInfo pageInfo)
        {
            using (DataContextDB DB = new DataContextDB())
            {
                IQueryable<MessageProfileInfo> messageProfileInfos =
                    (
                        from item in DB.GetTable<MessageProfileInfo>()
                        orderby item.ID descending
                        select item
                    );
                if (messageProfileInfo != null && messageProfileInfo.ID != 0)
                    messageProfileInfos = messageProfileInfos.Where<MessageProfileInfo>(m => m.ID == messageProfileInfo.ID);
                if (messageProfileInfo != null && messageProfileInfo.UserID != 0)
                    messageProfileInfos = messageProfileInfos.Where<MessageProfileInfo>(m => m.UserID == messageProfileInfo.UserID);

                if (pageInfo != null)
                {
                    pageInfo.TotalRecord = messageProfileInfos.Count();
                    return messageProfileInfos.Skip(pageInfo.PageSize * (pageInfo.PageIndex - 1)).Take(pageInfo.PageSize).ToList<MessageProfileInfo>();
                }
                else
                    return messageProfileInfos.ToList<MessageProfileInfo>();
            }
        }
示例#34
0
 /// <summary>
 /// 修改用户
 /// </summary>
 /// <param name="userInfo">用户实体</param>
 public int UpdateUser(UsersInfo userInfo)
 {
     using (DataContextDB DB = new DataContextDB())
     {
         try
         {
             DB.GetTable<UsersInfo>().Attach(userInfo, true);
             DB.SubmitChanges();
             return 1;
         }
         catch (Exception e)
         {
             string error = e.Message;
             return -1;
         }
     }
 }