/// <summary> /// 绑定数据 /// </summary> public void Bind() { if (KeyID != 0) { Hi.Model.BD_Rebate OrderModel = OrderBll.GetModel(KeyID); if (OrderModel != null) { this.lblOtype.InnerText = OrderModel.RebateType == 1 ? "整单返利" : "分摊返利"; this.lblReceiptNo.InnerText = OrderModel.ReceiptNo; this.lblRemark.InnerText = OrderModel.Remark; this.lblCreateDate.InnerText = OrderModel.UserdAmount.ToString("N"); this.lblAddType.InnerText = OrderModel.RebateState == 1 || OrderModel.EndDate < DateTime.Now ? "有效" : "失效"; this.lblTotalPrice.InnerText = OrderModel.RebateAmount.ToString("N"); this.lblPayedPrice.InnerText = OrderModel.EnableAmount.ToString("N"); this.lblArriveDate.InnerText = OrderModel.StartDate.ToString("yyyy-MM-dd") + "至" + OrderModel.EndDate.ToString("yyyy-MM-dd"); BindOrderDetail(OrderModel.DisID); } else { this.rpDtl.DataSource = ""; this.rpDtl.DataBind(); } } else { Response.Redirect("../NoOperable.aspx"); return; } }
protected void btn_Del(object sender, EventArgs e) { Hi.Model.BD_Rebate rebate = new Hi.Model.BD_Rebate(); if (KeyID != 0) //修改 { rebate = new Hi.BLL.BD_Rebate().GetModel(KeyID); rebate.dr = 1; rebate.ts = DateTime.Now; rebate.modifyuser = UserID; if (new Hi.BLL.BD_Rebate().Update(rebate)) { Response.Redirect("RebateList.aspx"); Response.End(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "Result", "<script>layerCommon.msg('修改失败!', IconOption.错误, 2000);</script>"); return; } } else //新增 { Page.ClientScript.RegisterStartupScript(this.GetType(), "Result", "<script>layerCommon.msg('新增失败!', IconOption.错误, 2000);</script>"); return; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Hi.Model.BD_Rebate model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hi.Model.BD_Rebate model) { return(dal.Add(model)); }