Пример #1
0
        //提交保存房间信息
        public static string save_room(string infor_str)
        {
            try
            {
                string[] infor = infor_str.Split('#');
                //var db = new BathDbDataContext(connectionString);
                //var room = db.Room.FirstOrDefault(x => x.name == infor[0]);
                string cmd_str = @"update [Room] set status='"+infor[14]+"'";

                if (infor[1] != "null")
                {
                    cmd_str += ",openTime='" + infor[1] + "'";
                    //room.openTime = infor[1];
                }

                if (infor[2] != "null")
                    cmd_str += ",seat='" + infor[2] + "'";
                    //room.seat = infor[2];

                if (infor[3] != "null")
                    cmd_str += ",systemId='" + infor[3] + "'";
                    //room.systemId = infor[3];

                if (infor[4] != "null")
                    cmd_str += ",orderTechId='" + infor[4] + "'";
                    //room.orderTechId = infor[4];

                if (infor[5] != "null")
                    cmd_str += ",menu='" + infor[5] + "'";
                    //room.menu = infor[5];

                if (infor[6] != "null")
                    cmd_str += ",techId='" + infor[6] + "'";
                    //room.techId = infor[6];

                if (infor[7] != "null")
                    cmd_str += ",startTime='" + infor[7] + "'";
                    //room.startTime = infor[7];

                if (infor[8] != "null")
                    cmd_str += ",serverTime='" + infor[8] + "'";
                    //room.serverTime = infor[8];

                if (infor[9] != "null")
                    cmd_str += ",orderTime='" + infor[9] + "'";
                    //room.orderTime = infor[9];

                cmd_str += ",hintPlayed='" + infor[10] + "'";
                //room.hintPlayed = infor[10];

                if (infor[11] != "null")
                    cmd_str += ",reserveId='" + infor[11] + "'";
                    //room.reserveId = infor[11];

                if (infor[12] != "null")
                    cmd_str += ",reserveTime='" + infor[12] + "'";
                    //room.reserveTime = infor[12];

                if (infor[13] != "null")
                    cmd_str += ",selectId='" + infor[13] + "'";
                    //room.selectId = infor[13];

                //room.status = infor[14];
                //db.SubmitChanges();

                cmd_str += " where name='" + infor[0] + "'";
                var dbLayer = new DBLayer(connectionString);
                if (!dbLayer.execute_command(cmd_str))
                    return "false";

                return "true";
            }
            catch (System.Exception e)
            {
                return "false";
            }
        }
Пример #2
0
        public static string set_log_urgent(string id, string urgent)
        {
            string str = "T";
            var db = new DBLayer(connectionString);

            if (!db.execute_command("update [DepartmentLog] set urgent=" + urgent + "  where id=" + id))
                str = "F";

            return str;
        }