Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ProjectList.aspx.cs
Package: ASP[1].NET.rar [view]
Upload User: autodoor
Upload Date: 2022-08-04
Package Size: 9973k
Code Size: 4k
Category:
.net
Development Platform:
Others
- using System;
- using System.Web.UI.WebControls;
- using qminoa.BLL.PM;
- namespace qminoa.Webs.PM
- {
- public class ProjectList : qminoa.Webs.PageBase
- {
- public const string UserRoleNone = "0";
- public const string UserRoleAdministrator = "1";
- public const string UserRoleProjectManager = "2";
- public const string UserRoleConsultant = "3";
- protected System.Web.UI.WebControls.LinkButton LinkButton1;
- protected System.Web.UI.WebControls.Button NewProjectButton;
- protected System.Web.UI.WebControls.DataGrid ProjectsGrid;
- private PMUser _user;
- private void Page_Load(object sender, System.EventArgs e)
- {
- this.PageBegin("项目管理",true);
- _user = new PMUser(Convert.ToInt16(this.Empid));
- if(_user.Role == UserRoleConsultant || _user.Role == UserRoleNone)
- {
- Response.Redirect(Application["vRoot"]+"/login.aspx");
- }
- if (!IsPostBack)
- {
- BindProjects();
- }
- }
- private void BindProjects()
- {
- ProjectsCollection projectList = Project.GetProjects(_user.UserID, _user.Role);
- SortGridData(projectList, SortField, SortAscending);
- ProjectsGrid.DataSource = projectList;
- ProjectsGrid.DataBind();
- }
- private void SortGridData(ProjectsCollection list, string sortField, bool asc)
- {
- ProjectsCollection.ProjectFields sortCol = ProjectsCollection.ProjectFields.InitValue;
- switch(sortField)
- {
- case "Name":
- sortCol = ProjectsCollection.ProjectFields.Name;
- break;
- case "Manager":
- sortCol = ProjectsCollection.ProjectFields.ManagerUserName;
- break;
- case "Completion":
- sortCol = ProjectsCollection.ProjectFields.CompletionDate;
- break;
- case "Duration":
- sortCol = ProjectsCollection.ProjectFields.Duration;
- break;
- default:
- break;
- }
- list.Sort(sortCol, asc);
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.NewProjectButton.Click += new System.EventHandler(this.NewProjectButton_Click);
- this.ProjectsGrid.SortCommand += new System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.ProjectsGrid_Sort);
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- private void NewProjectButton_Click(object sender, System.EventArgs e)
- {
- Response.Redirect("ProjectDetails.aspx", false);
- }
- protected void ProjectsGrid_Page(Object sender, DataGridPageChangedEventArgs e)
- {
- ProjectsGrid.CurrentPageIndex = e.NewPageIndex;
- BindProjects();
- }
- private void ProjectsGrid_Sort(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
- {
- SortField = e.SortExpression;
- BindProjects();
- }
- string SortField
- {
- get
- {
- object o = ViewState["SortField"];
- if (o == null)
- {
- return String.Empty;
- }
- return (string)o;
- }
- set
- {
- if (value == SortField)
- {
- SortAscending = !SortAscending;
- }
- ViewState["SortField"] = value;
- }
- }
- bool SortAscending
- {
- get
- {
- object o = ViewState["SortAscending"];
- if (o == null)
- {
- return true;
- }
- return (bool)o;
- }
- set
- {
- ViewState["SortAscending"] = value;
- }
- }
- }
- }