protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //项目类别 ProjectType.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(56); ProjectType.DataTextField = "ClassName"; ProjectType.DataValueField = "ClassName"; ProjectType.DataBind(); ProjectType.Items.Insert(0, new ListItem("选择类型", ""));; //专业 ClassName.DataSource = WebBLL.Tbl_ClassManager.GetTbl_ClassByParentID(15); ClassName.DataTextField = "ClassName"; ClassName.DataValueField = "ClassName"; ClassName.DataBind(); ClassName.Items.Insert(0, new ListItem("选择专业", "")); DesignTaskID.Items.Insert(0, new ListItem("选择任务", "")); //如果是通过卷册任务执行点过来的话 int taskid = WebCommon.Public.ToInt(Request.QueryString["taskid"]); if (taskid > 0) { WebModels.Tbl_DesignTask task = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(taskid); ProjectID.Items.Insert(0, new ListItem(task.ProjectName, task.ProjectID.ToString())); ClassName.SelectedValue = task.ClassName1; DesignTaskID.Items.Insert(0, new ListItem(task.DT_SheJiRen, task.ID.ToString())); } else { ProjectID.Items.Insert(0, new ListItem("选择项目", "")); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int CID = WebCommon.Public.ToInt(Request.QueryString["cid"]); int TaskID = WebCommon.Public.ToInt(Request.QueryString["id"]); if (CID > 0) { TaskID = WebBLL.Tbl_DesignCorrectManager.GetTbl_DesignCorrectById(CID).DesignTaskID; } WebModels.Tbl_DesignTask task = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(TaskID); string ClickType = WebCommon.Public.ToString(Request.QueryString["type"]); EndNode = "shenhe"; if (task.DT_ShenDingRen != "") { EndNode = "shending"; } if (ClickType == EndNode) { WebModels.Tbl_DesignCorrect model = WebBLL.Tbl_DesignCorrectManager.GetTbl_DesignCorrectById(CID); ErrorNum1.Value = model.ErrorNum1.ToString(); ErrorNum2.Value = model.ErrorNum2.ToString(); ErrorNum3.Value = model.ErrorNum3.ToString(); } } }
protected void btn_submit_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_DesignTask DesignTask = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(ID); DesignTask.DT_XuHao = this.DT_XuHao.Text; DesignTask.DT_TuHao = this.DT_TuHao.Text; DesignTask.ClassName3 = this.ClassName3.Text; DesignTask.DT_GuGong = Convert.ToDouble(this.DT_GuGong.Text); DesignTask.DT_SheJiRen = this.DT_SheJiRen.Text; DesignTask.DT_SheJiTime = Convert.ToDateTime(this.DT_SheJiTime.Text); DesignTask.DT_JiaoDuiRen = this.DT_JiaoDuiRen.Text; DesignTask.DT_JiaoDuiTime = Convert.ToDateTime(this.DT_JiaoDuiTime.Text); DesignTask.DT_ShenHeRen = this.DT_ShenHeRen.Text; DesignTask.DT_ShenHeTime = Convert.ToDateTime(this.DT_ShenHeTime.Text); DesignTask.DT_ShenDingRen = this.DT_ShenDingRen.Text; if (DT_ShenDingTime.Text != "") { DesignTask.DT_ShenDingTime = Convert.ToDateTime(this.DT_ShenDingTime.Text); } else { DesignTask.DT_ShenDingTime = new DateTime(1900, 1, 1); } //DesignTask.DT_HeZhunRen = this.DT_HeZhunRen.Text; //DesignTask.DT_HeZhunTime = Convert.ToDateTime(this.DT_HeZhunTime.Text); DesignTask.DT_PublishTime = Convert.ToDateTime(this.DT_PublishTime.Text); DesignTask.Remark = this.Remark.Text; DesignTask.DealUser = WebCommon.Public.GetUserName(); int count = WebBLL.Tbl_DesignTaskManager.UpdateTbl_DesignTask(DesignTask); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改成功!');window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改失败!');", true); } }
public void Bind() { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_DesignTask DesignTask = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(ID); this.DT_XuHao.Text = DesignTask.DT_XuHao; this.DT_TuHao.Text = DesignTask.DT_TuHao; this.ClassName3.Text = DesignTask.ClassName3; this.DT_GuGong.Text = DesignTask.DT_GuGong.ToString(); this.DT_SheJiRen.Text = DesignTask.DT_SheJiRen; this.DT_SheJiTime.Text = DesignTask.DT_SheJiTime.ToString("yyyy-MM-dd"); this.DT_JiaoDuiRen.Text = DesignTask.DT_JiaoDuiRen; this.DT_JiaoDuiTime.Text = DesignTask.DT_JiaoDuiTime.ToString("yyyy-MM-dd"); this.DT_ShenHeRen.Text = DesignTask.DT_ShenHeRen; this.DT_ShenHeTime.Text = DesignTask.DT_ShenHeTime.ToString("yyyy-MM-dd"); this.DT_ShenDingRen.Text = DesignTask.DT_ShenDingRen; this.DT_ShenDingTime.Text = DesignTask.DT_ShenDingTime.ToString("yyyy-MM-dd"); //this.DT_HeZhunRen.Text = DesignTask.DT_HeZhunRen; //this.DT_HeZhunTime.Text = DesignTask.DT_HeZhunTime.ToString("yyyy-MM-dd"); this.DT_PublishTime.Text = DesignTask.DT_PublishTime.ToString("yyyy-MM-dd"); this.Remark.Text = DesignTask.Remark; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int taskid = WebCommon.Public.ToInt(Request.QueryString["taskid"]); WebModels.Tbl_DesignTask task = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(taskid); ClassName1.Text = task.ClassName1; ProjectName.Text = task.ProjectName; ClassName3.Text = task.ClassName3; ProjectNo.Text = task.ProjectNo + "-" + task.DT_TuHao; Designer.Text = task.DT_SheJiRen; //获取错误统计 int error1num1, error1num2, error1num3, error2num1, error2num2, error2num3, error3num1, error3num2, error3num3; error1num1 = error1num2 = error1num3 = error2num1 = error2num2 = error2num3 = error3num1 = error3num2 = error3num3 = 0; string errorInfo = ""; DataTable dt = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(100, 1, "designtaskid=" + taskid.ToString(), ""); foreach (DataRow dr in dt.Rows) { string dc_file4correctinfo = dr["dc_file4correctinfo"].ToString(); for (int i = 0; i < dc_file4correctinfo.Split('>').Length - 1; i++) { string einfo = dc_file4correctinfo.Split('>')[i]; if (einfo == "") { einfo = "通过"; } errorInfo += "<tr>" + "<td style='background: #fff;text-align:center;height:50px'></td>" + "<td style='background: #fff;text-align:center' colspan=2></td>" + "<td style='background: #fff;text-align:center'>" + einfo + "</td>" + "</tr>"; } } correctinfo.InnerHtml = errorInfo; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { username = WebCommon.Public.ToString(Request.QueryString["user"]); projectname = WebCommon.Public.ToString(Request.QueryString["project"]); if (projectname != "") { projectname = WebBLL.Tbl_ProjectManager.GetDataTableByPage(1, 1, "projectname like '%" + projectname + "%'", "").Rows[0]["ProjectName"].ToString(); } //开始设计生成设计文件和属性文件 if (WebCommon.Public.ToString(Request.QueryString["type"]) == "开始设计") { int taskId = Convert.ToInt32(Request.QueryString["taskid"]); WebModels.Tbl_DesignTask designtask = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(taskId); //生成上传文件名 string RndName = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTasFileNamekByTaskId(taskId); //获取项目资料生成属性 WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(designtask.ProjectID); //生成属性文件 string folderPath = System.Web.HttpContext.Current.Server.MapPath("/upload/DesignCorrect"); if (!System.IO.Directory.Exists(folderPath)) { System.IO.Directory.CreateDirectory(folderPath); } string path = folderPath + "\\" + RndName + " - 属性.txt"; if (!System.IO.File.Exists(path)) { System.IO.File.Create(path).Close(); } System.Text.StringBuilder strBuilderErrorMessage = new System.Text.StringBuilder(); strBuilderErrorMessage.Append("工程名称:" + project.ProjectName + "\r\n"); strBuilderErrorMessage.Append("图纸名称:请手动输入\r\n"); strBuilderErrorMessage.Append("卷册检索号:" + project.ProjectNo + "\r\n"); strBuilderErrorMessage.Append("专业:" + designtask.ClassName1 + "\r\n"); strBuilderErrorMessage.Append("阶段:施工图\r\n"); strBuilderErrorMessage.Append("卷册名称:" + designtask.ClassName3); System.IO.File.WriteAllText(path, strBuilderErrorMessage.ToString(), System.Text.Encoding.Default); //using (System.IO.StreamWriter sw = System.IO.File.CreateText(path)) //{ // sw.Write(strBuilderErrorMessage); // sw.Flush(); // sw.Close(); //} //属性生成结束 string serverUrl = "/upload/DesignCorrect/" + RndName + " - 属性.txt|" + WebCommon.Public.Get_BlankFilePath; string SaveUrl = "/template/" + RndName + " - 属性.txt|/template/" + RndName + " - 设计.dwg"; //下载属性文件和空白CAD文件 WebCommon.Script.ResponseScript("window.external.download('" + serverUrl + "','" + SaveUrl + "',true)"); WebCommon.Script.GoBack(); } //开始提交设计文件 //if (WebCommon.Public.ToString(Request.QueryString["type"]) == "提交设计") //{ // int taskId = Convert.ToInt32(Request.QueryString["taskid"]); // //生成上传文件名 // string RndName = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTasFileNamekByTaskId(taskId); // string ServerUrl = "/upload/DesignCorrect/" + RndName + " - 设计.txt"; // string ClientUrl = ServerUrl; // //上传CAD设计文件 // WebCommon.Script.ResponseScript("window.external.download('" + ServerUrl + "','" + ClientUrl + "',true)"); // WebCommon.Script.GoBack(); //} //绑定列表 Bind(); } }
protected void btn_submit_Click(object sender, EventArgs e) { WebModels.Tbl_DesignTask designTask = new WebModels.Tbl_DesignTask(); designTask.ClassName1 = this.ClassName1.SelectedItem.Text; designTask.ClassName2 = this.ClassName2.SelectedItem.Text; designTask.ClassName3 = this.ClassName3Value.Text; designTask.ProjectID = Convert.ToInt32(this.ProjectName.SelectedValue); designTask.ProjectName = this.ProjectName.SelectedItem.Text; designTask.ProjectNo = this.ProjectNo.Value; designTask.DesignManager = this.DesignManager.Text; designTask.DesignMain = this.DesignMain.Text; designTask.DT_XuHao = this.DT_XuHao.Text.Trim(); designTask.DT_TuHao = this.DT_TuHao.Text.Trim(); designTask.DT_GuGong = Convert.ToDouble(this.DT_GuGong.Text); designTask.DT_SheJiRen = this.DT_SheJiRen.SelectedValue; if (DT_SheJiTime.Text != "") { designTask.DT_SheJiTime = Convert.ToDateTime(this.DT_SheJiTime.Text); } else { designTask.DT_SheJiTime = new DateTime(1900, 1, 1); } designTask.DT_JiaoDuiRen = this.DT_JiaoDuiRen.SelectedValue; if (DT_JiaoDuiTime.Text != "") { designTask.DT_JiaoDuiTime = Convert.ToDateTime(this.DT_JiaoDuiTime.Text); } else { designTask.DT_JiaoDuiTime = new DateTime(1900, 1, 1); } designTask.DT_ShenHeRen = this.DT_ShenHeRen.SelectedValue; if (DT_ShenHeTime.Text != "") { designTask.DT_ShenHeTime = Convert.ToDateTime(this.DT_ShenHeTime.Text); } else { designTask.DT_ShenHeTime = new DateTime(1900, 1, 1); } designTask.DT_ShenDingRen = this.DT_ShenDingRen.Text; if (DT_ShenDingTime.Text != "") { designTask.DT_ShenDingTime = Convert.ToDateTime(this.DT_ShenDingTime.Text); } else { designTask.DT_ShenDingTime = new DateTime(1900, 1, 1); } designTask.DT_HeZhunRen = ""; // this.DT_HeZhunRen.SelectedValue; designTask.DT_HeZhunTime = DateTime.Now; // Convert.ToDateTime(this.DT_HeZhunTime.Text); if (DT_PublishTime.Text != "") { designTask.DT_PublishTime = Convert.ToDateTime(this.DT_PublishTime.Text); } else { designTask.DT_PublishTime = new DateTime(1900, 1, 1); } designTask.CorrectLevel = ""; designTask.Remark = VolumeLevel.Value; designTask.DealUser = WebCommon.Public.GetUserName(); designTask.Status = "任务录入"; designTask.NodeUser = WebCommon.Public.GetUserName(); int count = WebBLL.Tbl_DesignTaskManager.AddTbl_DesignTask(designTask); if (count > 0) { BindList(); this.DT_XuHao.Text = ""; this.DT_TuHao.Text = ""; this.ClassName3.SelectedValue = ""; this.DT_GuGong.Text = ""; this.DT_SheJiRen.SelectedValue = ""; this.DT_SheJiTime.Text = ""; this.DT_JiaoDuiRen.SelectedValue = ""; this.DT_JiaoDuiTime.Text = ""; this.DT_ShenHeRen.SelectedValue = ""; this.DT_ShenHeTime.Text = ""; this.DT_ShenHeRen.Text = ""; this.DT_ShenHeTime.Text = ""; this.DT_ShenDingRen.Text = ""; this.DT_ShenDingTime.Text = ""; this.Remark.Text = ""; //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加成功!');", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加失败!');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string typeStr = WebCommon.Public.ToString(Request.QueryString["Type"]); int ProjectID = WebCommon.Public.ToInt(Request.QueryString["ProjectID"]); //如果领导未审撤回 if (typeStr == "cancel") { WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(ProjectID); project.NodeNo = "项目撤回"; project.NodeUser = project.UserName; project.Status = "结束"; WebBLL.Tbl_ProjectManager.UpdateTbl_Project(project); WebCommon.Script.AlertAndGoBack("撤回成功"); } //项目结束并存档 if (typeStr == "save") { int count = 0; int DesignTaskID = 0;// WebCommon.Public.ToInt(WebBLL.Tbl_DesignTaskManager.GetDataTableByPage(1, 1, "ProjectID=" + ProjectID.ToString(), "id desc").Rows[0]["ID"]); foreach (System.Data.DataRow dr in WebBLL.Tbl_DesignTaskManager.GetDataTableByPage(100, 1, "ProjectID=" + ProjectID.ToString(), "id desc").Rows) { DesignTaskID = Convert.ToInt32(dr["ID"]); WebModels.Tbl_DesignTask designtask = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(DesignTaskID); WebModels.Tbl_ProjectArchive archive = new WebModels.Tbl_ProjectArchive(); archive.ProjectID = designtask.ProjectID; archive.ClassName1 = designtask.ClassName1; archive.ClassName2 = designtask.ClassName2; archive.ClassName3 = designtask.ClassName3; archive.PA_Type1 = "项目档案"; archive.PA_Type2 = "电子版"; archive.ParentID = 0; archive.PA_Limit = "普通"; archive.PA_Name = designtask.ClassName3; archive.PA_File = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(1, 1, "DesignTaskID=" + designtask.ID + " and Tbl_DesignCorrect.status='结束'", "Tbl_DesignCorrect.id desc").Rows[0]["DC_File"].ToString(); archive.PA_FileNo = ""; archive.PA_Info = "项目流程自动存档"; archive.Status = "已审核"; archive.DealUser = WebCommon.Public.GetUserName(); WebBLL.Tbl_ProjectArchiveManager.AddTbl_ProjectArchive(archive); count++; } if (count > 0) { WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(ProjectID); project.Status = "结束"; WebBLL.Tbl_ProjectManager.UpdateTbl_Project(project); WebCommon.Script.AlertAndGoBack("项目自动存档成功"); } else { WebCommon.Script.AlertAndGoBack("存档失败"); } } //绑定项目工作 string username = WebCommon.Public.GetUserName(); //进行中的节点用户或如果是设计工作处理节点的任务工作者 string whereStr = "status='进行中' and (nodeuser like '%" + username + "%' or (nodeno='设计工作处理' and (select count(*) from tbl_designtask where projectid=tbl_project.id and (dt_shejiren='" + username + "' or dt_jiaoduiren='" + username + "' or dt_shenheren='" + username + "' or dt_shendingren='" + username + "'))>0))"; Rep_List.DataSource = WebBLL.Tbl_ProjectManager.GetDataTableByPage(30, 1, whereStr, "id desc"); Rep_List.DataBind(); //绑定任务工作//按单个任务罗列 //string strWhere = "status<>'结束' and status<>'任务录入' and status<>'任务审批' and NodeUser like '%" + WebCommon.Public.GetUserName() + "%'"; //Rep_List2.DataSource = WebBLL.Tbl_DesignTaskManager.GetDataTableByPage(30, 1, strWhere, "id desc"); //Rep_List2.DataBind(); //绑定任务工作//按单个项目罗列 string strWhere = "id in (select projectid from tbl_designtask where status<>'结束' and status<>'任务录入' and status<>'任务审批' and NodeUser like '%" + WebCommon.Public.GetUserName() + "%')"; Rep_List2.DataSource = WebBLL.Tbl_ProjectManager.GetDataTableByPage(30, 1, strWhere, ""); Rep_List2.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int taskid = WebCommon.Public.ToInt(Request.QueryString["taskid"]); WebModels.Tbl_DesignTask task = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(taskid); ClassName1.Text = task.ClassName1; ProjectName.Text = task.ProjectName; ClassName3.Text = task.ClassName3; ProjectNo.Text = task.ProjectNo + "-" + task.DT_TuHao; MainDesigner.Text = task.DesignMain; PaperNum1.Text = task.PaperNum1.ToString(); PaperNum2.Text = task.PaperNum2.ToString(); PaperNum3.Text = task.PaperNum3.ToString(); //获取错误统计 int error1num1, error1num2, error1num3, error2num1, error2num2, error2num3, error3num1, error3num2, error3num3; error1num1 = error1num2 = error1num3 = error2num1 = error2num2 = error2num3 = error3num1 = error3num2 = error3num3 = 0; string errorInfo = ""; string errorInfo2 = ""; DataTable dt = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(100, 1, "designtaskid=" + taskid.ToString(), ""); foreach (DataRow dr in dt.Rows) { string dc_file1correctinfo = dr["dc_file1correctinfo"].ToString(); string dc_file2correctinfo = dr["dc_file2correctinfo"].ToString(); string dc_file3correctinfo = dr["dc_file3correctinfo"].ToString(); string dc_file1correct = dr["dc_file1correct"].ToString(); string dc_file2correct = dr["dc_file2correct"].ToString(); string dc_file3correct = dr["dc_file3correct"].ToString(); if (dc_file1correctinfo != "") { errorInfo += "<br>校对意见 ↓<br>";//- "+dr["DC_File1Time"].ToString() + " errorInfo += dc_file1correctinfo + "<br>"; errorInfo2 += "<br>校对意见 ↓<br>" + dc_file1correct + "<br>"; error1num1 += Regex.Matches(dc_file1correctinfo, @"原则性错误").Count; error1num2 += Regex.Matches(dc_file1correctinfo, @"技术性错误").Count; error1num3 += Regex.Matches(dc_file1correctinfo, @"一般性错误").Count; } if (dc_file2correctinfo != "") { errorInfo += "<br>审核意见 ↓<br>";//- " + dr["DC_File2Time"].ToString() + " errorInfo += dc_file2correctinfo + "<br>"; errorInfo2 += "<br>审核意见 ↓<br>" + dc_file2correct + "<br>"; error2num1 += Regex.Matches(dc_file2correctinfo, @"原则性错误").Count; error2num2 += Regex.Matches(dc_file2correctinfo, @"技术性错误").Count; error2num3 += Regex.Matches(dc_file2correctinfo, @"一般性错误").Count; } if (dc_file3correctinfo != "") { errorInfo += "<br>审定意见 ↓<br>";//- " + dr["DC_File2Time"].ToString() + " errorInfo += dc_file3correctinfo + "<br>"; errorInfo2 += "<br>审定意见 ↓<br>" + dc_file3correct + "<br>"; error3num1 += Regex.Matches(dc_file3correctinfo, @"原则性错误").Count; error3num2 += Regex.Matches(dc_file3correctinfo, @"技术性错误").Count; error3num3 += Regex.Matches(dc_file3correctinfo, @"一般性错误").Count; } } error1Num1.Text = error1num1.ToString(); error1Num2.Text = error1num2.ToString(); error1Num3.Text = error1num3.ToString(); error2Num1.Text = error2num1.ToString(); error2Num2.Text = error2num2.ToString(); error2Num3.Text = error2num3.ToString(); error3Num1.Text = error3num1.ToString(); error3Num2.Text = error3num2.ToString(); error3Num3.Text = error3num3.ToString(); correctinfo.InnerHtml = errorInfo.Replace("\r\n", "<br>"); correctinfo2.InnerHtml = errorInfo2; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //会签发送 string pddesigner = WebCommon.Public.ToString(Request.QueryString["Designer"]); int DesignTaskID = WebCommon.Public.ToInt(Request.QueryString["ID"]); if (pddesigner != "") { //转入审定 if (pddesigner == "审核") { WebModels.Tbl_DesignTask Task = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(DesignTaskID); Task.Status = "等待审核"; if (Task.DT_ShenHeRen != "") { Task.NodeUser = Task.DT_ShenHeRen; WebBLL.Tbl_DesignTaskManager.UpdateTbl_DesignTask(Task); WebCommon.Public.DataTableUpdate("tbl_designcorrect", "NodeUser='******',status='等待审核'", "designtaskid=" + DesignTaskID.ToString() + ""); ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('转入审核成功');location.href='" + WebCommon.Public.GetFromUrl() + "';", true); return; } else//没有审定人的话就结束任务并存档 { Task.Status = "结束"; WebBLL.Tbl_DesignTaskManager.UpdateTbl_DesignTask(Task); WebCommon.Public.DataTableUpdate("tbl_designcorrect", "status='结束'", "designtaskid=" + DesignTaskID.ToString()); WebModels.Tbl_ProjectArchive archive = new WebModels.Tbl_ProjectArchive(); archive.ProjectID = Task.ProjectID; archive.ClassName1 = Task.ClassName1; archive.ClassName2 = Task.ClassName2; archive.ClassName3 = Task.ClassName3; archive.PA_Type1 = "项目档案"; archive.PA_Type2 = "电子版"; archive.ParentID = 0; archive.PA_Limit = "普通"; archive.PA_Name = Task.ClassName3; archive.PA_File = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(1, 1, "DesignTaskID=" + Task.ID + " and Tbl_DesignCorrect.status='结束'", "Tbl_DesignCorrect.id desc").Rows[0]["DC_File"].ToString(); archive.PA_FileNo = ""; archive.PA_Info = "项目流程自动存档"; archive.Status = "已审核"; archive.DealUser = WebCommon.Public.GetUserName(); WebBLL.Tbl_ProjectArchiveManager.AddTbl_ProjectArchive(archive); ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('没有审定人任务直接结束并存档成功');location.href='" + WebCommon.Public.GetFromUrl() + "';", true); return; } } else { //正常会签 //务必把NodeUserLast清空由此服务器端判断那个会签人不通过好下次修改设计直接返回会签人 WebCommon.Public.DataTableUpdate("tbl_designtask", "NodeUserLast='',NodeUser='******'", "id=" + DesignTaskID.ToString()); WebCommon.Public.DataTableUpdate("tbl_designcorrect", "NodeUser='******'", "designtaskid=" + DesignTaskID.ToString() + " and status='等待会签'"); ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('发送会签成功');location.href='" + WebCommon.Public.GetFromUrl() + "';", true); return; } } //开始设计生成设计文件和属性文件 if (WebCommon.Public.ToString(Request.QueryString["type"]) == "开始设计") { int taskId = Convert.ToInt32(Request.QueryString["taskid"]); WebModels.Tbl_DesignTask designtask = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(taskId); //生成上传文件名 string RndName = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTasFileNamekByTaskId(taskId); //获取专业编号 string ClassNo = WebBLL.Tbl_ClassManager.GetDataTableByPage(1, 1, "parentid=15 and classname='" + designtask.ClassName1 + "'", "").Rows[0]["remark"].ToString(); //获取项目资料生成属性 WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(designtask.ProjectID); //生成属性文件 string folderpathStr = "/project/" + project.ProjectNo + "/" + ClassNo + "/" + designtask.DT_TuHao; string folderPath = System.Web.HttpContext.Current.Server.MapPath(folderpathStr); if (!System.IO.Directory.Exists(folderPath)) { System.IO.Directory.CreateDirectory(folderPath); } string path = folderPath + "\\" + RndName + " - 属性.txt"; if (!System.IO.File.Exists(path)) { System.IO.File.Create(path).Close(); } System.Text.StringBuilder strBuilderErrorMessage = new System.Text.StringBuilder(); strBuilderErrorMessage.Append("工程名称:" + project.ProjectName + "\r\n"); strBuilderErrorMessage.Append("图纸名称:请手动输入\r\n"); strBuilderErrorMessage.Append("卷册检索号:" + designtask.ProjectNo + "|" + designtask.DT_TuHao + "\r\n"); strBuilderErrorMessage.Append("专业:" + designtask.ClassName1 + "\r\n"); strBuilderErrorMessage.Append("阶段:施工图\r\n"); strBuilderErrorMessage.Append("卷册名称:" + designtask.ClassName3); System.IO.File.WriteAllText(path, strBuilderErrorMessage.ToString(), System.Text.Encoding.Default); //using (System.IO.StreamWriter sw = System.IO.File.CreateText(path)) //{ // sw.Write(strBuilderErrorMessage); // sw.Flush(); // sw.Close(); //} //属性生成结束 string serverUrl = folderpathStr + "/" + RndName + " - 属性.txt|" + WebCommon.Public.Get_BlankFilePath; string SaveUrl = folderpathStr + "/" + RndName + " - 属性.txt|" + folderpathStr + "/" + RndName + " - 设计.dwg"; //下载属性文件和空白CAD文件 //WebCommon.Script.ResponseScript("alert('" + serverUrl + " " + SaveUrl + "')"); WebCommon.Script.ResponseScript("window.external.download('" + serverUrl + "','" + SaveUrl + "',true)"); //WebCommon.Script.GoBack(); } //开始提交设计文件 //if (WebCommon.Public.ToString(Request.QueryString["type"]) == "提交设计") //{ // int taskId = Convert.ToInt32(Request.QueryString["taskid"]); // //生成上传文件名 // string RndName = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTasFileNamekByTaskId(taskId); // string ServerUrl = "/upload/DesignCorrect/" + RndName + " - 设计.txt"; // string ClientUrl = ServerUrl; // //上传CAD设计文件 // WebCommon.Script.ResponseScript("window.external.download('" + ServerUrl + "','" + ClientUrl + "',true)"); // WebCommon.Script.GoBack(); //} //绑定列表 Bind(); //绑定会签人员 WebBLL.Tbl_UserManager.GetUsersByDropDownList(Designer); Designer.Items.Insert(0, new ListItem("选择会签人员", "")); } }
public void btnSave_Click(object sender, EventArgs e) { int CID = WebCommon.Public.ToInt(Request.QueryString["cid"]); int TaskID = WebCommon.Public.ToInt(Request.QueryString["id"]); if (CID > 0) { TaskID = WebBLL.Tbl_DesignCorrectManager.GetTbl_DesignCorrectById(CID).DesignTaskID; } string ClickType = WebCommon.Public.ToString(Request.QueryString["type"]); string ActStr = ""; string FileStr = ""; switch (ClickType) { case "sheji": ActStr = "校对"; FileStr = "设计"; break; case "jiaodui": ActStr = "会签"; if (CorrectInfo.Value != "") { ActStr = "设计"; } FileStr = "校对"; break; case "huiqian": ActStr = "会签"; if (CorrectInfo.Value != "") { ActStr = "设计"; } FileStr = "审核"; break; case "shenhe": ActStr = "审定"; if (CorrectInfo.Value != "") { ActStr = "设计"; } FileStr = "审核"; break; } string FullName = WebCommon.Public.UploadFile(FileUrl, WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTasFileFullNamekByTaskId(TaskID) + " - " + FileStr + FileUrl.FileName.Remove(0, FileUrl.FileName.LastIndexOf("."))); string StatusStr = "等待"; if (FullName != "") { FullName = FullName.Replace("../", "/"); WebModels.Tbl_DesignTask model = WebBLL.Tbl_DesignTaskManager.GetTbl_DesignTaskById(TaskID); StatusStr += ActStr; switch (ClickType) { case "sheji": model.NodeUser = model.DT_JiaoDuiRen; if (model.StatusLast.Contains("校对")) { model.NodeUser = model.DT_JiaoDuiRen; } if (model.StatusLast.Contains("审核")) { model.NodeUser = model.DT_ShenHeRen; } if (model.StatusLast.Contains("审定")) { model.NodeUser = model.DT_ShenDingRen; } if (model.StatusLast.Contains("会签")) { model.NodeUser = model.DealUser; } if (model.StatusLast != "") { StatusStr = model.StatusLast; } break; case "jiaodui": model.NodeUser = model.DT_SheJiRen; if (CorrectInfo.Value != "") { model.NodeUser = model.DT_SheJiRen; model.StatusLast = "等待校对"; StatusStr = "等待设计"; } break; case "shenhe": model.NodeUser = model.DT_ShenDingRen; if (CorrectInfo.Value != "") { model.NodeUser = model.DT_SheJiRen; model.StatusLast = "等待审核"; StatusStr = "等待设计"; } else { if (model.DT_ShenDingRen == "") { StatusStr = "结束"; } else { model.NodeUser = model.DT_ShenDingRen; StatusStr = "等待审定"; } } break; case "shending": model.NodeUser = model.DT_SheJiRen; if (CorrectInfo.Value != "") { model.NodeUser = model.DT_SheJiRen; model.StatusLast = "等待审定"; StatusStr = "等待设计"; } else { StatusStr = "结束"; } break; case "huiqian": model.NodeUser = model.DT_JiaoDuiRen; if (CorrectInfo.Value != "") { model.NodeUser = model.DT_SheJiRen; model.StatusLast = "等待会签"; StatusStr = "等待设计"; } else { model.NodeUser = model.DT_SheJiRen; StatusStr = "等待会签"; } break; } model.Status = StatusStr; int count = WebBLL.Tbl_DesignTaskManager.UpdateTbl_DesignTask(model); if (count > 0) { int count1 = 0; if (ClickType == "sheji" && model.StatusLast == "") { WebModels.Tbl_DesignCorrect correct = new WebModels.Tbl_DesignCorrect(); correct.UserName = WebCommon.Public.GetUserName(); correct.DesignTaskID = Convert.ToInt32(TaskID); correct.DC_Name = ""; correct.DC_File = FullName; correct.DC_FileInfo = Correct.Value; correct.DC_FileTime = DateTime.Now; correct.NodeUser = model.NodeUser; correct.Status = StatusStr; count1 = WebBLL.Tbl_DesignCorrectManager.AddTbl_DesignCorrect(correct); } else { if (ClickType == "sheji") { CID = WebCommon.Public.ToInt(WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(1, 1, "designtaskid=" + TaskID.ToString(), "").Rows[0][0]); } WebModels.Tbl_DesignCorrect correct = WebBLL.Tbl_DesignCorrectManager.GetTbl_DesignCorrectById(CID); switch (ClickType) { case "sheji": correct.DC_File = FullName; if (model.StatusLast.Contains("校对")) { correct.DC_File1Correct += Correct.Value + "<br>"; } if (model.StatusLast.Contains("审核")) { correct.DC_File2Correct += Correct.Value + "<br>"; } if (model.StatusLast.Contains("审定")) { correct.DC_File3Correct += Correct.Value + "<br>"; } if (model.StatusLast.Contains("会签")) { correct.DC_File4Correct += Correct.Value + "<br>"; } StatusStr = model.StatusLast; break; case "jiaodui": correct.DC_File1 = FullName; correct.DC_File1CorrectInfo += CorrectInfo.Value + "<br>"; break; case "shenhe": correct.DC_File2 = FullName; correct.DC_File2CorrectInfo += CorrectInfo.Value + "<br>"; //更新评级 if (model.DT_ShenDingRen == "") { WebCommon.Public.ExcuteSql("update tbl_designtask set PaperNum1=" + PaperNum1.Text + ",PaperNum2=" + PaperNum2.Text + ",PaperNum3=" + PaperNum3.Text + ",CorrectLevel='" + CorrectLevel.Text + "' where id=" + TaskID.ToString()); } break; case "shending": correct.DC_File3 = FullName; correct.DC_File3CorrectInfo += CorrectInfo.Value + "<br>"; //更新评级 if (model.DT_ShenDingRen != "") { WebCommon.Public.ExcuteSql("update tbl_designtask set PaperNum1=" + PaperNum1.Text + ",PaperNum2=" + PaperNum2.Text + ",PaperNum3=" + PaperNum3.Text + ",CorrectLevel='" + CorrectLevel.Text + "' where id=" + TaskID.ToString()); } break; case "huiqian": correct.DC_File4 = FullName; correct.DC_File4CorrectInfo += CorrectInfo.Value + "<br>"; break; } correct.DC_FileTime = DateTime.Now; correct.ErrorNum1 += WebCommon.Public.ToInt(ErrorNum1.Value); correct.ErrorNum2 += WebCommon.Public.ToInt(ErrorNum2.Value); correct.ErrorNum3 += WebCommon.Public.ToInt(ErrorNum3.Value); correct.NodeUser = model.NodeUser; correct.Status = StatusStr; count1 = WebBLL.Tbl_DesignCorrectManager.UpdateTbl_DesignCorrect(correct); if (correct.Status == "结束") { WebModels.Tbl_ProjectArchive archive = new WebModels.Tbl_ProjectArchive(); archive.ProjectID = model.ProjectID; archive.ClassName1 = model.ClassName1; archive.ClassName2 = model.ClassName2; archive.ClassName3 = model.ClassName3; archive.PA_Type1 = "项目档案"; archive.PA_Type2 = "电子版"; archive.ParentID = 0; archive.PA_Limit = "普通"; archive.PA_Name = model.ClassName3; archive.PA_File = correct.DC_File; archive.PA_FileNo = ""; archive.PA_Info = "项目流程自动存档"; archive.Status = "已审核"; archive.DealUser = WebCommon.Public.GetUserName(); WebBLL.Tbl_ProjectArchiveManager.AddTbl_ProjectArchive(archive); } } if (count1 > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('上传成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('写入失败2!');", true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('写入失败1!');", true); } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('上传失败!');", true); } }