protected void Page_Load(object sender, EventArgs e)
        {
            user = (UserDetails)Session["LoggedUser"];
            if (user == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (Request.QueryString["id"] == null)
            {
                Response.Redirect("DashboardHome.aspx");
            }
            dashboardID = int.Parse(Request.QueryString["id"]);
            Dashboard        currentDashboard = new Dashboard();
            List <Dashboard> dashboardlist    = new List <Dashboard>();
            UserLoginClient  client           = new UserLoginClient();

            if (Request.UrlReferrer.AbsolutePath.Equals("/CreateNewDashboard.aspx"))
            {
                user.UserDashboards = client.GetUserDashboards(user.UserId);
            }
            dashboardlist      = user.UserDashboards.ToList();
            currentDashboard   = dashboardlist.Find(dash => dash.DashboardId == dashboardID);
            dashboardName.Text = currentDashboard.DashboardName;
            startMonth.Text    = currentDashboard.StartMonth.ToString();
            endMonth.Text      = currentDashboard.EndMonth.ToString();
            startYear.Text     = currentDashboard.StartYear.ToString();
            endYear.Text       = currentDashboard.EndYear.ToString();
            Description.Text   = currentDashboard.Description;
            AccessRight        = currentDashboard.UserAccessRight.AccessRightName;
        }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     user = (UserDetails)Session["LoggedUser"];
     if (user == null)
         Response.Redirect("Login.aspx");
     if (Request.QueryString["id"] == null)
         Response.Redirect("DashboardHome.aspx");
     dashboardID = int.Parse(Request.QueryString["id"]);
     Dashboard currentDashboard = new Dashboard();
     List<Dashboard> dashboardlist = new List<Dashboard>();
     UserLoginClient client=new UserLoginClient();
     if (Request.UrlReferrer.AbsolutePath.Equals("/CreateNewDashboard.aspx"))
     {
         user.UserDashboards = client.GetUserDashboards(user.UserId);
     }
     dashboardlist = user.UserDashboards.ToList();
     currentDashboard = dashboardlist.Find(dash => dash.DashboardId == dashboardID);
     dashboardName.Text = currentDashboard.DashboardName;
     startMonth.Text =currentDashboard.StartMonth.ToString();
     endMonth.Text = currentDashboard.EndMonth.ToString();
     startYear.Text = currentDashboard.StartYear.ToString();
     endYear.Text = currentDashboard.EndYear.ToString();
     Description.Text = currentDashboard.Description;
     AccessRight = currentDashboard.UserAccessRight.AccessRightName;
 }
コード例 #3
0
 public void Page_Load(object sender, EventArgs e)
 {
     UserDetails user = new UserDetails();
     user = (UserDetails)Session["LoggedUser"];
     if (user == null)
         Response.Redirect("Login.aspx");
     UserLoginClient client = new UserLoginClient();
     UserId = user.UserId;
 }
コード例 #4
0
        public void Page_Load(object sender, EventArgs e)
        {
            Dashboard[] UserDashboards;
            UserDetails user = new UserDetails();

            user = (UserDetails)Session["LoggedUser"];
            if (user == null)
            {
                Response.Redirect("Login.aspx");
            }
            lblDashboardHeader.Text = user.FirstName + " " + user.LastName;
            UserLoginClient client = new UserLoginClient();

            UserId = user.UserId;
            user.UserDashboards = client.GetUserDashboards(user.UserId);
            UserDashboards      = new Dashboard[user.UserDashboards.Count()];
            UserDashboards      = user.UserDashboards;
            if (UserDashboards.Length == 0)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl newDashboard = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                newDashboard.InnerHtml = "<div>You Have NO Dashboards... Create your Dashboards </div>";
                this.DashContainer.Controls.Add(newDashboard);
                return;
            }
            string colorOFdiv = "";
            string imageUrl   = "";

            for (int i = 0; i < UserDashboards.Length; i++)
            {
                if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("READ"))
                {
                    colorOFdiv = "#4a8bc2";
                    imageUrl   = "'Images/Read.png'";
                }
                if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("WRITE"))
                {
                    colorOFdiv = "#91929E";
                    imageUrl   = "'Images/Write.png'";
                }
                if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("ADMIN"))
                {
                    colorOFdiv = "#f37b53";
                    imageUrl   = "'Images/Admin.gif'";
                }
                System.Web.UI.HtmlControls.HtmlGenericControl newDashboard = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                newDashboard.InnerHtml = "<a><div id=\"" + UserDashboards.ElementAt(i).DashboardId + "\" class=\"dashboard\" data-accessRight=\"" + UserDashboards.ElementAt(i).UserAccessRight.AccessRightName + "\" style=\"background-color:" + colorOFdiv + "\"><p class=left>" + UserDashboards.ElementAt(i).DashboardName + "</p><div class=right><img src=" + imageUrl + " class='rotateImage'/></div></div></a>";
                this.DashContainer.Controls.Add(newDashboard);
            }
            if (user.IsOwner == true)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl linkAdminControl = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                linkAdminControl.InnerHtml = "<a href=\"Teams.aspx?companyID=" + user.CompanyId + "\"><div class='button right font16'> Admin Operations </div></a>";
                this.DashContainer.Controls.Add(linkAdminControl);
            }
        }
