日期:2014-05-18 浏览次数:21054 次
protected void gdvMain_RowCommand(object sender, GridViewCommandEventArgs e) { string mark = string.Empty; if (e.CommandArgument != null) { mark = e.CommandArgument.ToString(); } if (e.CommandName.Equals("Mark")&&!mark.Equals("YZ")) { GridViewRow gvrow = ((e.CommandSource as ImageButton).NamingContainer) as GridViewRow; int id = 0; if (gvrow != null) { DataRowView drvMain = gvrow.DataItem as DataRowView; if (drvMain != null) { int.TryParse(Convert.ToString(drvMain["ID"]), out id); } } PeprisOA.Model.CashCall modelCash = new PeprisOA.Model.CashCall(); PeprisOA.BLL.CashCall managerCash = new PeprisOA.BLL.CashCall(); modelCash = managerCash.GetModel(id); if (modelCash != null) { switch (mark) { case "WS": modelCash.FsValue = "CS"; break; case "CS": modelCash.FsValue = "FS"; break; case "FS": modelCash.FsValue = "FH"; break; case "FH": modelCash.FsValue = "YZ"; break; default: modelCash.FsValue = "CS"; break; } if (managerCash.Update(modelCash)) { PeprisOA.Common.JsUtil.Alert(this, "批复成功!"); } else { PeprisOA.Common.JsUtil.Alert(this, "批复失败,请重新批复!"); } } }