public static void HuoqiProjectWithdraw(string projectName, string userName, decimal amount) { var context = new Agp2pDataContext(); var project = context.li_projects.Single(p => p.title == projectName); var user = context.dt_users.Single(u => u.user_name == userName); context.HuoqiProjectWithdraw(user.id, project.id, amount); }
protected void btnWithdraw_OnClick(object sender, EventArgs e) { var withdrawAmount = Request["__EVENTARGUMENT"]; int userId = Convert.ToInt32(((LinkButton)sender).CommandArgument); huoqiProject = Convert.ToInt32(ddlHuoqiProjects.SelectedValue); try { context.HuoqiProjectWithdraw(userId, huoqiProject, Convert.ToDecimal(withdrawAmount)); RptBind(); JscriptMsg("提现成功", "", "Success"); } catch (Exception ex) { JscriptMsg("提现失败:" + ex.Message, "", "Success"); } }