コード例 #5
0
        public void Page_Load(object sender, EventArgs e)
        {
            Dashboard[] UserDashboards;
            UserDetails user = new UserDetails();
            user = (UserDetails)Session["LoggedUser"];
            if (user == null)
                Response.Redirect("Login.aspx");
            lblDashboardHeader.Text = user.FirstName + " " + user.LastName;
            UserLoginClient client = new UserLoginClient();
            UserId = user.UserId;
            user.UserDashboards = client.GetUserDashboards(user.UserId);
            UserDashboards = new Dashboard[user.UserDashboards.Count()];
            UserDashboards = user.UserDashboards;
            if (UserDashboards.Length == 0)
            {

                System.Web.UI.HtmlControls.HtmlGenericControl newDashboard = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                newDashboard.InnerHtml = "<div>You Have NO Dashboards... Create your Dashboards </div>";
                this.DashContainer.Controls.Add(newDashboard);
                return;
            }
            string colorOFdiv = "";
            string imageUrl = "";
            for (int i = 0; i < UserDashboards.Length; i++)
            {
                if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("READ"))
                {
                    colorOFdiv = "#4a8bc2";
                    imageUrl = "'Images/Read.png'";
                }
                if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("WRITE"))
                {
                    colorOFdiv = "#91929E";
                    imageUrl = "'Images/Write.png'";
                }
                if (UserDashboards.ElementAt(i).UserAccessRight.AccessRightName.Equals("ADMIN"))
                {
                    colorOFdiv = "#f37b53";
                    imageUrl = "'Images/Admin.gif'";

                }
                System.Web.UI.HtmlControls.HtmlGenericControl newDashboard = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                newDashboard.InnerHtml = "<a><div id=\"" + UserDashboards.ElementAt(i).DashboardId + "\" class=\"dashboard\" data-accessRight=\"" + UserDashboards.ElementAt(i).UserAccessRight.AccessRightName + "\" style=\"background-color:" + colorOFdiv + "\"><p class=left>" + UserDashboards.ElementAt(i).DashboardName + "</p><div class=right><img src=" + imageUrl + " class='rotateImage'/></div></div></a>";
                this.DashContainer.Controls.Add(newDashboard);

            }
            if (user.IsOwner == true)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl linkAdminControl = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                linkAdminControl.InnerHtml = "<a href=\"Teams.aspx?companyID=" + user.CompanyId + "\"><div class='button right font16'> Admin Operations </div></a>";
                this.DashContainer.Controls.Add(linkAdminControl);
            }
        }
コード例 #6
0
        public void Page_Load(object sender, EventArgs e)
        {
            UserDetails user = new UserDetails();

            user = (UserDetails)Session["LoggedUser"];
            if (user == null)
            {
                Response.Redirect("Login.aspx");
            }
            UserLoginClient client = new UserLoginClient();

            UserId = user.UserId;
        }
コード例 #7
0
        public void Page_Load(object sender, EventArgs e)
        {
            //startYear.Text = DateTime.Today.Year.ToString();
            //endYear.Text = (DateTime.Today.Year + 1).ToString();
            UserDetails user = new UserDetails();

            user = (UserDetails)Session["LoggedUser"];
            if (user == null)
            {
                Response.Redirect("Login.aspx");
            }
            UserLoginClient client = new UserLoginClient();

            UserId = user.UserId;
        }
コード例 #8
0
 protected void submit_Click(object sender, EventArgs e)
 {
     UserLoginClient client = new UserLoginClient();
     UserDetails user = new UserDetails();
     user = (UserDetails)Session["LoggedUser"];
     int dashboardID = Convert.ToInt32(dashboard.SelectedValue);
     bool result = client.CreateNewDashboardByExistingDashboard(dashboardID, user.UserId, txtName.Text, txtDescription.Text);
     if (result)
     {
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('Dashboard Created');", true);
         Response.Redirect("DashboardHome.aspx");
     }
     else
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('error');", true);
 }
