Beispiel #1
0
        private string GetVarValue(string DatabaseName, string VarName)
        {
            string result = "";

            try {
                if ((fCache[VarName] == null) || (OverrideLocalCache))
                {
                    MMData  d  = new MMData();
                    DataSet ds = d.GetStProcDataSet(DatabaseName, "SELECT VarValue, VarName FROM Variables WHERE 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]["VarValue"]); } catch { result = ""; }
                    }

                    fCache[VarName] = result;
                }
                else
                {
                    result = fCache[VarName].ToString();
                }
            } catch { }
            return(result);
        }
Beispiel #2
0
 private void SetVarValue(string DatabaseName, string VarName, string VarValue)
 {
     try {
         MMData d = new MMData();
         d.ExecuteStoredProc(DatabaseName, "exec dbo.rl_SetVariable @VarName, @VarValue",
                             new StProcParam[] {
             new StProcParam("@VarName", DbType.String, VarName),
             new StProcParam("@VarValue", DbType.String, VarValue)
         }
                             );
         fCache[VarName] = VarValue;
     } catch { }
 }
Beispiel #3
0
        public User GetUser(string userName)
        {
            User               user = new UnknownUser();
            MMData             d    = new MMData();
            MMWebSiteConstants c    = new MMWebSiteConstants();

            try {
                DataSet x = d.GetStProcDataSet(c.DatabaseName(), SelectUser + " WHERE (U_Login = @aLogin)",
                                               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);
        }
Beispiel #4
0
        public User GetUserID(string userID)
        {
            User               user = new UnknownUser();
            MMData             d    = new MMData();
            MMWebSiteConstants c    = new MMWebSiteConstants();

            try {
                DataSet x = d.GetStProcDataSet(c.DatabaseName(), SelectUser + "WHERE (U_ID = cast( @aID as uniqueidentifier ))",
                                               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);
        }
Beispiel #5
0
        public void UserUpdate(User toUpdate)
        {
            MMData             d  = new MMData();
            MMWebSiteConstants c  = new MMWebSiteConstants();
            DataSet            ud = d.GetStProcDataSet(c.DatabaseName(), "exec dbo.sp_AddUpdateUsers @aU_ID, @aU_Login, @aU_Password, @aU_Name, @aU_Email, @aU_SALT, @aU_IsAdmin, @aU_IsQA, @aU_IsManager, @aU_Domain",
                                                       new StProcParam[] {
                new StProcParam("@aU_ID", DbType.String, toUpdate.UserID),
                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_IsAdmin", DbType.Boolean, toUpdate.IsAdmin),
                new StProcParam("@aU_IsQA", DbType.Boolean, toUpdate.IsQA),
                new StProcParam("@aU_IsManager", DbType.Boolean, toUpdate.IsManager),
                new StProcParam("@aU_Domain", DbType.String, toUpdate.Domain)
            });

            //  if (toUpdate.UserID == -1) { // adding new user
            //    toUpdate = this.GetUser(toUpdate.LoginName);
            //  } else {
            //  }
        }