/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail model) { int rowsAffected; SqlParameter[] parameters = { new SqlParameter("@RpdCode", SqlDbType.VarChar, 36), new SqlParameter("@ReceiptCode", SqlDbType.VarChar, 36), new SqlParameter("@ResourcesID", SqlDbType.BigInt, 8), new SqlParameter("@Quantity", SqlDbType.Int, 4), new SqlParameter("@SalesPrice", SqlDbType.Decimal, 9), new SqlParameter("@DiscountPrice", SqlDbType.Decimal, 9), new SqlParameter("@MemberDiscountPrice", SqlDbType.Decimal, 9), new SqlParameter("@GroupPrice", SqlDbType.Decimal, 9), new SqlParameter("@DetailAmount", SqlDbType.Decimal, 9), new SqlParameter("@RpdMemo", SqlDbType.VarChar, 1000), new SqlParameter("@RpdIsDelete", SqlDbType.Int, 4) }; parameters[0].Value = model.RpdCode; parameters[1].Value = model.ReceiptCode; parameters[2].Value = model.ResourcesID; parameters[3].Value = model.Quantity; parameters[4].Value = model.SalesPrice; parameters[5].Value = model.DiscountPrice; parameters[6].Value = model.MemberDiscountPrice; parameters[7].Value = model.GroupPrice; parameters[8].Value = model.DetailAmount; parameters[9].Value = model.RpdMemo; parameters[10].Value = model.RpdIsDelete; DbHelperSQL.RunProcedure("Proc_Tb_Charge_ReceiptDetail_Update", parameters, out rowsAffected); }
/// <summary> /// 得到一个对象实体 /// </summary> public MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail GetModel(string RpdCode) { SqlParameter[] parameters = { new SqlParameter("@RpdCode", SqlDbType.VarChar, 50) }; parameters[0].Value = RpdCode; MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail model = new MobileSoft.Model.Charge.Tb_Charge_ReceiptDetail(); DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Charge_ReceiptDetail_GetModel", parameters, "ds"); if (ds.Tables[0].Rows.Count > 0) { model.RpdCode = ds.Tables[0].Rows[0]["RpdCode"].ToString(); model.ReceiptCode = ds.Tables[0].Rows[0]["ReceiptCode"].ToString(); if (ds.Tables[0].Rows[0]["ResourcesID"].ToString() != "") { model.ResourcesID = long.Parse(ds.Tables[0].Rows[0]["ResourcesID"].ToString()); } if (ds.Tables[0].Rows[0]["Quantity"].ToString() != "") { model.Quantity = int.Parse(ds.Tables[0].Rows[0]["Quantity"].ToString()); } if (ds.Tables[0].Rows[0]["SalesPrice"].ToString() != "") { model.SalesPrice = decimal.Parse(ds.Tables[0].Rows[0]["SalesPrice"].ToString()); } if (ds.Tables[0].Rows[0]["DiscountPrice"].ToString() != "") { model.DiscountPrice = decimal.Parse(ds.Tables[0].Rows[0]["DiscountPrice"].ToString()); } if (ds.Tables[0].Rows[0]["MemberDiscountPrice"].ToString() != "") { model.MemberDiscountPrice = decimal.Parse(ds.Tables[0].Rows[0]["MemberDiscountPrice"].ToString()); } if (ds.Tables[0].Rows[0]["GroupPrice"].ToString() != "") { model.GroupPrice = decimal.Parse(ds.Tables[0].Rows[0]["GroupPrice"].ToString()); } if (ds.Tables[0].Rows[0]["DetailAmount"].ToString() != "") { model.DetailAmount = decimal.Parse(ds.Tables[0].Rows[0]["DetailAmount"].ToString()); } model.RpdMemo = ds.Tables[0].Rows[0]["RpdMemo"].ToString(); if (ds.Tables[0].Rows[0]["RpdIsDelete"].ToString() != "") { model.RpdIsDelete = int.Parse(ds.Tables[0].Rows[0]["RpdIsDelete"].ToString()); } return(model); } else { return(null); } }