protected void Button1_Click(object sender, EventArgs e) { //1.验证当前用户页面权限 if (!this.Master.A_Edit) { Response.Write("你没有权限访问此功能!"); Response.End(); return; } //2.取得用户变量 WX.PRO.Process.MODEL model = WX.PRO.Process.NewDataModel(); if (ui_id.Value != "") { model = WX.PRO.Process.GetModel("SELECT * FROM PRO_Process where ID=" + ui_id.Value); } model.NO.value = ui_NO.Text; model.Persons.value = ui_Persons.Text; model.Days.value = ui_Days.Text; model.Percnt.value = ui_Percnt.Text; model.Percnttime.value = ui_Percnttime.Text; model.Demo.value = ui_demo.Text; //4.业务处理过程 string logstr = "-添加"; if (ui_id.Value != "") { logstr = "-修改"; model.Update(); } else { model.ProjID.value = WX.Request.rProjectId; model.State.value = 0; model.Insert(); } //5.登记日志 WX.PRO.Log.AddLog(4, Convert.ToInt32(model.ProjID.ToString()), Literal1.Text + logstr + "第" + model.NO.ToString() + "步", Request.UserHostAddress); ui_id.Value = ""; ui_NO.Text = ""; ui_Persons.Text = ""; ui_Days.Text = ""; ui_Percnt.Text = ""; ui_Percnttime.Text = ""; ui_demo.Text = ""; //6.返回处理结果。 ReBind(); }
protected void Button1_Click(object sender, EventArgs e) { WX.PRO.Process.MODEL procmodel = WX.PRO.Process.GetModel("select top 1 * from PRO_Process where ProjID=" + WX.Request.rProjectId + " and NO=" + Convert.ToInt32(((Button)sender).ToolTip)); WX.PRO.Process.MODEL procmodel2 = WX.PRO.Process.GetModel("select top 1 * from PRO_Process where ProjID=" + WX.Request.rProjectId + " and NO=" + (Convert.ToInt32(procmodel.NO.ToString()) + 1)); if (procmodel2 != null) { ULCode.QDA.XSql.Execute("update PRO_State set ProcID=" + procmodel2.NO.ToString() + ",Percnt=Percnt+" + procmodel.Percnt.ToString() + ",Percnttime=Percnttime+" + procmodel.Percnttime.ToString() + " where ProjID=" + procmodel.ProjID.ToString()); WX.PRO.Log.AddLog(6, Convert.ToInt32(procmodel.ProjID.ToString()), "从 第" + procmodel.NO.ToString() + "步 转至 第" + procmodel2.NO.ToString() + "步", Request.UserHostAddress); WX.PRO.Process.SetTime(DateTime.Now, Convert.ToInt32(procmodel.ProjID.ToString()), Convert.ToInt32(procmodel2.NO.ToString())); } else { procmodel.Stoptime.value = DateTime.Now; procmodel.Update(); ULCode.QDA.XSql.Execute("update PRO_State set ProcID=0,Stoptime=getdate(),State=2,Percnt=Percnt+" + procmodel.Percnt.ToString() + ",Percnttime=Percnttime+" + procmodel.Percnttime.ToString() + " where ProjID=" + procmodel.ProjID.ToString()); ULCode.QDA.XSql.Execute("update PRO_Projects set State=5 where ID=" + procmodel.ProjID.ToString()); WX.PRO.Log.AddLog(7, Convert.ToInt32(procmodel.ProjID.ToString()), "第" + procmodel.NO.ToString() + "步结束", Request.UserHostAddress); WX.PRO.Log.AddLog(8, Convert.ToInt32(procmodel.ProjID.ToString()), "项目流程结束", Request.UserHostAddress); } Response.Redirect("Proj_ProjectDetail.aspx?ProjectId=" + WX.Request.rProjectId); }