Exemplo n.º 1
0
        public long GetDentalOfficeID(string username, string password)
        {
            long   DentalOfficeID = 0;
            String md5password    = new WebHostSynch.Util().MD5Encrypt(password);

            try {
                // a query involving both username and password is used because 2 dental offices could potentially have the same username
                String command = "SELECT * FROM userm WHERE UserName='******' AND Password='******'";
                Userm  um      = Userms.GetOne(command);
                if (um == null)
                {
                    DentalOfficeID = 0;                  //user password combination incorrect- specify message if necessary
                }
                else
                {
                    DentalOfficeID = um.CustomerNum;
                }
            }
            catch (Exception ex) {
                Logger.LogError(ex);
                return(DentalOfficeID);
            }
            if (username.ToLower() == "demo")           //for demo only
            {
                DentalOfficeID = GetDemoDentalOfficeID();
            }
            return(DentalOfficeID);
        }
Exemplo n.º 2
0
Arquivo: Util.cs Projeto: mnisl/OD
		public long GetDentalOfficeID(string username,string password) {
			long DentalOfficeID=0;
			String md5password=new WebHostSynch.Util().MD5Encrypt(password);
			try {
				// a query involving both username and password is used because 2 dental offices could potentially have the same username
				String command="SELECT * FROM userm WHERE UserName='******' AND Password='******'";
				Userm um=Userms.GetOne(command);
				if(um==null) {
					DentalOfficeID=0;//user password combination incorrect- specify message if necessary
				}
				else {
					DentalOfficeID=um.CustomerNum;
				}

			}
			catch(Exception ex) {
				Logger.LogError(ex);
				return DentalOfficeID;
			}
			if(username.ToLower()=="demo") {//for demo only
				DentalOfficeID=GetDemoDentalOfficeID();
			}
			return DentalOfficeID;
		}