protected void gvdeduct_RowCommand(object sender, GridViewCommandEventArgs e) { string id = e.CommandArgument.ToString(); string sql = "select * from deduct where id=" + id; DataTable dt = DAL.DBHelper.ExecuteDataTable(sql); DeductModel model = new DeductModel(); if (dt.Rows.Count > 0) { model.Auditing = 1; model.DeductMoney = Convert.ToDouble(dt.Rows[0]["DeductMoney"]); model.ExpectNum = CommonDataBLL.getMaxqishu(); model.ID = Convert.ToInt32(id); model.IsDeduct = Convert.ToInt32(dt.Rows[0]["IsDeduct"]); model.Number = dt.Rows[0]["Number"].ToString(); model.OperateIP = Request.UserHostAddress; model.OperateNum = Session["Company"].ToString(); model.AuditingTime = DateTime.Now.ToUniversalTime(); model.Auditingexctnum = CommonDataBLL.getMaxqishu(); model.Actype = Convert.ToInt32(dt.Rows[0]["Actype"]);; } if (e.CommandName == "ok") { if (dt.Rows[0]["isaudit"].ToString() == "1") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("000849", "不能重复审核") + "')</script>"); return; } if (DeductBLL.UpdateInfoTranBD(model)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("000858", "审核成功") + "')</script>"); BtnConfirm_Click(null, null); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("006041", "审核失败") + "!')</script>"); } } if (e.CommandName == "del") { if (DAL.DBHelper.ExecuteNonQuery("delete from deduct where id=" + id, CommandType.Text) > 0) { ScriptHelper.SetAlert(Page, GetTran("000008", "删除成功")); BtnConfirm_Click(null, null); } else { ScriptHelper.SetAlert(Page, GetTran("000009", "删除失败")); } } }
public void getnode() { int expectnum = 0; string number = string.Empty; int id = 0; if (Request.QueryString["expectnum"] != null && Request.QueryString["number"] != null && Request.QueryString["id"] != null) { expectnum = Convert.ToInt32(Request.QueryString["expectnum"].ToString().Trim()); number = Request.QueryString["number"].ToString().Trim(); id = Convert.ToInt32(Request.QueryString["id"].ToString()); } divnode.InnerText = DeductBLL.Reason(expectnum, number, id).ToString(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string cname = e.CommandName.ToString(); if (cname == "Lbtn") { if (DeductBLL.isExistsBonusDifference(Convert.ToInt32(e.CommandArgument))) { this.Page.RegisterStartupScript("", "<script>alert('" + GetTran("005965", "已经添加,不能再添加!") + "');</script>"); return; } else { DeductBLL.upBonusDifference(Convert.ToInt32(e.CommandArgument)); BonusDifferenceModel model = DeductBLL.GetBonusDifference(Convert.ToInt32(e.CommandArgument)); MemberInfoModel memberinfo = DeductBLL.GetMemberInfo(model.Number); DeductModel deduct = new DeductModel(); deduct.Number = model.Number; deduct.DeductMoney = model.Chayi; if (model.Chayi >= 0) { deduct.DeductReason = GetTran("000024", "会员编号") + ":" + model.Number + "," + GetTran("000107", "姓名") + ":" + Encryption.Encryption.GetDecipherName(memberinfo.Name) + "," + GetTran("000252", "补款") + ":" + model.Chayi + ",第" + model.Qishu + GetTran("006033", "期结算后的差异"); deduct.IsDeduct = 1; } else { deduct.DeductReason = GetTran("000024", "会员编号") + ":" + model.Number + "," + GetTran("000107", "姓名") + ":" + Encryption.Encryption.GetDecipherName(memberinfo.Name) + "," + GetTran("000251", "扣款") + ":" + model.Chayi + "," + GetTran("000156", "第") + model.Qishu + GetTran("006033", "期结算后的差异"); deduct.IsDeduct = 0; } deduct.ExpectNum = BLL.CommonClass.CommonDataBLL.getMaxqishu(); deduct.OperateIP = CommonDataBLL.OperateIP; deduct.OperateNum = CommonDataBLL.OperateBh; DeductBLL.AddInfo(deduct); this.Page.RegisterStartupScript("", "<script>alert('" + GetTran("001401", "操作成功!") + "');</script>"); bind(); } } if (cname == "Del") { if (DeductBLL.isExistsBonusDifference(Convert.ToInt32(e.CommandArgument))) { this.Page.RegisterStartupScript("", "<script>alert('" + GetTran("005966", "已经添加,不能删除!") + "');</script>"); return; } else { if (DeductBLL.isDelBonusDifference(Convert.ToInt32(e.CommandArgument))) { DeductBLL.DelBonusDifference(Convert.ToInt32(e.CommandArgument)); this.Page.RegisterStartupScript("", "<script>alert('" + GetTran("000749", "删除成功!") + "');</script>"); } else { this.Page.RegisterStartupScript("", "<script>alert('" + GetTran("005997", "已经被删除,不能再删!") + "');</script>"); } bind(); } } }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { this.question.Text = question.Text.Trim(); this.money.Text = money.Text.Trim(); //设置特定值防止重复提交 hid_fangzhi.Value = "0"; if (this.rad_Deduct.SelectedValue == "") { ScriptHelper.SetAlert(Page, GetTran("007748", "请选择补扣款项")); return; } string number = ""; string sql = "select number from MemberInfo where MobileTele='" + txtbh.Text + "'"; DataTable shj = DBHelper.ExecuteDataTable(sql); if (shj.Rows.Count > 0) { number = shj.Rows[0][0].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("002096", "无此编号,请检查后再重新输入") + "!')</script>"); return; } if (number != "" && this.question.Text != "" && this.money.Text != "") { string vquestion; //判断会员是否存在 if (DeductBLL.IsExist(number)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("002096", "无此编号,请检查后再重新输入") + "!')</script>"); return; } double d; if (!double.TryParse(money.Text, out d)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("002095", "金额输入有误") + "!')</script>"); return; } if (d <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("001539", "操作失败,输入的金额不能小于0") + "!')</script>"); return; } else { int iskou = int.Parse(rad_Deduct.SelectedValue); //0为扣,1为补 vquestion = this.question.Text.Trim(); DeductModel model = new DeductModel(); model.Number = DisposeString.DisString(number.Trim(), "<,>,',-", "<,>,', ", ","); model.DeductMoney = d; model.DeductReason = vquestion; model.ExpectNum = CommonDataBLL.getMaxqishu(); model.IsDeduct = iskou; model.Actype = 1; model.OperateIP = CommonDataBLL.OperateIP; model.OperateNum = CommonDataBLL.OperateBh; try { if (DeductBLL.AddDeduct(model)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("000006", "添加成功") + "!');window.location.href='DeductSalary.aspx';</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("000007", "添加失败") + "!')</script>"); } } catch (Exception) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("001507", "操作失败") + "!')</script>"); } } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script >alert('" + GetTran("002094", "所有项必填,请重新输入") + "!')</script>"); } clear(); }