protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e) { int id = DataConverter.CLng(e.CommandArgument); switch (e.CommandName) { case "FinishWork": //this.mprojectwork=this.bllwork.SelectWorkByWID(Convert.ToInt32(e.CommandArgument)); //int i = this.mprojectwork.WorkID; //if (this.mprojectwork.Status == 0) // this.mprojectwork.Status = 1; //else // this.mprojectwork.Status = 0; //this.mprojectwork.EndDate = DateTime.Now; //this.bllwork.UpdateProjectWork(this.mprojectwork); //if (Request.QueryString["Pid"] != null) // suffix = "?Pid=" + Request.QueryString["Pid"].Trim(); //Page.Response.Redirect("WorkManage.aspx" + suffix); M_Pro_Flow flowMod = flowBll.SelReturnModel(id); flowMod.Status = flowMod.Status == 0 ? 1 : 0; flowBll.UpdateByID(flowMod); break; case "EditWork": //修改 Response.Redirect("AddWork.aspx?id=" + id + ""); break; case "DelWork": flowBll.Del(id); break; } MyBind(); }
public void MyBind() { if (Fid > 0) { M_Pro_Flow flowMod = flowBll.SelReturnModel(Fid); if (flowMod != null) { LblTitle.Text = "修改流程"; EBtnSubmit.Text = "修改"; TxtWorkName.Text = flowMod.WorkName; TxtWorkIntro.Text = flowMod.WorkIntro; } } }
protected void EBtnSubmit_Click(object sender, EventArgs e) { M_Pro_Flow flowMod = new M_Pro_Flow(); if (Fid > 0) { flowMod = flowBll.SelReturnModel(Fid); flowMod.WorkName = TxtWorkName.Text; flowMod.WorkIntro = TxtWorkIntro.Text; flowBll.UpdateByID(flowMod); } else { flowMod.WorkName = TxtWorkName.Text; flowMod.WorkIntro = TxtWorkIntro.Text; flowMod.ProjectID = 0; flowMod.Status = 0; flowBll.Insert(flowMod); } function.WriteSuccessMsg("操作成功!", "WorkManage.aspx"); }