Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            profileID.Value = Param.getString("id");
            profileName.Value = Param.getString("profile");

            pageType.Value = getPageType(Session);

            User_gl user = new User_gl();
            if (user.getCheckLogin(Session) != null)
            {
                login_error.Text = "Incorrect username or password";
                loginErrorStatus.Value = "error";
            }
            if (user.getCheckLogin(Session) == null)
            {
                loginErrorStatus.Value = "noError";
            }
            if (user.getUsername(Session) != null)
            {
                username_m.Text = user.getUsername(Session).ToString();
                loginStatus.Value = "login";
            }
            if (user.getUsername(Session) == null)
            {
                loginStatus.Value = "default";
            }
            user.clearSessionError(Session);
        }
    }
Exemplo n.º 2
0
 protected void login_Click(object sender, EventArgs e)
 {
     Data data = new Data();
     User_gl user = new User_gl();
     Data result = user.login(Param, Session);
     if (result == null)
     {
         user.checkLogin(Session);
         go("../client/profile.aspx?profile=" + Param.getString("profileName") + "&id=" + Param.getString("profileID"));
     }
     user.clearSessionError(Session);
     go("../client/profile.aspx?profile=" + Param.getString("profileName") + "&id=" + Param.getString("profileID"));
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Profile_gl profile = new Profile_gl();
            User_gl user = new User_gl();
            Data data = new Data();
            if (user.isLogin(Session) == true)
            {
                data.add("username", user.getUsername(Session));
                data.add("user_id", user.getUserID(data).getString("id"));
                edit.Visible = true;
            }

            Data list = profile.select(Param);
            nameLbl.Text = list.getString("name");
            trading_hour.Text = Server.HtmlDecode(list.getString("trading_hour"));
            phone.Text = Server.HtmlDecode(list.getString("phone"));
            address.Text = list.getString("address");
            email.Text = list.getString("email");
            summary.Text = Server.HtmlDecode(list.getString("summary"));
            profile_name.Value = list.getString("name");
            profile_id.Value = list.getString("id");
            data.add("profile_id", list.getString("id"));

            //rating in percentage
            Rating_gl rating = new Rating_gl();
            data.add("totalRating", rating.getTotalRating(data).ToString());
            rating1.Value = rating.getRatingOne(data).ToString();
            rating2.Value = rating.getRatingTwo(data).ToString();
            rating3.Value = rating.getRatingThree(data).ToString();
            rating4.Value = rating.getRatingFour(data).ToString();
            rating5.Value = rating.getRatingFive(data).ToString();
            setPageTypeSession(Session, "profile");

            //number of rated users
            numRated1.Text = rating.numPerRate(data, "5").ToString();
            numRated2.Text = rating.numPerRate(data, "4").ToString();
            numRated3.Text = rating.numPerRate(data, "3").ToString();
            numRated4.Text = rating.numPerRate(data, "2").ToString();
            numRated5.Text = rating.numPerRate(data, "1").ToString();
            double totalRating = rating.averageRating(data);
            totalRatingLbl.Text = string.Format("{0:0.##}", totalRating);
            rating_status.Value = rating.rateStatus(Session, data);

        }
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Data data = new Data();
        Profile_gl profile = new Profile_gl();
        User_gl user = new User_gl();
        if (user.isLogin(Session) == true)
        {
            data.add("username", user.getUsername(Session));
            profileID.Value = Param.getString("id");
            profileName.Value = Param.getString("profile");
        }
        else
        {
            go("../client/profile.aspx?profile=" + Param.getString("profile") + "&id=" + Param.getString("id"));
        }

        //resize photo in album with top/left negative px value with fixed size image.
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Data data = new Data();
            Profile_gl profile = new Profile_gl();
            User_gl user = new User_gl();
            data.add("username", user.getUsername(Session));
            Data list = profile.select(Param);
            name.Text = list.getString("name");
            trading_hour.Text = list.getString("trading_hour");
            phone.Text = list.getString("phone");
            address.Text = list.getString("address");
            email.Text = list.getString("email");
            summary.Text = list.getString("summary");
            profileID.Value = list.getString("id");

        }
    }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Data data = new Data();
         User_gl user = new User_gl();
         if (user.isLogin(Session) == true)
         {
             data.add("username", user.getUsername(Session));
             profileID.Value = Param.getString("id");
             profileName.Value = Param.getString("profile");
         }
         else
         {
             go("../client/profile.aspx?profile=" + Param.getString("profile") + "&id=" + Param.getString("id"));
         }
         setPageTypeSession(Session, "new_profile");
     }
 }
Exemplo n.º 7
0
    protected void rateClick(object sender, EventArgs e)
    {
        Data data = new Data();
        User_gl user = new User_gl();
        Rating_gl rating = new Rating_gl();
        data.add("username", user.getUsername(Session));
        data.add("value", radioRate.SelectedValue);
        data.add("profile_id", Param.getString("profile_id"));
        data.add("user_id", user.getUserID(data).getString("id"));
        if (Param.getString("rating_status") == "3")
        {
            rating.update(data);
        }
        else if(Param.getString("rating_status") == "1")
        {
            rating.insert(data);
        }

        go("../client/profile.aspx?profile=" + Param.getString("profile_name") +"&id=" + data.getString("profile_id"));
    }
Exemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Photo_gl photo = new Photo_gl();
         User_gl user = new User_gl();
         Data data = new Data();
         Data list = photo.select(Param);
         profileName.Value = Param.getString("profile");
         profileID.Value = Param.getString("id");
         photoView.DataSource = list.Source;
         photoView.DataBind();
         data.add("imageId", Param.getString("image"));
         Data imageList = photo.selectImage(data);
         imagePop.ImageUrl = imageList.getString("path");
         checkImage.Value = imageList.getString("path");
         caption.Text = imageList.getString("caption");
         setPageTypeSession(Session, "photo");
         //set a size for photo album, set overflowhidden, fixed small images and top/left with minus fixed pixels
     }
 }
Exemplo n.º 9
0
 protected void login_Click(object sender, EventArgs e)
 {
     Data data = new Data();
     User_gl user = new User_gl();
     Data result = user.login(Param, Session);
     if (result == null)
     {
         user.checkLogin(Session);
         go("../application/homepage.aspx");
     }
     user.clearSessionError(Session);
     go("../application/homepage.aspx");
     //user.setProfileSession(Session);
     //bool check = user.checkProfile(result);
     //if (check == false)
     //{
     //    go("../client/profile_panel.aspx");
     //}
     //else
     //    user.setProfileSession(Session);
     //    go("../client/profile.aspx");
 }
Exemplo n.º 10
0
        public String rateStatus(HttpSessionState session, Data data)
        {
            User_gl user = new User_gl();
            Rating_gl rating = new Rating_gl();

            if (user.isLogin(session) == false)
            {
                return "2";
            }

            else
            {
                if (rating.checkUserRating(data) == true)
                {
                    return "3";
                }

                else
                {
                    return "1";
                }
            }
        }
Exemplo n.º 11
0
 protected void register_Click(object sender, EventArgs e)
 {
     User_gl user = new User_gl();
     user.register(Param);
 }