//编辑部门 protected void Button2_Click(object sender, EventArgs e) { CheckboxShowUser.Visible = false; DDL_COLUMN.Visible = true; Tr_3.Visible = false; ShowUser.Visible = false; //显示可供参与的部门信息 。 project_model = project_bll.GetModel(int.Parse(Session["Work_ProjectId"].ToString())); DataTable dt_dep = new DataTable(); string sql1 = " SELECT ID, NAME FROM USER_Groups WHERE (DELFLAG = 0) AND (TAGS = '部门') ORDER BY ISMOREN "; dt_dep = pagedosql.doSql(sql1).Tables[0]; if (dt_dep.Rows.Count > 0) { CB_DepartmentID.DataSource = dt_dep.DefaultView; CB_DepartmentID.DataTextField = "NAME"; CB_DepartmentID.DataValueField = "ID"; CB_DepartmentID.DataBind(); //在项目表中的部门字段 string DepartmentID = project_model.DepartmentID.ToString(); //因为在项目表中部门以‘,’分开。故以‘,’将其分割 string[] Department = DepartmentID.Split(','); for (int i = 0; i < dt_dep.Rows.Count; i++) { for (int j = 0; j < Department.Length; j++) { if (Department[j].ToString() == CB_DepartmentID.Items[i].Value.ToString()) { CB_DepartmentID.Items[i].Selected = true; } } } } else//因为参与部门是非空项,所以如果没有可供参与的部门的话,是不可以进行项目的申请的。 { CB_DepartmentID.Enabled = false; Button_sumbit2.Enabled = false; } }
/// <summary> /// 点击确定触发事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_sumbit_onclick(object sender, EventArgs e) { try { string flag = "审核不通过"; Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; //项目ID string ID = Request["ID"]; project_model = project_bll.GetModel(int.Parse(ID)); //审批结果 string Status = RadioButtonList_Check.SelectedValue; if (!(TB_DoNote.Text.ToString().Equals(""))) { //审批意见 project_model.DoNote = project_model.DoNote + user_model.REALNAME + "(" + user_model.USERNAME + "): " + DateTime.Now + "</br> " + TB_DoNote.Text.ToString() + "</br></br>"; } if (!(Status.Equals("3")))//只有当这个审批人直接将此项目定为通过或是不通过时才去更新审批时间和状态及审批人 { //审批时间 project_model.ReadTime = DateTime.Now; //审批人员 project_model.DoUserID = user_model.ID; //审批结果 project_model.Status = int.Parse(Status); project_bll.Update(project_model); //******************在移交了项目审批人之后。还需要将自己的审核意见更改过来,并且将Isturn改成已经审核过了 string sql_checkuser = "******" + Status + ", Infors = Infors + '" + TB_DoNote.Text.ToString() + "</br>' WHERE (ProjectID = " + project_model.ID + ") AND (UserID = '" + user_model.ID + "') "; pageControl.doSql(sql_checkuser); } else//如果是转交给别的人。则需要往Project_ShenheList里加一条记录 { //审批结果 project_model.Status = 0; //审批人 project_model.DoUserID = DDL_CheckUserList.SelectedValue.ToString();//改成新的审批人 project_bll.Update(project_model); //******************如果此审批者将此项目转给了其他人,则要根据所选择的移交审批人,将此项目发送给这个人,即向Project_ShenheList加条记录 Dianda.BLL.Project_ShenheList Shenhe_bll = new Dianda.BLL.Project_ShenheList(); Dianda.Model.Project_ShenheList Shenhe_model = new Dianda.Model.Project_ShenheList(); //在添加记录之前先检查是不是有该条记录了 //做这一步的目的是:在立项时已经根据当时所选择的审批人往Project_ShenheList里加了一条记录 //如果第一次移交给另一个人,而这个人审批时发现不属于自己审批,又转回给第一个人, //这样如果再添加就会出现同一个项目,同一个审批人出现多条数据了。 string sqlwhere = "(ProjectID = " + project_model.ID + ") AND (UserID = '" + DDL_CheckUserList.SelectedValue.ToString() + "') "; List <Dianda.Model.Project_ShenheList> Li = Shenhe_bll.GetModelList(sqlwhere); if (Li.Count > 0) { string sql_changecheckuser = "******" + sqlwhere; pageControl.doSql(sql_changecheckuser); } else { //ID Shenhe_model.ID = Shenhe_bll.GetMaxId(); //需要审核的项目ID Shenhe_model.ProjectID = project_model.ID; //审核人的ID Shenhe_model.UserID = DDL_CheckUserList.SelectedValue.ToString(); //审核状态(新建默认时默认为0:待审核) Shenhe_model.Status = 0; //是否到当前的用户审核:0表示未到;1表示到;2表示已经审核过 Shenhe_model.Isturn = 1; //审核意见 Shenhe_model.Infors = ""; //向Project_ShenheList加条记录 Shenhe_bll.Add(Shenhe_model); } //******************在移交了项目审批人之后。还需要将自己的审核意见更改过来,并且将Isturn改成已经审核过了 string sql_checkuser = "******" + TB_DoNote.Text.ToString() + "</br>' WHERE (ProjectID = " + project_model.ID + ") AND (UserID = '" + user_model.ID + "') "; pageControl.doSql(sql_checkuser); ////******************项目移交给别人审核后,需要将原来在Project_Project中的审核人改成新的审核人 //string sql_changechecker = " UPDATE Project_Projects SET Status = 0,DoUserID='" + DDL_CheckUserList.SelectedValue.ToString() + "' WHERE (ID = " + project_model.ID + ")"; //pageControl1.doSql(sql_changechecker); flag = "移交审核"; } if (Status.Equals("1"))//表示审批通过 { flag = "审核通过"; if (project_model.CashCardID == 0)//如果资金卡为0,表示新建资金卡 { string sql = " UPDATE Cash_Message SET Status = 1 WHERE (ProjectID = " + project_model.ID + ")"; pageControl.doSql(sql); } //项审批成功以后,要向Document_Folder中添加一个当前用户的顶级档案目录 Dianda.Model.Document_Folder docfolder_model = new Dianda.Model.Document_Folder(); Dianda.BLL.Document_Folder docfolder_bll = new Dianda.BLL.Document_Folder(); int id = docfolder_bll.GetMaxId(); docfolder_model.ID = id; //目录名称 docfolder_model.FolderName = project_model.NAMES; //上级目录 docfolder_model.UpID = 38; //文件夹的属性 docfolder_model.Types = "public"; //是否共享 docfolder_model.IsShare = 0; //创建的用户 docfolder_model.UserID = user_model.ID; //删除标记 docfolder_model.DELFLAG = 0; //当前时间 docfolder_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString()); //栏目的路径记录(用/来隔开) docfolder_model.COLUMNSPATH = "-1/38/" + docfolder_model.ID; //项目ID docfolder_model.ProjectID = int.Parse(ID); //栏目显示的顺序 docfolder_model.SHUNXU = 0; //栏目的路径名称 docfolder_model.PNAMES = "项目文档>" + project_model.NAMES; //当前文件夹中文件的大小 docfolder_model.SizeOf = "0"; docfolder_bll.Add(docfolder_model); if (null != project_model.Attachments && !(project_model.Attachments.ToString().Equals(""))) { setAttachmentsToDocument(user_model.ID, id.ToString(), project_model.Attachments.ToString());//将立项申请时的上传附件保存到项目的目录中 } //项审批成功以后往信息栏目表中添加一条记录 Dianda.BLL.News_ColumnsExt columnsext = new Dianda.BLL.News_ColumnsExt(); columnsext.addCloumns(project_model.NAMES, "PROJECT", project_model.ID.ToString(), 2); } //给业务申请者发信息 Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage(); BLL.FaceShowMessage bFaceShowMessage = new Dianda.BLL.FaceShowMessage(); mFaceShowMessage.DATETIME = DateTime.Now; mFaceShowMessage.FromTable = "项目审核"; mFaceShowMessage.IsRead = 0; mFaceShowMessage.NewsID = null; mFaceShowMessage.NewsType = "项目审核"; mFaceShowMessage.ReadTime = null; mFaceShowMessage.DELFLAG = 0; mFaceShowMessage.ProjectID = project_model.ID; mFaceShowMessage.Receive = project_model.SendUserID.ToString(); mFaceShowMessage.URLS = "<a href='/Admin/personalProjectManage/OAproject/manage.aspx?projectstatus=1' target='_self' title='项目审核:审核时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + " " + flag + "</a> (" + user_model.REALNAME + ")"; bFaceShowMessage.Add(mFaceShowMessage); //给业务申请者发信息 if (Status.Equals("3")) { //如果项目的审批者将此项目重新转移交给了另一个审批者,那么则需要发二个提示信息,一是新的项目审批者,第二个就是原来的项目审批者 //给新的项目审批者发送信息 mFaceShowMessage.DATETIME = DateTime.Now; mFaceShowMessage.FromTable = "立项申请"; mFaceShowMessage.IsRead = 0; mFaceShowMessage.NewsID = null; mFaceShowMessage.NewsType = "立项申请"; mFaceShowMessage.ReadTime = null; mFaceShowMessage.DELFLAG = 0; mFaceShowMessage.ProjectID = project_model.ID; mFaceShowMessage.Receive = DDL_CheckUserList.SelectedValue.ToString(); //mFaceShowMessage.URLS = "<a href='/Admin/personalProjectManage/OAproject/manage.aspx?projectstatus=1' target='_self' title='项目移交:移交时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + " (移交审核)</a>"; mFaceShowMessage.URLS = "<a href='/Admin/SystemProjectManage/ProjectCheck/check.aspx?ID=" + project_model.ID.ToString() + "&pageindex=1&Status=0' target='_self' title='移交审核:移交时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + " 移交审核</a> (" + user_model.REALNAME + ")"; bFaceShowMessage.Add(mFaceShowMessage); //给新的项目审批者发送信息 } //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "&Status=" + Request["Status"] + "\";</script>"; //Response.Write(coutws); ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入列表页面');javascript:location='manage.aspx?pageindex=" + Request["pageindex"] + "&Status=" + Request["Status"] + "';</script>", false); //添加操作日志 Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt(); bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "系统项目管理", "审核" + flag + project_model.NAMES + "项目" + ":成功!"); //添加操作日志 } catch { } }
/// <summary> /// 点击撤销按钮触发的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_revoke_onclick(object sender, EventArgs e) { int num = 0; int rows = GridView1.Rows.Count; if (rows > 0) { for (int i = 0; i < rows; i++) { CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox_choose"); if (cb.Checked) { num = num + 1; } } if (num == 0) { tag.Text = "撤销时最少选择一条数据!"; } else { tag.Text = ""; for (int j = 0; j < rows; j++) { CheckBox cb1 = (CheckBox)GridView1.Rows[j].Cells[0].FindControl("CheckBox_choose"); HiddenField hid = (HiddenField)GridView1.Rows[j].Cells[0].FindControl("Hid_ID"); if (cb1.Checked && cb1.Enabled) { //获取业务的基本信息 apply_model = apply_bll.GetModel(int.Parse(hid.Value.ToString())); //将删除标记设为1 //apply_model.DELFLAG = 1; //将状态调为不通过 apply_model.Status = 2; //申请类型 string applytype = apply_model.AppType; string tablename = ""; string typeflag = ""; if (applytype.Equals("orderFood")) { tablename = "Project_Apply_orderFood"; typeflag = "订饭申请"; } else if (applytype.Equals("orderCar")) { tablename = "Project_Apply_orderCar"; typeflag = "订车申请"; } else if (applytype.Equals("orderRoom")) { tablename = "Project_Apply_orderRoom"; typeflag = "订会议室申请"; } else if (applytype.Equals("orderSignet")) { tablename = "Project_Apply_signet"; typeflag = "印章申请"; } // string sql = " DELETE FROM " + tablename + " WHERE ApplyID = " + hid.Value.ToString(); apply_bll.Update(apply_model); // pageControl.doSql(sql); //添加操作日志 Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt(); Dianda.Model.Project_Projects project_model = new Dianda.Model.Project_Projects(); Dianda.BLL.Project_Projects project_bll = new Dianda.BLL.Project_Projects(); project_model = project_bll.GetModel(Convert.ToInt16(Session["Work_ProjectId"])); bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "业务申请撤销", project_model.NAMES + "项目" + typeflag + "撤销:成功!"); //添加操作日志 } } //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + pageindexHidden.Value.ToString() + "&status=" + DDL_status.SelectedValue.ToString() + "\";</script>"; //Response.Write(coutws); ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入我的项目页面');javascript:location='manage.aspx?pageindex=" + pageindexHidden.Value.ToString() + "&type=" + DDL_type.SelectedValue + "&status=" + DDL_status.SelectedValue.ToString() + "';</script>", false); } } }
/// <summary> /// 确定按钮触发事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_submit_Click(object sender, EventArgs e) { try { project_model = project_bll.GetModel(int.Parse(Session["Work_ProjectId"].ToString())); if (null != Request["role"] && Request["role"].ToString().Equals("manager")) { //说明是领导审批项目经费时重新上传的预算表单 } else { if (project_model.TEMP1.Equals("1") || project_model.TEMP1.Equals("3")) { tag.Text = "该项目上传的预算表单已经审核通过!不能再次上传!"; return; } if (FileUpload_list.FileName.Length <= 0) { tag.Text = "上传预算表单项不能为空!"; return; } } if (FileUpload_list.FileName.Length > 2) { string[] content = fileup.UpFile_COMMONS(FileUpload_list, "/AllFileUp/fileup", ""); //1-成功;0-失败;2-类型不支持;3-大小不符合;文件的路径;文件名称;文件类型;图标;大小;操作结果 if (content[0] == "0") { tag.Text = "文件上传失败,请重新上传!"; return; } else if (content[0] == "2") { tag.Text = "系统不允许此类文件上传,文件上传失败,请重新上传!"; return; } else if (content[0] == "3") { tag.Text = "文件上传大小不符合,文件上传失败,请重新上传!"; return; } if (null != Request["role"] && Request["role"].ToString().Equals("manager")) { project_model.BudgetList = project_model.BudgetList + "@" + content[1]; } else { project_model.BudgetList = content[1]; } } if (!CashTotal.Text.ToString().Equals("")) { if (null != Request["role"] && Request["role"].ToString().Equals("manager")) { if (RB_cashtotal.SelectedValue.ToString().Equals("1"))//表示经费单位选择的是万元 { //领导在审批时重新上传预算表单时重新写的经费额。 project_model.TEMP2 = (Convert.ToDecimal(CashTotal.Text.ToString())).ToString() + "万元"; } else { project_model.TEMP2 = (Convert.ToDecimal(CashTotal.Text.ToString())).ToString() + "元"; } } else { if (RB_cashtotal.SelectedValue.ToString().Equals("1"))//表示经费单位选择的是万元 { //经费额度存放的是元 project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString()) * 10000; //经费单位 project_model.CashDw = "万元"; } else { project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString()); //经费单位 project_model.CashDw = "元"; } } } //预算表单的审核状态 if (null != Request["role"] && Request["role"].ToString().Equals("manager")) { // } else { project_model.TEMP1 = "0"; } project_bll.Update(project_model); //给业务申请者发信息 Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage(); Model.FaceShowMessage mFaceShowMessage2 = new Dianda.Model.FaceShowMessage(); BLL.FaceShowMessage bFaceShowMessage = new Dianda.BLL.FaceShowMessage(); //DataTable dt = bFaceShowMessage.GetList("FromTable='预算表单' and NewsType='预算表单审批' and ProjectID='" + project_model.ID.ToString() + "'").Tables[0]; List <Model.FaceShowMessage> facelist = bFaceShowMessage.GetModelList("FromTable='预算表单' and NewsType='预算表单审批' and ProjectID='" + project_model.ID.ToString() + "'"); mFaceShowMessage.DATETIME = DateTime.Now; mFaceShowMessage.FromTable = "预算表单"; mFaceShowMessage.IsRead = 0; mFaceShowMessage.NewsID = null; mFaceShowMessage.NewsType = "预算表单审批"; mFaceShowMessage.ReadTime = null; mFaceShowMessage.DELFLAG = 0; mFaceShowMessage.ProjectID = project_model.ID; mFaceShowMessage.Receive = project_model.DoUserID.ToString();//当前项目的审核人的ID mFaceShowMessage.URLS = "<a href='/Admin/budgetManage/manage.aspx?role=manager' target='_self' title='项目预算表单'>" + project_model.NAMES.ToString() + " 预算表单 待审</a>"; if (facelist.Count > 0) { mFaceShowMessage2 = facelist[0]; mFaceShowMessage2.DELFLAG = 1; // mFaceShowMessage.ID = int.Parse(dt.Rows[0]["ID"].ToString()); bFaceShowMessage.Update(mFaceShowMessage2); bFaceShowMessage.Add(mFaceShowMessage); } else { bFaceShowMessage.Add(mFaceShowMessage); } //给业务申请者发信息 string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"预算表单上传成功! \");window.close();</script>"; Response.Write(coutws); } catch { } }
/// <summary> /// 点击删除按钮触发的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_delete_onclick(object sender, EventArgs e) { int num = 0; int rows = GridView1.Rows.Count; if (rows > 0) { for (int i = 0; i < rows; i++) { CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox_choose"); if (cb.Checked) { num = num + 1; } } if (num == 0) { tag.Text = "删除时最少选择一条数据!"; } else { tag.Text = ""; for (int j = 0; j < rows; j++) { CheckBox cb1 = (CheckBox)GridView1.Rows[j].Cells[0].FindControl("CheckBox_choose"); HiddenField hid = (HiddenField)GridView1.Rows[j].Cells[0].FindControl("Hid_ID"); if (cb1.Checked) { //获取到当前项目的基本信息 projects_model = projects_bll.GetModel(int.Parse(hid.Value.ToString())); //将删除标记设为1 projects_model.DELFLAG = 1; projects_bll.Update(projects_model); //同时删除faceshowmessage中的projectid = ID,的数据,同时置DELFLAG=1; Dianda.BLL.Project_ProjectsExt projectsExt = new Dianda.BLL.Project_ProjectsExt(); string sqlwhere = " ProjectID = '" + hid.Value.ToString() + "'"; projectsExt.DeleteTableData(sqlwhere, "FaceShowMessage"); //添加操作日志 Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt(); Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "系统项目管理", "删除" + projects_model.NAMES + "项目成功"); //添加操作日志 } } //tag.Text = "操作成功!"; //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "\";</script>"; //Response.Write(coutws); ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入我的项目页面');javascript:location='manage.aspx?projectStatus=" + Request["projectstatus"].ToString() + "';</script>", false); } } }
/// <summary> /// 确定添加新任务 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_sumbit_Click(object sender, EventArgs e) { try { project_model = project_bll.GetModel(Convert.ToInt16(Session["Work_ProjectId"])); string taskname = NAME.Text.ToString(); //检查是否有该用户组名称 bool checkName = pagecontrol.Exists_TaskName("Project_Task", "NAMES", taskname, "ID", "", Convert.ToInt16(Session["Work_ProjectId"])); if (checkName) { tag.Text = "该任务标题已经存在,请修改!"; } else { //ID task_model.ID = task_bll.GetMaxId(); //项目ID task_model.ProjectID = Convert.ToInt16(Session["Work_ProjectId"]); //任务标题 task_model.NAMES = taskname; //删除标记录 task_model.DELFLAG = 0; //状态 task_model.Status = int.Parse(RadioButtonList_status.SelectedValue.ToString()); string time = TB_StartTime.Value.ToString() + " 00:00:00"; //if (time == DateTime.Now.ToShortDateString()) //{ // time += " " + DateTime.Now.ToString("HH:mm:ss"); //} //else //{ // time += " 00:00:00"; //} //开始时间 task_model.StartTime = Convert.ToDateTime(time); //结束时间 task_model.EndTime = Convert.ToDateTime(TB_EndTime.Value.ToString() + " 23:59:59"); //任务描述 task_model.Overviews = Overviews.Text.ToString(); //任务的发布时间 task_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString()); //发布这个任务的用户的ID Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; task_model.SendUserID = user_model.ID; string userids = ""; string usernames = ""; for (int i = 0; i < CB_usersID.Items.Count; i++) { if (CB_usersID.Items[i].Selected == true) { userids = userids + CB_usersID.Items[i].Value + ",0" + ";"; if (usernames.Equals("")) { usernames = CB_usersID.Items[i].Text; } else { usernames = usernames + "; " + CB_usersID.Items[i].Text; } //给参与此任务的用户发信息 Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage(); BLL.FaceShowMessage bFaceShowMessage = new Dianda.BLL.FaceShowMessage(); mFaceShowMessage.DATETIME = DateTime.Now; mFaceShowMessage.FromTable = "项目任务"; mFaceShowMessage.IsRead = 0; mFaceShowMessage.NewsID = null; mFaceShowMessage.NewsType = "项目任务"; mFaceShowMessage.ReadTime = null; mFaceShowMessage.Receive = CB_usersID.Items[i].Value; mFaceShowMessage.DELFLAG = 0; mFaceShowMessage.ProjectID = project_model.ID; mFaceShowMessage.URLS = "<a href='/Admin/personalProjectManage/OAtask/manage.aspx?ID=" + task_model.ProjectID + "' target='_self' title='新建任务:新建时间" + DateTime.Now.ToString() + "'>新建任务:" + taskname + "</a> " + project_model.NAMES + " (" + user_model.REALNAME + ")"; bFaceShowMessage.Add(mFaceShowMessage); //给参与此任务的用户发信息 } } //参与的用户的ID try { task_model.UserIDs = userids.Substring(0, userids.Length - 1); } catch { tag.Text = "请至少选择一个参与人员!"; return; } //参与人员名称:真实姓名+'('+用户名+‘)’; task_model.UserInfo = usernames; if (!DDL_UpID.SelectedValue.ToString().Equals("")) { //父任务 task_model.UpID = int.Parse(DDL_UpID.SelectedValue.ToString()); } else { //父任务 task_model.UpID = 0; } //是否可建子任务 task_model.IsFather = int.Parse(RadioButtonList_IsFather.SelectedValue.ToString()); //上传文档 task_model.CompleteType = int.Parse(RadioButtonList_doc.SelectedValue.ToString()); task_bll.Add(task_model); //tag.Text = "操作成功!"; //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?ID=" + project_model.ID+ "\";</script>"; //Response.Write(coutws); //ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入列表页面');javascript:location='manage.aspx?ID=" + project_model.ID +"&status=" + Request.QueryString["status"].ToString()+"';</script>", false); ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入列表页面');javascript:location='manage.aspx?ID=" + project_model.ID + "';</script>", false); //ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入我的项目页面');javascript:location='manage.aspx?projecttype=4&projectStatus=0';</script>", false); //添加操作日志 Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt(); bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "项目中新增任务", project_model.NAMES + "项目" + task_model.NAMES + "任务:添加成功!"); //添加操作日志 } } catch { tag.Text = "操作失败,请重试!"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ApplyCount = 0; //项目ID if (Session["Work_ProjectId"] != null) { projectid = Session["Work_ProjectId"].ToString(); GetddlStatas(); string count = dtrowsHidden.Value.ToString(); if (count.Length == 0) { setRowCout();//获取当前状态下有多少条数据记录,为分页提供页数和全部条数服务 count = dtrowsHidden.Value.ToString(); } else { count = "0"; } int countint = int.Parse(count); string pageindex = null;//这里是为分页服务的 if (pageindex == null || pageindex == "") { pageindex = "1"; } int pageindex_int = int.Parse(pageindex); BindData(pageindex_int); /*设置模板页中的管理值*/ (Master.FindControl("Label_navigation") as Label).Text = "项目 > 我的项目 > 项目经费 > 经费列表 "; /*设置模板页中的管理值*/ //项目状态 bool Project_Status = BProject_Status.ProjectStatus(Session["Work_ProjectId"].ToString()); //根据项目状态设置页面按钮状态 if (Project_Status == false) { Button_add.Enabled = Project_Status; Button_sumbit.Enabled = Project_Status; Button_list.Enabled = Project_Status; } project_model = project_bll.GetModel(int.Parse(Session["Work_ProjectId"].ToString())); if (project_model.ProjectType == 0)//个人/临时项目不存在经费和项目审批人。。所以是不可以上传预算表单的 { Button_list.Visible = false; } else { //只有项目的创建者和负责人才能点击此功能,并且该预算表单状态是待审核或审核不通过 Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; if ((project_model.SendUserID.ToString() == user_model.ID.ToString() || project_model.LeaderID.ToString() == user_model.ID.ToString()) && !(project_model.TEMP1.ToString() == "1" || project_model.TEMP1.ToString() == "3")) { Button_list.Visible = true; } else { Button_list.Visible = false; } } } } }
/// <summary> /// /// </summary> /// <param name="ProjectId"></param> protected void ShowProjectInfo(string ProjectId) { //获取到项目的基本信息 project_model = project_bll.GetModel(int.Parse(ProjectId)); //项目类型 if (project_model.ProjectType.ToString().Equals("0"))//如果是个人/临时项目 { //审批人 div_CheckUserID.Visible = false; //预计经费 div_CashTotal.Visible = false; RL_ProjectType.SelectedValue = "0"; } else { //审批人 div_CheckUserID.Visible = true; //预计经费 div_CashTotal.Visible = true; RL_ProjectType.SelectedValue = "1"; } //项目类型是不可以进行编辑的 RL_ProjectType.Enabled = false; //项目名称 NAME.Text = project_model.NAMES; //项目预计起始时间 TB_StartTime.Value = Convert.ToDateTime(project_model.StartTime.ToString()).ToString("yyyy-MM-dd"); //项目预计结束时间 TB_EndTime.Value = Convert.ToDateTime(project_model.EndTime.ToString()).ToString("yyyy-MM-dd"); //项目概要 Overviews.Value = project_model.Overviews.ToString(); if (RL_ProjectType.SelectedValue.ToString().Equals("1"))//当项目类型为正常项目时才有预计经费项 { //经费单位 if (project_model.CashDw != null && project_model.CashDw.ToString().Equals("万元")) { RB_cashtotal.SelectedValue = "1"; //预计经费 CashTotal.Text = (Convert.ToDecimal(project_model.CashTotal.ToString()) / 10000).ToString(); } else { RB_cashtotal.SelectedValue = "0"; //预计经费 CashTotal.Text = project_model.CashTotal.ToString(); } } //资金卡选择 string CashCardID = project_model.CashCardID.ToString(); if (!project_model.Attachments.Equals("")) { //老的文件的地址 HiddenField_oldpath.Value = project_model.Attachments.ToString(); LB_view.Text = "<a href='" + project_model.Attachments.ToString() + "' target='_blank'>点击查看附件</a>"; } else { LB_view.Visible = false; } //如果资金卡为0,说明在新建项目时选择的是新建资金卡 //if (CashCardID.Equals("0")) //{ // div_cash.Visible = true; // RB_NewAddCashCard.Checked = true; // RB_CashCardID.Checked = false; // DataSet ds = cashmessage_bll.GetList(" ProjectID = " + project_model.ID); // if (ds.Tables[0].Rows.Count>0) // { // //资金卡初始金额 // TB_LimitNums.Text = ds.Tables[0].Rows[0]["LimitNums"].ToString(); // //新建备注说明 // TB_Notes.Text = ds.Tables[0].Rows[0]["Notes"].ToString(); // } //} //else //{ // div_cash.Visible = false; // RB_NewAddCashCard.Checked = false; // RB_CashCardID.Checked = true; //} }
/// <summary> /// /// </summary> protected void InitInfo() { try { bool TnF = false; //判断当前是否是新建资源 string apply = ""; //表示并非从主菜单上点的“资源” if (null == Request["apply"]) { project_model = project_bll.GetModel(Convert.ToInt16(Session["Work_ProjectId"])); //显示项目名称 LB_Project.Text = project_model.NAMES.ToString(); DDL_Project.Visible = false; LB_Project.Visible = true; Control.Visible = true; //Button_viewhistroy.Visible = false; Button_reback.Visible = true; //ordertype.Visible = false } else { DataTable dt_project = (DataTable)Session["Project_Projects"]; apply = Request["apply"]; TnF = true; //ordertype.Visible = true; if (dt_project.Rows.Count > 0) { DDL_Project.Visible = true; LB_Project.Visible = false; for (int i = 0; i < dt_project.Rows.Count; i++) { //项目名称 string projectName = dt_project.Rows[i]["NAMES"].ToString(); //项目ID string projectID = dt_project.Rows[i]["ID"].ToString(); //删除标记 string DELFLAG = dt_project.Rows[i]["DELFLAG"].ToString(); if (DELFLAG.Equals("0"))//只选择Session["Project_Projects"]中没有被删除的项目 { ListItem li = new ListItem(projectName, projectID); DDL_Project.Items.Add(li); if (null != Request["project"] && Request["project"].ToString().Equals(li.Value.ToString())) { li.Selected = true; } } } } Control.Visible = false; //Button_viewhistroy.Visible = true; //如果是从主菜单的“资源汇总”列表页面上点的“新建”,则进入到新增页面是需要保留“返回”按钮的; if (null != Request["order"] && Request["order"].ToString().Equals("orderresource")) { Button_reback.Visible = true; } else { Button_reback.Visible = false; } for (int i = 0; i < DDL_AppType.Items.Count; i++) { if (DDL_AppType.Items[i].Value.ToString().Equals(Request["apply"].ToString())) { DDL_AppType.Items[i].Selected = true; } } } ShowMain(apply, TnF); //部门下拉列表 DataTable dt1 = new DataTable(); string sql1 = " SELECT ID,NAME FROM USER_Groups WHERE (TAGS = '部门') AND (DELFLAG = 0) GROUP BY ID,NAME "; dt1 = pageControl.doSql(sql1).Tables[0]; for (int i = 0; i < dt1.Rows.Count; i++) { string DepartName = dt1.Rows[i]["NAME"].ToString(); string ID = dt1.Rows[i]["ID"].ToString(); ListItem li = new ListItem(DepartName, ID); DDL_Department.Items.Add(li); } //设置部门列表的选定值 Dianda.Model.USER_Users userModel = new Dianda.Model.USER_Users(); userModel = (Model.USER_Users)Session["USER_Users"]; if (userModel.DepartMentID.IndexOf(',') > -1) { DDL_Department.SelectedValue = userModel.DepartMentID.Split(',')[0]; } else { DDL_Department.SelectedValue = userModel.DepartMentID; } //绑定人员列表 DataTable dtuser = new DataTable(); dtuser = pageControl.doSql("select ID,USERNAME,REALNAME from USER_Users where DepartMentID like '%" + DDL_Department.SelectedValue.ToString() + "%' and WorkStats='1' and DELFLAG=0 order by REALNAME ").Tables[0]; if (dtuser.Rows.Count > 0) { User_DPList.Enabled = true; Button_sumbit.Enabled = true; for (int i = 0; i < dtuser.Rows.Count; i++) { string ApplyUserName = dtuser.Rows[i]["REALNAME"].ToString() + "(" + dtuser.Rows[i]["USERNAME"].ToString() + ")"; string ID = dtuser.Rows[i]["ID"].ToString(); ListItem li = new ListItem(ApplyUserName, ID); User_DPList.Items.Add(li); } //设置人员列表的选中值 User_DPList.SelectedValue = userModel.ID; } else { ListItem li = new ListItem("本部门无人员", "0"); User_DPList.Items.Add(li); User_DPList.Enabled = false; Button_sumbit.Enabled = false; } } catch { tag.Text = "初始化页面属性值时发生错误!"; } }