Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cmdStr"></param>
        /// <returns></returns>
        internal static ICmd ParseSqlCmdString(string cmdStr, CoreEA.ICoreEAHander dbe)
        {
            ICmd curCmd = null;

            if (string.IsNullOrEmpty(cmdStr))
            {
                ProcessException.DisplayErrors(new Exception("Empty Command"));
                return(null);
            }
            try
            {
                cmdStr = cmdStr.TrimStart();
                cmdStr = cmdStr.TrimEnd();

                //Can't to lower , otherwise the insert data will never 大写
                //cmdText = cmdText.ToLower();
                string tempCmdText = cmdStr.ToLower();
                if (tempCmdText.StartsWith("select"))
                {
                    curCmd = new SelectCmd(dbe);
                }
                else if (tempCmdText.StartsWith("insert"))
                {
                    curCmd = new InsertCmd(dbe);
                }
                else if (tempCmdText.StartsWith("update"))
                {
                    curCmd = new UpdateCmd(dbe);
                }
                else if (tempCmdText.StartsWith("delete"))
                {
                    curCmd = new DeleteCmd(dbe);
                }
                else if (tempCmdText.StartsWith("alter") || (tempCmdText.StartsWith("drop")))
                {
                    curCmd = new SpecialCmd(dbe);
                }
                else if (tempCmdText.StartsWith("create"))
                {
                    curCmd = new CreateCmd(dbe);
                }
                else if (tempCmdText.StartsWith("sp_rename"))
                {
                    curCmd = new SpecialCmd(dbe);
                }
                else
                {
                    curCmd = null;
                    //throw new Exception("ErrorMsg_CannotParseSqlCmd".GetFromResourece());
                }
            }
            catch (Exception ee)
            {
                ProcessException.DisplayErrors(ee);
            }

            return(curCmd);
        }
Ejemplo n.º 2
0
 public Table(CreateCmd command)
 {
     Id          = command.Id;
     Code        = command.Code;
     Name        = command.Name;
     Capacity    = command.Capacity;
     LocationId  = command.LocationId;
     Description = command.Description;
     ApplyChange(new CreatedEvent(Id, Code, Name, Capacity, LocationId, Description));
 }
Ejemplo n.º 3
0
        public CurrentOrder(CreateCmd message)
        {
            List <CreatedEvent.OrderItem> orderItems = new List <CreatedEvent.OrderItem>();

            foreach (var item in message.CommandModel.AddedOrderItems)
            {
                orderItems.Add(new CreatedEvent.OrderItem(CompGuid.NewGuid(), item.ProductId, item.Quantity));
            }
            ApplyChange(new CreatedEvent(message.Id, message.CommandModel.TableId, orderItems));
        }
Ejemplo n.º 4
0
 private void WindowOnCancelEvent(object sender, OkEventArgs e)
 {
     if (UserSettings.Wifi)
     {
         string str = "netsh wlan stop hostednetwork";
         CreateCmd.create(str);
         UserSettings.Wifi = false;
         MessageBox message = new MessageBox();
         message.configure = _configure;
         message.ShowTime("WIFI", "wifi热点已关闭!", 2);
     }
     CloseEvent?.Invoke(this, new OkEventArgs());
 }
Ejemplo n.º 5
0
        private void Openwifi(string [] stringArray)
        {
            string str = "netsh wlan set hostednetwork mode=allow ssid=" + stringArray[0] + " key=" + stringArray[1];

            CreateCmd.create(str);
            // 命令行输入命令,用来自动连接wifi:netsh interface ip set address name="本地连接" source=dhcp
            str = "netsh wlan start hostednetwork";
            CreateCmd.create(str);
            str = "netsh interface ip set address name=宽带连接 source=dhcp";
            CreateCmd.create(str);
            str = "netsh interface ip set address name=本地连接 source=dhcp";
            CreateCmd.create(str);
            UserSettings.Wifi = true;
        }