protected void LinkButton3_Click(object sender, EventArgs e) { if (txtCode.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员编号不能为空!');", true); return; } lgk.Model.tb_user model_user = userBLL.GetModel(" UserCode='" + txtCode.Text.Trim() + "'"); if (model_user == null) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('会员不存在!');", true); return; } if (model_user.AgentsID != agentBLL.GetIDByIDUser(getLoginID())) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('所属报单中心不正确!');", true); return; } if (txtMoney.Value.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('消费金额不能为空!');", true); return; } decimal money = 0; try { money = Convert.ToDecimal(txtMoney.Value.Trim()); } catch { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('消费金额格式不正确!');", true); return; } if (money <= 0) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('消费金额要大于零!');", true); return; } if (money > model_user.StockAccount) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('重复消费账户余额不足!');", true); return; } lgk.Model.tb_mix model = new lgk.Model.tb_mix(); model.UserID = model_user.UserID; model.Amount = money; model.AddTime = DateTime.Now; model.Source = "报单中心消费"; if (mixBLL.Add(model) > 0) { AllCore acore = new AllCore();//1收入2支出 acore.add_userRecord(new lgk.BLL.tb_user().GetModel(model.UserID).UserCode, DateTime.Now, money, 2); ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('操作成功!');window.location.href='agent_xf.aspx';", true); } else { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "info", "alert('错误!');", true); } }
protected void LinkButton3_Click(object sender, EventArgs e) { if (txtCode.Text.Trim() == "") { MessageBox.MyShow(this, "会员编号不能为空!"); return; } lgk.Model.tb_user model_user = userBLL.GetModel(" UserCode='" + txtCode.Text.Trim() + "'"); if (model_user == null) { MessageBox.MyShow(this, "会员不存在!"); return; } if (txtMoney.Value.Trim() == "") { MessageBox.MyShow(this, "消费金额不能为空!"); return; } decimal money = 0; try { money = Convert.ToDecimal(txtMoney.Value.Trim()); } catch { MessageBox.MyShow(this, "消费金额格式不正确!"); return; } if (money <= 0) { MessageBox.MyShow(this, "消费金额要大于零!"); return; } if (money > model_user.StockAccount) { MessageBox.MyShow(this, "重复消费账户余额不足!"); return; } lgk.Model.tb_mix model = new lgk.Model.tb_mix(); model.UserID = model_user.UserID; model.Amount = money; model.AddTime = DateTime.Now; model.Source = "后台消费"; if (mixBLL.Add(model) > 0) { AllCore acore = new AllCore();//1收入2支出 acore.add_userRecord(new lgk.BLL.tb_user().GetModel(model.UserID).UserCode, DateTime.Now, money, 2); MessageBox.MyShow(this, "操作成功!"); } else { MessageBox.MyShow(this, "错误!"); } }
/// <summary> /// 审核分页申请记录 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { long UserID = long.Parse(e.CommandArgument.ToString()); lgk.Model.tb_user model = userBLL.GetModel(UserID); if (model == null) { MessageBox.MyShow(this, "该会员已删除,无法再进行此操作!"); return; } if (model.IsOpend != 0) { MessageBox.MyShow(this, "该会员已激活,无法再进行此操作!"); return; } if (e.CommandName.Equals("open")) // { AllCore acore = new AllCore(); //1收入2支出 //开通会员检查 int i = acore.OpenCheck(model); if (i != 0) { MessageBox.MyShow(this, acore.OpenCheckErrorMsg(i)); return; } if (flag_open(UserID, 2) > 0) { acore.add_userRecord(model.UserCode, DateTime.Now, model.RegMoney, 2); MessageBox.MyShow(this, "开通成功!"); } else { MessageBox.MyShow(this, "开通失败!"); //开通失败 } } if (e.CommandName.Equals("Empty"))// { if (userBLL.UpdateEmpty(UserID)) { MessageBox.MyShow(this, "开通空单成功!"); } else { MessageBox.MyShow(this, "开通空单失败!"); //开通失败 } } if (e.CommandName.Equals("Remove"))//删除 { //返还注册金额 if (userBLL.Delete(UserID)) { MessageBox.MyShow(this, "删除成功!"); } else { MessageBox.MyShow(this, "删除失败!"); } } BindData(); }