예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserID"] != null && Session["UserID"].ToString() != "")
            {
                divmyprofile.Attributes.Add("style", "display");
                dschecklandlord = loginDA.FetchFirstname(Convert.ToInt32(Session["UserID"]));
                string usertype = dschecklandlord.Tables[0].Rows[0]["USER_TYPE"].ToString();
                if (usertype == "Landlord")
                {
                    BindRepeter();
                    BindRepater2();
                }
                Bindratings();

                dsinfo = loginDA.FetchFirstname(Convert.ToInt32(Session["UserID"]));

                if (dsinfo.Tables[0].Rows.Count > 0)
                {
                    lblfirstname.Text     = dsinfo.Tables[0].Rows[0]["FIRST_NAME"].ToString();
                    lbllastname.Text      = dsinfo.Tables[0].Rows[0]["LAST_NAME"].ToString();
                    lblcontactnumber.Text = dsinfo.Tables[0].Rows[0]["PHONE_NUMBER"].ToString();
                    lblemail.Text         = dsinfo.Tables[0].Rows[0]["RECOVERY_EMAIL"].ToString();
                }
            }
            else
            {
                divmyprofile.Attributes.Add("style", "display:none");
                lblinvalidmessage.InnerHtml = "Please Login to see your profile Details.";
                Repeater1.Visible           = false;
            }
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserID"] == null || Session["UserID"].ToString() == "")
     {
         lblmessage.InnerText = "Please Login to View Property list";
         divpropertylisting.Attributes.Add("style", "display:none");
         Repeater1.Visible = false;
     }
     else
     {
         checktenant = LoginDA.FetchFirstname(Convert.ToInt32(Session["UserID"]));
         string usertype = checktenant.Tables[0].Rows[0]["USER_TYPE"].ToString();
         if (usertype == "Tenant")
         {
             divpropertylisting.Attributes.Add("style", "display");
             Repeater1.Visible = true;
             bindproperty();
         }
         else if (usertype == "Admin")
         {
             divpropertylisting.Attributes.Add("style", "display");
             Repeater1.Visible = true;
             bindproperty();
         }
         else
         {
             divpropertylisting.Attributes.Add("style", "display:none");
             Repeater1.Visible    = false;
             lblmessage.InnerText = "You cannot view property because you are a landlord";
         }
     }
 }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserID"] != null && Session["UserID"].ToString() != "")
     {
         divsubmitratings.Attributes.Add("style", "display");
         dsusertype = loginDA.FetchFirstname(Convert.ToInt32(Session["UserID"]));
         if (dsusertype != null && dsusertype.Tables[0].Rows.Count > 0)
         {
             string usertype = string.Empty;
             ViewState["UserType"] = null;
             ViewState["UserType"] = dsusertype.Tables[0].Rows[0]["USER_TYPE"].ToString();
             if (ViewState["UserType"].ToString() == "Tenant")
             {
                 ds = submitratingsDA.FetchRatingDataForTenant(Convert.ToInt32(Session["UserID"]));
                 if (ds != null && ds.Tables[0].Rows.Count > 0)
                 {
                     gridratings.DataSource = ds;
                     gridratings.DataBind();
                 }
                 else
                 {
                     lblinvalidmessage.InnerHtml = "No property found to give ratings.";
                     divsubmitratings.Attributes.Add("style", "display:none");
                 }
             }
             else if (ViewState["UserType"].ToString() == "Landlord")
             {
                 ds = submitratingsDA.FetchRatingDataForLandlord(Convert.ToInt32(Session["UserID"]));
                 if (ds != null && ds.Tables[0].Rows.Count > 0)
                 {
                     gridratings.DataSource = ds;
                     gridratings.DataBind();
                 }
                 else
                 {
                     lblinvalidmessage.InnerHtml = "No property found to give ratings";
                     divsubmitratings.Attributes.Add("style", "display:none");
                 }
             }
             else
             {
                 lblinvalidmessage.InnerHtml = "No property found to give ratings";
                 divsubmitratings.Attributes.Add("style", "display:none");
             }
         }
     }
     else
     {
         lblinvalidmessage.InnerHtml = "Please login to give ratings.";
         gridratings.Visible         = false;
         divsubmitratings.Attributes.Add("style", "display:none");
     }
 }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoginDA loginDA = new LoginDA();
            DataSet dslogin = null;

            dslogin = loginDA.FetchFirstname(Convert.ToInt32(Session["UserID"].ToString()));
            ReportDataSource rd = new ReportDataSource("DataSet1", FetchFirstname((Convert.ToInt32(Session["UserID"].ToString()))));

            ReportViewer1.Reset();
            ReportViewer1.LocalReport.DataSources.Add(rd);
            ReportViewer1.LocalReport.ReportPath = "Report1.rdlc";
        }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserID"] != null && Session["UserID"].ToString() != "")
     {
         dslogin = loginDA.FetchFirstname(Convert.ToInt32(Session["UserID"].ToString()));
         if (dslogin != null && dslogin.Tables[0].Rows.Count > 0)
         {
             string FNAME = dslogin.Tables[0].Rows[0]["FIRST_NAME"].ToString();
             string type  = dslogin.Tables[0].Rows[0]["USER_TYPE"].ToString();
             lblusermessage.InnerHtml = FNAME;
             lbltype.InnerHtml        = "( " + type + " )";
         }
     }
 }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    BindDatestamp();
                    Binduserstatus();
                    Binduuserid();
                    Bindusername();
                    Bindfirstname();
                    Bindlastname();
                    Bindphonenumber();
                    Bindrecoveryemail();
                    Bindsecurityanswer();
                    Bindusertype();

                    dsregister = loginDA.FetchFirstname(Convert.ToInt32(Session["UserID"]));
                    if (dsregister != null && dsregister.Tables[0].Rows.Count > 0)
                    {
                        string password2 = dsregister.Tables[0].Rows[0]["DBA_PASSWORD"].ToString();
                        if (password2 != null && password2 != "")
                        {
                            BindGridviewdata();
                            GridView1.Visible = true;
                        }
                        else
                        {
                            lblmessage.InnerHtml = "Admin rights needed to Update Database";
                            GridView1.Visible    = false;
                        }
                    }
                    else
                    {
                        lblmessage.InnerHtml = "Please login as a DBA to Update Database.";
                        GridView1.Visible    = false;
                    }
                }
            }
            catch (Exception EX)
            {
            }
        }
예제 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserID"] != null && Session["UserID"].ToString() != "")
     {
         dschecklandlord = LoginDA.FetchFirstname(Convert.ToInt32(Session["UserID"]));
         string usertype = dschecklandlord.Tables[0].Rows[0]["USER_TYPE"].ToString();
         if (usertype == "Landlord" || usertype == "Admin")
         {
             divproperty.Attributes.Add("style", "display");
         }
         else
         {
             lblinvalidmessage.InnerHtml = "You cannot post property, because you are a Tenant.";
         }
     }
     else
     {
         lblinvalidmessage.InnerHtml = "Please login to post property.";
         divproperty.Attributes.Add("style", "display:none");
     }
 }