コード例 #9
0
        protected void ChangePasswordPushButton_Click(object sender, EventArgs e)
        {
            UserDetails user = new UserDetails();
            user = (UserDetails)Session["LoggedUser"];
            UserLoginClient client = new UserLoginClient();
            string currentP = CurrentPassword.Text;
            string newP = NewPassword.Text;
            bool res = client.ChangePassword(user.UserId, currentP, newP);
            if (res)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Password set successfully!!!');", true);

            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('error');", true);
            }
        }
コード例 #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Dashboard[] UserDashboards;
     UserDetails user = new UserDetails();
     user = (UserDetails)Session["LoggedUser"];
     if (user == null)
         Response.Redirect("Login.aspx");
     UserLoginClient client = new UserLoginClient();
     user.UserDashboards = client.GetUserDashboards(user.UserId);
     UserDashboards = new Dashboard[user.UserDashboards.Count()];
     UserDashboards = user.UserDashboards;
     for (int i = 0; i < UserDashboards.Length; i++)
     {
         string dashboardName = UserDashboards.ElementAt(i).DashboardName;
         string dashboardID = UserDashboards.ElementAt(i).DashboardId.ToString();
         dashboard.Items.Add(new ListItem(dashboardName, dashboardID));
     }
 }
コード例 #11
0
        protected void submit_Click(object sender, EventArgs e)
        {
            UserLoginClient client = new UserLoginClient();
            UserDetails     user   = new UserDetails();

            user = (UserDetails)Session["LoggedUser"];
            int  dashboardID = Convert.ToInt32(dashboard.SelectedValue);
            bool result      = client.CreateNewDashboardByExistingDashboard(dashboardID, user.UserId, txtName.Text, txtDescription.Text);

            if (result)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('Dashboard Created');", true);
                Response.Redirect("DashboardHome.aspx");
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('error');", true);
            }
        }
コード例 #12
0
        protected void ChangePasswordPushButton_Click(object sender, EventArgs e)
        {
            UserDetails user = new UserDetails();

            user = (UserDetails)Session["LoggedUser"];
            UserLoginClient client   = new UserLoginClient();
            string          currentP = CurrentPassword.Text;
            string          newP     = NewPassword.Text;
            bool            res      = client.ChangePassword(user.UserId, currentP, newP);

            if (res)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Password set successfully!!!');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('error');", true);
            }
        }
コード例 #13
0
 protected void LoginButton_Click(object sender, EventArgs e)
 {
     try
     {
         UserDetails     user      = new UserDetails();
         string          userEmail = UserName.Text;
         string          password  = Password.Text;
         UserLoginClient client    = new UserLoginClient();
         user = client.Authentication(userEmail, password);
         if (user != null)
         {
             Session["LoggedUser"] = user;
             Response.Redirect("DashboardHome.aspx");
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert(Login ID" + ex + ");", true);
     }
 }
コード例 #14
0
ファイル: Login.aspx.cs プロジェクト: rutukulkarni/PMD
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            try
            {
                UserDetails user = new UserDetails();
                string userEmail = UserName.Text;
                string password = Password.Text;
                UserLoginClient client = new UserLoginClient();
                user = client.Authentication(userEmail, password);
                if (user != null)
                {
                    Session["LoggedUser"] = user;
                    Response.Redirect("DashboardHome.aspx");
                }

            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert(Login ID"+ex+");", true);
            }
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Dashboard[] UserDashboards;
            UserDetails user = new UserDetails();

            user = (UserDetails)Session["LoggedUser"];
            if (user == null)
            {
                Response.Redirect("Login.aspx");
            }
            UserLoginClient client = new UserLoginClient();

            user.UserDashboards = client.GetUserDashboards(user.UserId);
            UserDashboards      = new Dashboard[user.UserDashboards.Count()];
            UserDashboards      = user.UserDashboards;
            for (int i = 0; i < UserDashboards.Length; i++)
            {
                string dashboardName = UserDashboards.ElementAt(i).DashboardName;
                string dashboardID   = UserDashboards.ElementAt(i).DashboardId.ToString();
                dashboard.Items.Add(new ListItem(dashboardName, dashboardID));
            }
        }
コード例 #16
0
 public UserLogin()
 {
     client = new UserLoginClient();
 }