protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string projectId = Request["projectId"]; if (projectId == null || projectId.Trim().Length == 0) { Javascript.Alert("您未指定项目不能进行此操作!", Page); Javascript.RefreshParentWindowReload(Page); } else { DalOperationAboutProject dalProject = new DalOperationAboutProject(); Project project = dalProject.GetProject(int.Parse(projectId)); if (project == null) { Javascript.Alert("未找到指定项目!", Page); Javascript.RefreshParentWindowReload(Page); } else { this.literal_ProjectName.Text = project.name; this.hf_ProjectId.Value = project.id.ToString(); BindDataItemReim(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string projectId = Request["projectId"]; if (string.IsNullOrWhiteSpace(projectId)) { Javascript.Alert("您未指定要查看的项目!", Page); Javascript.RefreshParentWindowReload(Page); } else { DalOperationAboutProject dalProject = new DalOperationAboutProject(); Project project = dalProject.GetProject(int.Parse(projectId)); if (project == null) { Javascript.Alert("您查看的项目不存在!", Page); Javascript.RefreshParentWindowReload(Page); } else { UserCookiesInfo userCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); string cookieUserNo = userCookiesInfo.userNo; if (project.userNo == cookieUserNo || isAuth(cookieUserNo)) { this.literal_ViewProjectName.Text = project.name; this.literal_UserName.Text = project.userName; DalOperationAboutProjectCategory dalProCate = new DalOperationAboutProjectCategory(); List<ProjectCategory> categoryList = dalProCate.GetProjectCategoryPathById(project.category.id); string categoryPath = ""; bool hasPrefix = false; foreach (ProjectCategory category in categoryList) { categoryPath += ((hasPrefix ? " -> " : "") + category.name); hasPrefix = true; } this.literal_ViewProjectCategory.Text = categoryPath; this.literal_CreatedTime.Text = project.createdTime.ToString(); this.literal_ProjectMemo.Text = project.memo; } else { Javascript.Alert("您无权查看此页面!", Page); Javascript.RefreshParentWindowReload(Page); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string projectId = Request["projectId"]; if (string.IsNullOrWhiteSpace(projectId)) { Javascript.Alert("请指定您要添加报销规则的项目!", Page); Javascript.RefreshParentWindowReload(Page); } else { DalOperationAboutProject dalProject = new DalOperationAboutProject(); DalOperationAboutReim dalReim = new DalOperationAboutReim(); Project project = dalProject.GetProject(int.Parse(projectId.Trim())); List<Reim> reimList = dalReim.GetAllReims(); if (project == null || reimList.Count == 0) { Javascript.Alert("您要添加报销规则的项目不存在或者您未添加任何报销项,请核对后再次操作!", Page); Javascript.RefreshParentWindowReload(Page); } else { this.literal_ProjectName.Text = project.name; this.hf_ProjectId.Value = project.id.ToString(); foreach (Reim reim in reimList) { this.ddlReimLists.Items.Add(new ListItem(reim.name, reim.id.ToString())); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string projectId = Request["projectId"]; string reimId = Request["reimId"]; if (string.IsNullOrWhiteSpace(projectId) || string.IsNullOrWhiteSpace(reimId)) { Javascript.Alert("您未指定要查看的报销记录!", Page); Javascript.RefreshParentWindowReload(Page); } else { DalOperationAboutReim dalReim = new DalOperationAboutReim(); DalOperationAboutProject dalProject = new DalOperationAboutProject(); DalOperationAboutReimItem dalReimItem = new DalOperationAboutReimItem(); Project project = dalProject.GetProject(int.Parse(projectId.Trim())); Reim reim = dalReim.GetReim(int.Parse(reimId.Trim())); if (project == null || reim == null) { Javascript.Alert("您指定的项目或报销项不存在!", Page); Javascript.RefreshParentWindowReload(Page); } else { this.ReimEntry_ProjectValue.Text = dalReimItem.GetReimItemValue(int.Parse(projectId), 0).ToString(); this.ReimEntry_ProjectReimValue.Text = dalReimItem.GetReimItemValue(int.Parse(projectId.Trim()), int.Parse(reimId.Trim())).ToString(); UserCookiesInfo userCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); string cookieUserNo = userCookiesInfo.userNo; if (project.userNo == cookieUserNo || isAuth(cookieUserNo)) { List<ReimItem> reimItems = dalReimItem.GetReimItemsForProjectAndReim(int.Parse(projectId.Trim()), int.Parse(reimId.Trim())); this.ReimEntry_ProjectName.Text = project.name; this.ReimEntry_ReimName.Text = reim.name; if (reimItems == null || reimItems.Count == 0) { this.ReimEntry_ReimItemList.ShowFooter = true; } else { this.ReimEntry_ReimItemList.DataSource = reimItems; this.ReimEntry_ReimItemList.DataBind(); this.ReimEntry_ReimItemList.ShowFooter = false; } } else { Javascript.Alert("您无权查看此页面!", Page); Javascript.RefreshParentWindowReload(Page); } } } } }