/// <summary> /// 添加发票 /// </summary> /// <param name="en"></param> /// <returns></returns> public int add(ReceiveBill en) { string strSql = "insert into ReceiveBill (orderID, type, costTargetID, money, date) values (@orderID, @type, @target, @money, @date)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@orderID", en.orderID), new SqlParameter("@type", en.type), new SqlParameter("@target", en.targetID), new SqlParameter("@money", en.money), new SqlParameter("@date", en.date) }; int result = SqlHelper.ExecuteNonQuery(BaseHelper.DBConnStr, CommandType.Text, strSql, param); return result; }
public JsonResult ReceiveBill_add(string orderID, string type, string target, string money, string date) { ReceiveBill en = new ReceiveBill(); en.orderID = orderID; en.type = Convert.ToInt32(type); en.targetID = Convert.ToInt32(target); en.money = Convert.ToDouble(money); en.date = Convert.ToDateTime(date); DaReceiveBill dal = new DaReceiveBill(); var result = new CustomJsonResult(); result.Data = dal.add(en); return result; }