public static bool UpdateOrderInfo(SubmitOrderEntity entity) { bool result = false; try { using (var context = new DbContext().ConnectionStringName("CrmRstV1", new SqlServerProvider())) { var rowsAffected = context.StoredProcedure("sp_UpdateOrderInfo") .Parameter("ContactName", entity.ContactName) .Parameter("ContactPhone", entity.ContactPhone) .Parameter("DiningDate", entity.DiningDate) .Parameter("OrderId", entity.OrderId) .Parameter("PersonCount", entity.PersonCount) .Parameter("sex", entity.sex).Execute(); result = rowsAffected > 0; } } catch (Exception ex) { //TODO Logger.Log(ex); } return result; }
/// <summary> /// 获取今天所有特价菜。 /// </summary> /// <param name="startRowIndex"></param> /// <param name="maximumRows"></param> /// <param name="sortExpression"></param> /// <returns></returns> public static List<SpecialsEntity> GetTodayByRestaurantId(Guid restaurantId) { List<SpecialsEntity> result = null; try { using (var context = new DbContext().ConnectionStringName("CrmRstV1", new SqlServerProvider())) { int dayOfWeek = (int) DateTime.Now.DayOfWeek; if (dayOfWeek == 0) { dayOfWeek = 7; } var select = context.StoredProcedure("sp_GetTodayByRestaurantId") .Parameter("RestaurantId", restaurantId) .Parameter("WeekDateUse", dayOfWeek); result = select.QueryMany<SpecialsEntity>(); } } catch (Exception exception) { Logger.Log(exception); //TODO } if (result == null) { result=new List<SpecialsEntity>(); } return result; }
public static List<RestaurantImage> GetRestaurantImages(Guid restaurantId) { List<RestaurantImage> result = null; try { using (var context = new DbContext().ConnectionStringName("CrmRstV1", new SqlServerProvider())) { var select = context.StoredProcedure("SP_GetRestaurantImages") .Parameter("RestaurantId", restaurantId); result = select.QueryMany<RestaurantImage>(); } } catch (Exception) { //TODO } if (result == null) { result = new List<RestaurantImage>(); } return result; }