private void InitData() { ProjectBll projectBll = new ProjectBll(); ProjectInfo projectInfo = projectBll.GetProjectById(ProjectId); if (projectInfo != null) { lblProjectName.Text = projectInfo.ProjectName; if (projectInfo.CustomerId > 0) { CustomerBll customerBll = new CustomerBll(); CustomerInfo customerInfo = customerBll.GetCustomerById(projectInfo.CustomerId); if (customerInfo != null) { lblCustomerName.Text = customerInfo.CustomerName; } } if (projectInfo.BussinessUserId > 0) { UserInfoBll userInfoBll = new UserInfoBll(); UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.BussinessUserId); if (userInfo != null) { lblBusinessName.Text = userInfo.UserName; } } if (projectInfo.ResponseUserId > 0) { UserInfoBll userInfoBll = new UserInfoBll(); UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.ResponseUserId); if (userInfo != null) { lblResponseName.Text = userInfo.UserName; } hidUserId.Value = projectInfo.ResponseUserId.ToString(); } if (projectInfo.CreatedUserId > 0) { UserInfoBll userInfoBll = new UserInfoBll(); UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.CreatedUserId); if (userInfo != null) { lblCreateUser.Text = userInfo.UserName; } } } }
protected void lbtnDelete_Click(object sender, EventArgs e) { int projectId = 0; int.TryParse(((System.Web.UI.WebControls.WebControl)sender).ToolTip, out projectId); ProjectBll projectBll = new ProjectBll(); projectBll.Delete(projectId); InitGridView(); }
protected void btnSave_Click(object sender, EventArgs e) { ProjectBll projectBll = new ProjectBll(); int responseUserId = 0; int.TryParse(hidUserId.Value, out responseUserId); projectBll.UpdateResponse(ProjectId, responseUserId); Page.RegisterClientScriptBlock("", "<script>alert('保存成功');</script>"); Response.Redirect("BusinessProjectList.aspx"); }
private void InitGridView() { string searchConditon = " and p.ResponseUserId=" + LoginUser.UserId; string projectName = txtProjectName.Text.Trim(); if (txtProjectName.Text.Trim() != "") { searchConditon += " and p.ProjectName like '%" + txtProjectName.Text.Trim() + "%'"; } ProjectBll projectbll = new ProjectBll(); DataSet ds = projectbll.GetManagermentProject(searchConditon); gvDepartmentList.DataSource = ds; gvDepartmentList.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { ProjectBll projectBll = new ProjectBll(); ProjectInfo projectInfo = GetModel(); if (ProjectId == 0) { projectBll.Add(projectInfo); } else { projectInfo.ProjectId = ProjectId; projectBll.Update(projectInfo); } Page.RegisterClientScriptBlock("", "<script>alert('保存成功');</script>"); Response.Redirect("ManagementProjectList.aspx"); }
private void InitGridView() { string searchConditon = " and p.BussinessUserId=" + LoginUser.UserId; string projectName = txtProjectName.Text.Trim(); if (txtProjectName.Text.Trim() != "") { searchConditon += " and p.ProjectName like '%" + txtProjectName.Text.Trim() + "%'"; } ProjectBll projectbll = new ProjectBll(); DataSet ds = projectbll.GetManagermentProject(searchConditon); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gvDepartmentList.DataSource = ds; gvDepartmentList.DataBind(); } else { BindNotRecord(gvDepartmentList); } }
private void InitData() { ProjectBll projectBll = new ProjectBll(); ProjectInfo projectInfo = projectBll.GetProjectById(ProjectId); if(projectInfo!=null &&projectInfo.ProjectId>0) { txtProjectName.Text = projectInfo.ProjectName; ddlCustomerList.SelectedValue = projectInfo.CustomerId.ToString(); UserInfoBll userInfoBll = new UserInfoBll(); UserInfo userInfo = userInfoBll.GetUserListById(projectInfo.BussinessUserId); if(userInfo != null) { lblBusinessName.Text = userInfo.UserName; hidUserId.Value = userInfo.UserId.ToString(); } } }