示例#1
0
        public static List <RoomStandardItem> GetAll(string constructionCode, string planNo)
        {
            var items = new List <RoomStandardItem>();

            bool isUsingNew;

            if (string.IsNullOrEmpty(constructionCode) || string.IsNullOrEmpty(planNo))
            {
                isUsingNew = false;
            }
            else
            {
                var siyoCode = tbl_siyo_boss.GetSiyoCode(constructionCode, planNo);
                isUsingNew = IsUsingNew(constructionCode, siyoCode);
            }

            if (isUsingNew)
            {
                var newItems = RoomStandardNewItem.GetAll();
                newItems.ForEach(p => items.Add(Convert(p)));
            }
            else
            {
                var oldItems = RoomStandardOldItem.GetAll();
                oldItems.ForEach(p => items.Add(Convert(p)));
            }

            return(items);
        }
示例#2
0
 public static void Delete(int roomId, bool isUsingNew)
 {
     if (isUsingNew)
     {
         var db = RoomStandardNewItem.GetDatabase();
         db.ExecuteNonQuery("DELETE FROM RoomStandardNewItems WHERE RoomId = " + roomId);
     }
     else
     {
         var db = RoomStandardOldItem.GetDatabase();
         db.ExecuteNonQuery("DELETE FROM RoomStandardOldItems WHERE RoomId = " + roomId);
     }
 }
示例#3
0
        private static RoomStandardNewItem ConvertToNew(RoomStandardItem souce)
        {
            var newItem = new RoomStandardNewItem();

            newItem.RoomId             = souce.RoomId;
            newItem.JyouConditionLower = souce.JyouConditionLower;
            newItem.JyouConditionUpper = souce.JyouConditionUpper;
            newItem.ItemName           = souce.ItemName;
            newItem.Quantity           = souce.Quantity;
            newItem.UpdatedDateTime    = souce.UpdatedDateTime;

            return(newItem);
        }
        public static List <RoomStandardNewItem> Get(int roomId)
        {
            string sql = @"
                SELECT * FROM RoomStandardNewItems
                WHERE
                    RoomId = '" + roomId + @"'
                ORDER BY
                    JyouConditionLower,
                    JyouConditionUpper";

            var db = RoomStandardNewItem.GetDatabase();

            return(db.ExecuteQuery <RoomStandardNewItem>(sql));
        }
示例#5
0
        public static List <RoomStandardItem> GetAll(bool isUsingNew, int roomId)
        {
            var items = new List <RoomStandardItem>();

            if (isUsingNew)
            {
                var newItems = RoomStandardNewItem.Get(roomId);
                newItems.ForEach(p => items.Add(Convert(p)));
            }
            else
            {
                var oldItems = RoomStandardOldItem.Get(roomId);
                oldItems.ForEach(p => items.Add(Convert(p)));
            }

            return(items);
        }