/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Order.Tb_Order_BusCar model) { int rowsAffected; SqlParameter[] parameters = { new SqlParameter("@BusCarID", SqlDbType.NVarChar, 50), new SqlParameter("@BusCustID", SqlDbType.BigInt, 8), new SqlParameter("@BusReleaseID", SqlDbType.BigInt, 8), new SqlParameter("@BusBussId", SqlDbType.BigInt, 8), new SqlParameter("@Created", SqlDbType.DateTime) }; parameters[0].Value = model.BusCarID; parameters[1].Value = model.BusCustID; parameters[2].Value = model.BusReleaseID; parameters[3].Value = model.BusBussId; parameters[4].Value = model.Created; DbHelperSQL.RunProcedure("Proc_Tb_Order_BusCar_Update", parameters, out rowsAffected); }
/// <summary> /// 得到一个对象实体 /// </summary> public MobileSoft.Model.Order.Tb_Order_BusCar GetModel(string BusCarID) { SqlParameter[] parameters = { new SqlParameter("@BusCarID", SqlDbType.NVarChar, 50) }; parameters[0].Value = BusCarID; MobileSoft.Model.Order.Tb_Order_BusCar model = new MobileSoft.Model.Order.Tb_Order_BusCar(); DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Order_BusCar_GetModel", parameters, "ds"); if (ds.Tables[0].Rows.Count > 0) { model.BusCarID = ds.Tables[0].Rows[0]["BusCarID"].ToString(); if (ds.Tables[0].Rows[0]["BusCustID"].ToString() != "") { model.BusCustID = long.Parse(ds.Tables[0].Rows[0]["BusCustID"].ToString()); } if (ds.Tables[0].Rows[0]["BusReleaseID"].ToString() != "") { model.BusReleaseID = long.Parse(ds.Tables[0].Rows[0]["BusReleaseID"].ToString()); } if (ds.Tables[0].Rows[0]["BusBussId"].ToString() != "") { model.BusBussId = long.Parse(ds.Tables[0].Rows[0]["BusBussId"].ToString()); } if (ds.Tables[0].Rows[0]["Created"].ToString() != "") { model.Created = DateTime.Parse(ds.Tables[0].Rows[0]["Created"].ToString()); } return(model); } else { return(null); } }