示例#1
0
        public void Trace(Int32 UserID, string TraceType, string TraceDetail)
        {
            MMData d = new MMData();

            try {
                DataSet Log = d.GetStProcDataSet("PD", "exec dbo.sp_AddTrace @aT_U_ID, @aT_Type, @aT_Details",
                                                 new StProcParam[] {
                    new StProcParam("aT_U_ID", DbType.Int32, UserID),
                    new StProcParam("aT_Type", DbType.String, TraceType),
                    new StProcParam("aT_Details", DbType.String, TraceDetail)
                });
            } catch {  }
        }
示例#2
0
    private string GetVarValue(string DatabaseName, string VarName) {
      string result = "";
      MMData d = new MMData();
      try {
        
        DataSet ds = d.GetStProcDataSet(DatabaseName, "SELECT dv_VarValue, dv_VarName FROM DBVars WHERE dv_VarName = @VarName ",
          new StProcParam[] { new StProcParam("@VarName", DbType.String, VarName) });

        if ((ds.Tables.Count > 0) & (ds.Tables[0].Rows.Count > 0)) {
          try { result = Convert.ToString(ds.Tables[0].Rows[0]["dv_VarValue"]); } catch { result = ""; }
        }
      } catch { }
      return result;
    }
示例#3
0
        public User GetUserID(string userID)
        {
            User   user = new UnknownUser();
            MMData d    = new MMData();

            try {
                DataSet x = d.GetStProcDataSet(MMWebSiteConstants.DatabaseName(), SelectUser + "WHERE (U_ID = cast( @aID as int ))",
                                               new StProcParam[] { new StProcParam("@aID", DbType.String, userID) });
                if ((x.Tables.Count == 1) & (x.Tables[0].Rows.Count == 1))
                {
                    user = BuildUserFromRow(x.Tables[0].Rows[0]);
                }
            }  catch { }
            return(user);
        }
示例#4
0
        public User GetUser(string userName)
        {
            User   user = new UnknownUser();
            MMData d    = new MMData();

            try {
                DataSet x = d.GetStProcDataSet(MMWebSiteConstants.DatabaseName(), SelectUser + " WHERE (U_Login = @aLogin) and (U_IsActive=1)",
                                               new StProcParam[] { new StProcParam("@aLogin", DbType.AnsiString, userName) });
                if ((x.Tables.Count == 1) & (x.Tables[0].Rows.Count == 1))
                {
                    user = BuildUserFromRow(x.Tables[0].Rows[0]);
                }
            } catch { }
            return(user);
        }
示例#5
0
    private string GetVarValue(string DatabaseName, string VarName) {
      string result = "";
      MMData d = new MMData();
      try {

        if ((fCache != null)&&(!OverrideLocalCache)) { 
          if (fCache[VarName]==null){            
            DataSet ds = d.GetStProcDataSet(DatabaseName, "SELECT dv_VarValue, dv_VarName FROM DBVars WHERE dv_VarName = @VarName ",
              new StProcParam[] { new StProcParam("@VarName", DbType.String, VarName) });

            if ((ds.Tables.Count > 0) & (ds.Tables[0].Rows.Count > 0)) {
                try { result = Convert.ToString(ds.Tables[0].Rows[0]["dv_VarValue"]); }  catch { result = ""; }
            }
            if (fCache != null) {
              fCache[VarName] = result;
            }
          }
        }

        if ((fCache == null) || (OverrideLocalCache)) {          
          DataSet ds = d.GetStProcDataSet(DatabaseName, "SELECT dv_VarValue, dv_VarName FROM DBVars WHERE dv_VarName = @VarName ",
            new StProcParam[] { new StProcParam("@VarName", DbType.String, VarName) });

          if ((ds.Tables.Count > 0) & (ds.Tables[0].Rows.Count > 0)) {
              try { result = Convert.ToString(ds.Tables[0].Rows[0]["dv_VarValue"]); }  catch { result = ""; }
          }
          if (fCache != null) {
            fCache[VarName] = result;
          }
        } else {
          result = fCache[VarName].ToString();
        }

      } catch { }
      return result;
    }
示例#6
0
 public void UserUpdate(User toUpdate)
 {
     MMData  d  = new MMData();
     DataSet ud = d.GetStProcDataSet(MMWebSiteConstants.DatabaseName(), "exec dbo.sp_AddUpdateUsers00 @aU_ID, @aU_C_ID, @aU_Login, @aU_Password, @aU_Name, @aU_Email, @aU_SALT, @aU_IsUserAdmin, @aU_IsInhouseStaff, @aU_Domain, @aU_IsActive ",
                                     new StProcParam[] {
         new StProcParam("@aU_ID", DbType.Int32, toUpdate.UserID),
         new StProcParam("@aU_C_ID", DbType.Int32, toUpdate.U_C_ID),
         new StProcParam("@aU_Login", DbType.String, toUpdate.LoginName),
         new StProcParam("@aU_Password", DbType.String, toUpdate.Password),
         new StProcParam("@aU_Name", DbType.String, toUpdate.Name),
         new StProcParam("@aU_Email", DbType.String, toUpdate.Email),
         new StProcParam("@aU_SALT", DbType.String, toUpdate.Salter),
         new StProcParam("@aU_IsUserAdmin", DbType.Boolean, toUpdate.IsUserAdmin),
         new StProcParam("@aU_IsInhouseStaff", DbType.Boolean, toUpdate.IsInhouseStaff),
         new StProcParam("@aU_Domain", DbType.String, toUpdate.Domain),
         new StProcParam("@aU_IsActive", DbType.Boolean, toUpdate.IsActive)
     });
 }