private void Handle()
        {
            var nomesNaoPermitidos = new string[]
            {
                "adm",
                "gm",
            };

            //Verifica se o nickname possui palavras não permitidas
            if (nomesNaoPermitidos.Any(valorNaoPermitido => PacketResult.NickName.ToLower().Contains(valorNaoPermitido.ToLower())))
            {
                MessageBoxNickName(ConfirmNickNameMessageEnum.PalavasInapropriadas, PacketResult.NickName);
            }

            var nickNameInUse = new ProcedureRepository().USP_NICKNAME_CHECK(PacketResult.NickName);

            //Ocorreu Um Erro
            if (nickNameInUse == 0)
            {
                MessageBoxNickName(ConfirmNickNameMessageEnum.OcorreuUmErro, PacketResult.NickName);
            }
            //indisponivel
            if (nickNameInUse == 2)
            {
                MessageBoxNickName(ConfirmNickNameMessageEnum.Indisponivel, PacketResult.NickName);
            }
            //disponivel
            if (nickNameInUse == 1)
            {
                MessageBoxNickName(ConfirmNickNameMessageEnum.Disponivel, PacketResult.NickName);
            }
        }
 public DomainController()
 {
     dbContext     = new CaremeDBContext();
     repo          = new DomainRepository(dbContext);
     serviceRepo   = new ServiceRepository(dbContext);
     procedureRepo = new ProcedureRepository(dbContext);
 }
        public FAQController()
        {
            CaremeDBContext dbContext = new CaremeDBContext();

            repo          = new FAQRepository(dbContext);
            serviceRepo   = new ServiceRepository(dbContext);
            procedureRepo = new ProcedureRepository(dbContext);
        }
Esempio n. 4
0
        public Procedure GetProcedureData()
        {
            // get the procedure list entity from the database.
            ProcedureRepository    procedureRepository = new ProcedureRepository();
            List <ProcedureEntity> list = procedureRepository.LoadList(null);

            Procedure procedure = CalculateScreenTimeWindow(list[0]);

            procedure.SetData(list[0].CurrentTime.ToString("HH:mm"));
            GetOperationRooms(list, ref procedure);

            return(procedure);
        }
Esempio n. 5
0
        protected void SaveBtn_Click(object sender, EventArgs e)
        {
            _procedureRepo = RepositoryFactory.CreateProcedureRepo();
            //取得頁面資料
            model = WebUtils.ViewModelMapping <ProcedureViewModel>(this.Page);

            var validator   = new Validator();
            var validResult = validator.ValidateModel(model);

            if (!validResult.IsValid)
            {
                Response.Write(validResult.ErrorMessage.ToString().ToAlertFormat());
                return;
            }

            //btn處理
            ViewUtils.ButtonOff(SaveBtn, CoverBtn);

            //存檔
            var responseMessage = "";
            var successRdUrl    = String.Empty;

            try
            {
                if (String.IsNullOrWhiteSpace(Request["SignID"]))
                {
                    _procedureRepo.CreateData(model);
                    successRdUrl    = @"ProcedureDataList.aspx?orderField=CreateDate&descending=True";
                    responseMessage = "新增成功!";
                }
                else
                {
                    _procedureRepo.EditData(model);
                    successRdUrl    = @"ProcedureDataList.aspx?orderField=ModifyDate&descending=True";
                    responseMessage = "編輯成功!";
                }

                //btn處理
                ViewUtils.ButtonOn(SaveBtn, CoverBtn);
                responseMessage = responseMessage.ToAlertAndRedirect(successRdUrl);
            }
            catch (Exception ex)
            {
                responseMessage = String.Concat("存檔失敗!\r\n錯誤訊息: ", ex.Message).ToAlertFormat();
                ViewUtils.ShowRefreshBtn(CoverBtn, RefreshBtn);
            }
            finally
            {
                Response.Write(responseMessage);
            }
        }
        public Handle_PLAYER_SELECT_CHARACTER(Player player) : base(player)
        {
            var CODE = new ProcedureRepository().USP_FIRST_CREATION(Player.Member.UID, PacketResult.CHAR_TYPEID, PacketResult.HAIR_COLOR, Player.Member.Nickname);

            //Success
            if (CODE == 1)
            {
                Player.Response.Write(new byte[] { 0x11, 0x00, 0x00 });
                Player.SendResponse();
                new Handle_Shared().SendPlayerLoggedOnData(Player);
            }
            //Error
            else
            {
                Player.Disconnect();
                return;
            }
        }
