protected void RpList_ItemCommand(object source, RepeaterCommandEventArgs e) { //参数数组,0:单据ID,1:是否确认,2:制单员 string[] cmdArgs = e.CommandArgument.ToString().Split(','); string cmdName = e.CommandName; //表示单据是否已确认 bool confirmReceipt = false; bool ismaker = false; LoginInfo login = Session["login"] as LoginInfo; if (cmdArgs.Length > 1) { confirmReceipt = cmdArgs[1] == "1"; ismaker = cmdArgs[2] == login.Cname; } string msg = ""; switch (cmdName) { case "EDIT": if (confirmReceipt) { msg = "已确认单据不能修改"; break; } if (!ismaker) { msg = "不是本人所做的收款单不能修改"; break; } if (HttpContext.Current.Request.QueryString["page"] != null) { int page = int.Parse(HttpContext.Current.Request.QueryString["page"]); Server.Transfer(string.Format("CollectingEdit.aspx?pageindex=" + page + "&id={0}", cmdArgs[0])); } else { Server.Transfer(string.Format("CollectingEdit.aspx?id={0}", cmdArgs[0])); } break; case "search": if (AspNetPager1.CurrentPageIndex > 1) { int page = AspNetPager1.CurrentPageIndex; Response.Redirect("Collecting.aspx?pageindex=" + page + "&id=" + e.CommandArgument.ToString()); //参数sqsh判断当前所跳转到预览界面的是申请还是审核 } else { Response.Redirect("Collecting.aspx?id=" + e.CommandArgument.ToString()); } break; case "DELETE": if (confirmReceipt) { msg = "已确认单据不能删除"; break; } if (!ismaker) { msg = "不是本人所做的收款单不能删除"; break; } DeleteCollecting(int.Parse(cmdArgs[0])); break; case "CANCEL": To_ClaimManager claimBLL = new To_ClaimManager(); if (claimBLL.ExitsCollecting(int.Parse(cmdArgs[0]))) { msg = "该条收款记录已被认领,不能取消确认"; break; } To_CollectingManager.CancelConfirm(int.Parse(cmdArgs[0])); BindRpList(); break; case "confirm": To_CollectingManager.updateConfirm(cmdArgs[0], login.Cname, DateTime.Now.ToString()); BindRpList(); break; case "CHANGE": To_Income income = new To_Income(); DataTable mytable = To_CollectingManager.GetList(1, "id=" + cmdArgs[0], "id desc"); if (mytable != null) { income.ComeBankAccount = mytable.Rows[0]["payBankAcount"].ToString(); income.ComeBankId = int.Parse(mytable.Rows[0]["payBankId"].ToString()); income.ComeBankName = mytable.Rows[0]["payBank"].ToString(); income.ComeDate = DateTime.Parse(mytable.Rows[0]["receiptDate"].ToString()); income.ComeDepart = mytable.Rows[0]["markerDepartment"].ToString(); income.ComeDepartId = int.Parse(mytable.Rows[0]["markerDepartmentID"].ToString()); income.ComeMoney = double.Parse(mytable.Rows[0]["receiptAmount"].ToString()); income.ComeUnit = mytable.Rows[0]["paymentUnit"].ToString(); income.MakeDate = DateTime.Parse(mytable.Rows[0]["markDate"].ToString()); income.MakeId = int.Parse(mytable.Rows[0]["markerID"].ToString()); income.MakeName = mytable.Rows[0]["marker"].ToString(); income.Remark = mytable.Rows[0]["receiptMark"].ToString() + " 由原收款单号为" + mytable.Rows[0]["receiptNum"].ToString() + "转化而来"; income.SKType = ""; income.SKTypeId = 0; if (To_IncomeManager.Add(income) > 0) { msg = "该条收款记录已成功转化为其他收款"; To_CollectingManager.deleteTo_Collecting(int.Parse(cmdArgs[0])); //转化完成之后对起进行删除 } } BindRpList(); break; default: break; } if (msg != string.Empty) { ClientScript.RegisterClientScriptBlock(this.GetType(), "page", string.Format("alert('{0}');", msg), true); } }