示例#1
0
        public bool changePassword(String username, String oldPassword, String password)
        {
            Database.PatientManagerEntities context = new Database.PatientManagerEntities();

            oldPassword = GetMd5Hash(oldPassword);

            IQueryable<Database.loginuser> lu = from users in context.loginusers
                                                where
                                                    users.usrName == username &&
                                                    users.usrPassword == oldPassword
                                                select users;
            if (lu.Count() == 1)
            {
                Database.loginuser user = lu.First();
                user.usrPassword = GetMd5Hash(password);
                context.SaveChanges();
            }
            else
            {
                return false;
            }

            return true;
        }
 public static IQueryable<InvoiceViewModel> GetInvoices(int? invID)
 {
     var context = new PatientManagerEntities();
     var query = from inv in context.inv_line
                 where inv.invID == invID
                 select new InvoiceViewModel
                 {
                     invID = inv.invoice.invID,
                     itryName = inv.inventory.itryName,
                     ItryDesc = inv.inventory.itryDesc,
                     ItryQty = inv.itryQty,
                     LinePrice = (decimal)inv.linePrice,
                     Line_Discount = (decimal)inv.line_discount,
                     invDate = inv.invoice.invDate,
                     Patient = inv.invoice.patient,
                     Doctor = inv.invoice.doctor
                 };
     return query;
 }
示例#3
0
        public void submitLogin(String username, String password)
        {
            Database.PatientManagerEntities context = new Database.PatientManagerEntities();

            password = GetMd5Hash(password);

            IQueryable<Database.loginuser> lu = from users in context.loginusers
                        where
                            users.usrName == username &&
                            users.usrPassword == password
                        select users;

            if (lu.Count() == 1)
            {
                m_bIsLoggedIn = true;
                m_strUsername = lu.First().usrName;
            }
            else
            {
                m_bIsLoggedIn = false;
                m_strUsername = null;
            }
        }