Exemplo n.º 1
0
    private bool LoginDatabase()
    {
        UserClass login = new UserClass();

        login = login.Login(pUsername, pPassword);
        if (login != null)
        {
            UserName    = pUsername;
            User        = login;
            AccessLevel = Control.ACCESS_LEVEL_USER;
            GroupID     = login.GroupID;

            PENGGUNACollection usersCollection =
                new PENGGUNACollection().Where("NAMA", pUsername).Load();

            PENGGUNA theUser = usersCollection[0];

            Session["_KELOMPOKPENGGUNA_OwnerID"]     = theUser.KODEPENGGUNA;
            Session["_KELOMPOKPENGGUNA_OwnerColumn"] = "";
            return(true);
        }
        else
        {
            message = "Invalid Login";
        }
        return(false);
    }
 private void GetData()
 {
     if (mastertable == "KELOMPOKPENGGUNA")
     {
         IDictionary <string, object> par = new Dictionary <string, object>();
         par.Add("KODEKELOMPOK", this.Session[strTableName + "_masterkey1"]);
         collection = controller.FetchForDetails(par, OrderBy, OwnerColumn, OwnerID);
         numrows    = controller.FetchForDetailsCount(par, OwnerColumn, OwnerID);
     }
 }
Exemplo n.º 3
0
    public static bool ChangePassword(string sLogin, string sOldPassword, string sNewPassword)
    {
        Query qry = new Query(PENGGUNA.Schema);

        qry.WHERE("KODEPENGGUNA", sLogin).AND("KATAKUNCI", sOldPassword);
        PENGGUNAController controller = new PENGGUNAController();
        PENGGUNACollection col        = controller.FetchByQuery(qry);

        if (col != null && col.Count > 0)
        {
            col[0].KATAKUNCI = sNewPassword;
            col[0].IsNew     = false;
            col[0].Save("");
        }
        return(true);
    }