Esempio n. 7
0
        private IProcedureRepository PopulateProcedureRepository(IEnumerable <string> procedureList)
        {
            IProcedureRepository procedureRepo = new ProcedureRepository();

            try
            {
                Connection.TryOpen();
                procedureList.ToList().ForEach(proc => ProcessProcedure(proc, procedureRepo));
            }
            catch (SqlException ex)
            {
                ex.Handle(ExceptionHandlingOptions.RecordAndThrow, Log);
            }
            finally
            {
                if (Connection != null && Connection.State != ConnectionState.Closed)
                {
                    Connection.Close();
                }
            }
            return(procedureRepo);
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "ProcedureData"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _procedureRepo = RepositoryFactory.CreateProcedureRepo();
                //從QueryString取得 簽核代碼
                string signID = String.IsNullOrEmpty(Request["SignID"]) ? String.Empty : Request["SignID"].ToString();

                PageTitle.Value = "組織階層資料 > 新增";
                if (!String.IsNullOrWhiteSpace(signID))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_procedureRepo.GetProcedureData(signID), this.Page);

                    SignID.ReadOnly = true;
                    PageTitle.Value = "組織階層資料 > 編輯";
                }
            }
        }
 public ProcedureService()
 {
     procedureRepository = new ProcedureRepository();
 }
Esempio n. 10
0
 public ServiceController()
 {
     procedureRepo = new ProcedureRepository();
     repo          = new ServiceRepository();
 }
 public ProcedureController()
 {
     repo = new ProcedureRepository();
 }
Esempio n. 12
0
        public void Go()
        {
            IList <ParseError> errors;
            var fragment = new TSql120Parser(false).Parse(new StringReader(_scripts), out errors);

            if (fragment == null)
            {
                return;
            }

            var visitor = new ProcedureVisitor();

            fragment.Accept(visitor);

            using (var procedureRepository = new ProcedureRepository(DacpacPath.Get(_sourceProject)))
                using (var functionRepository = new FunctionRepository(DacpacPath.Get(_sourceProject)))
                {
                    foreach (var procedure in visitor.Procedures)
                    {
                        var browser = new SolutionBrowserForm("test " + procedure.ProcedureReference.Name.BaseIdentifier.Value.UnQuote() + " does something");
                        browser.ShowDialog();

                        var destination = browser.DestinationItem;
                        if (destination == null)
                        {
                            continue;
                        }

                        if (String.IsNullOrEmpty(DacpacPath.Get(_sourceProject)) && !File.Exists(DacpacPath.Get(_sourceProject)))
                        {
                            MessageBox.Show("Cannot find dacpac for project");
                            return;
                        }

                        var parentProjectItem = destination;

                        var name = browser.GetObjectName();

                        var proc = procedureRepository.FirstOrDefault(p => p.Name.EqualsName(procedure.ProcedureReference.Name));
                        if (proc == null)
                        {
                            MessageBox.Show(string.Format("Cannot find stored procedure {0} in project compiled dacpac", procedure.ProcedureReference.Name));
                            return;
                        }

                        var testBuilder = new ProcedureBuilder(procedure.ProcedureReference.Name.BaseIdentifier.Value.UnQuote(), name, proc);
                        var script      = testBuilder.GetScript();

                        CreateNewFile(parentProjectItem, name, script);
                    }

                    foreach (var procedure in visitor.Functions)
                    {
                        var browser = new SolutionBrowserForm("test " + procedure.Name.BaseIdentifier.Value.UnQuote() + " does something");
                        browser.ShowDialog();

                        var destination = browser.DestinationItem;
                        if (destination == null)
                        {
                            continue;
                        }

                        if (String.IsNullOrEmpty(DacpacPath.Get(_sourceProject)) && !File.Exists(DacpacPath.Get(_sourceProject)))
                        {
                            MessageBox.Show("Cannot find dacpac for project");
                            return;
                        }

                        var parentProjectItem = destination;

                        var name = browser.GetObjectName();

                        var proc = functionRepository.FirstOrDefault(p => p.Name.EqualsName(procedure.Name));
                        if (proc == null)
                        {
                            MessageBox.Show(string.Format("Cannot find stored procedure {0} in project compiled dacpac", procedure.Name));
                            return;
                        }

                        var testBuilder = new ProcedureBuilder(procedure.Name.BaseIdentifier.Value.UnQuote(), name, proc);
                        var script      = testBuilder.GetScript();

                        CreateNewFile(parentProjectItem, name, script);
                    }
                }
        }
Esempio n. 13
0
 public HomeController(ProcedureRepository context)
 {
     _context = context;
 }
Esempio n. 14
0
        public void Go(){

            IList<ParseError> errors;
            var fragment = new TSql120Parser(false).Parse(new StringReader(_scripts), out errors);
            if (fragment == null)
                return;

            var visitor = new ProcedureVisitor();
            fragment.Accept(visitor);

            using (var procedureRepository = new ProcedureRepository(DacpacPath.Get(_sourceProject)))
            using (var functionRepository = new FunctionRepository(DacpacPath.Get(_sourceProject)))
            {
                foreach (var procedure in visitor.Procedures)
                {
                    var browser = new SolutionBrowserForm("test " + procedure.ProcedureReference.Name.BaseIdentifier.Value.UnQuote() + " does something");
                    browser.ShowDialog();

                    var destination = browser.DestinationItem;
                    if (destination == null)
                        continue;

                    if (String.IsNullOrEmpty(DacpacPath.Get(_sourceProject)) && !File.Exists(DacpacPath.Get(_sourceProject)))
                    {
                        MessageBox.Show("Cannot find dacpac for project");
                        return;
                    }
                    
                    var parentProjectItem = destination;
                        
                    var name = browser.GetObjectName();
                    
                    var proc = procedureRepository.FirstOrDefault(p => p.Name.EqualsName(procedure.ProcedureReference.Name));
                    if (proc == null)
                    {
                        MessageBox.Show(string.Format("Cannot find stored procedure {0} in project compiled dacpac", procedure.ProcedureReference.Name));
                        return;
                    }

                    var testBuilder = new ProcedureBuilder(procedure.ProcedureReference.Name.BaseIdentifier.Value.UnQuote(), name, proc);
                    var script = testBuilder.GetScript();

                    CreateNewFile(parentProjectItem, name , script);
                }

                foreach (var procedure in visitor.Functions)
                {
                    var browser = new SolutionBrowserForm("test " + procedure.Name.BaseIdentifier.Value.UnQuote() + " does something");
                    browser.ShowDialog();

                    var destination = browser.DestinationItem;
                    if (destination == null)
                        continue;

                    if (String.IsNullOrEmpty(DacpacPath.Get(_sourceProject)) && !File.Exists(DacpacPath.Get(_sourceProject)))
                    {
                        MessageBox.Show("Cannot find dacpac for project");
                        return;
                    }

                    var parentProjectItem = destination;

                    var name = browser.GetObjectName();

                    var proc = functionRepository.FirstOrDefault(p => p.Name.EqualsName(procedure.Name));
                    if (proc == null)
                    {
                        MessageBox.Show(string.Format("Cannot find stored procedure {0} in project compiled dacpac", procedure.Name));
                        return;
                    }

                    var testBuilder = new ProcedureBuilder(procedure.Name.BaseIdentifier.Value.UnQuote(), name, proc);
                    var script = testBuilder.GetScript();

                    CreateNewFile(parentProjectItem, name, script);
                }
            }
        }