示例#1
0
        public DataTable GetAllLanguages()
        {
            try
            {
                MasterLogic masterLogic = new MasterLogic();
                return(masterLogic.GetAllLanguages().ToDataTable());
            }
            catch (BusinessLogicException ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();
                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "GetAllLanguages",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.BusinessError.ToString(),
                                                                           Constants.faultBusinessError,
                                                                           AppEnum.FaultSourceWS.BusinessError);
                throw soapException;
            }
            catch (Exception ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();

                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "GetAllLanguages",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.AplicationError.ToString(),
                                                                           Constants.faultAplicationError,
                                                                           AppEnum.FaultSourceWS.AplicationError);
                throw soapException;
            }
        }
示例#2
0
        public int DeleteLanguage(int languageId)
        {
            try
            {
                MasterLogic masterLogic = new MasterLogic();
                return(masterLogic.DeleteLanguage(languageId));
            }
            catch (BusinessLogicException ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();
                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "DeleteLanguage",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.BusinessError.ToString(),
                                                                           Constants.faultBusinessError,
                                                                           AppEnum.FaultSourceWS.BusinessError);
                throw soapException;
            }
            catch (Exception ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();

                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "DeleteLanguage",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.AplicationError.ToString(),
                                                                           Constants.faultAplicationError,
                                                                           AppEnum.FaultSourceWS.AplicationError);
                throw soapException;
            }
        }
示例#3
0
        public int SelectCountCategoryByName(string categoryName)
        {
            try
            {
                MasterLogic masterLogic = new MasterLogic();
                return(masterLogic.SelectCountCategoryByName(categoryName));
            }
            catch (BusinessLogicException ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();
                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "SelectCountCategoryByName",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.BusinessError.ToString(),
                                                                           Constants.faultBusinessError,
                                                                           AppEnum.FaultSourceWS.BusinessError);
                throw soapException;
            }
            catch (Exception ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();

                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "SelectCountCategoryByName",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.AplicationError.ToString(),
                                                                           Constants.faultAplicationError,
                                                                           AppEnum.FaultSourceWS.AplicationError);
                throw soapException;
            }
        }
        public int insertAuthor(string authorName)
        {
            try
            {
                MasterLogic masterLogic = new MasterLogic();
                return(masterLogic.insertAuthor(authorName));
            }
            catch (BusinessLogicException ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();
                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "insertAuthor",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.BusinessError.ToString(),
                                                                           Constants.faultBusinessError,
                                                                           AppEnum.FaultSourceWS.BusinessError);
                throw soapException;
            }
            catch (Exception ex)
            {
                HandleSoapException handleSoapExceptionnew = new HandleSoapException();
                SoapException       soapException          = new SoapException();

                soapException = handleSoapExceptionnew.CreateSoapException(Constants.faultUri,
                                                                           "insertAuthor",
                                                                           ex.Message,
                                                                           AppEnum.FaultSourceWS.AplicationError.ToString(),
                                                                           Constants.faultAplicationError,
                                                                           AppEnum.FaultSourceWS.AplicationError);
                throw soapException;
            }
        }
示例#5
0
 private void Awake()
 {
     //DontDestroyOnLoad(gameObject);
     GM = GetComponent <GameManager>();
     ML = GetComponent <MasterLogic>();
     AddRules();
     //playerRuleSheet.SetActive(false);
 }
        public void GrabMenuWithActionUrl()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuType1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(2));
            Assert.That(menu[1].MenuItems[0], Has.Property("Url").EqualTo("/Photo/ManageAlbum"));
        }
        public void GrabMenuWithAction()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuType1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(2));
            Assert.That(menu[1].MenuItems, Has.Count.EqualTo(1));
        }
        public void GrabMenuWithSubMenu()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuH1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(1));
            Assert.That(menu[0], Has.Property("Text").EqualTo("administration"));
            Assert.That(menu[0].MenuItems, Has.Count.EqualTo(2));
        }
        public void GrabBasicMenu()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\BaseMenu1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(2));
            Assert.That(menu[0], Has.Property("Url").EqualTo("/Login.aspx"));
            Assert.That(menu[0], Has.Property("Text").EqualTo("Login Page"));
        }
        public void GrabMenuWithSubMenuUrlAndText()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuH1.Xml").MenuItems;

            Assert.That(menu[0].MenuItems[0].Text, Is.EqualTo("Login Page"));
            Assert.That(menu[0].MenuItems[1].Text, Is.EqualTo("Registration Page"));
            Assert.That(menu[0].MenuItems[0], Has.Property("Url").EqualTo("/Login.aspx"));
            Assert.That(menu[0].MenuItems[1], Has.Property("Url").EqualTo("/CreateUser.aspx"));
        }
        public void GrabMenuWithSubMenuTypes()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuH1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(1));
            Assert.That(menu[0], Is.TypeOf(typeof(MenuItem)));
            Assert.That(menu[0].MenuItems[0], Is.TypeOf(typeof(MenuLink)));
            Assert.That(menu[0].MenuItems[1], Is.TypeOf(typeof(MenuLink)));
        }
        private void comboBoxMasterInformation_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                radioInsert.Checked          = false;
                radioUpdate.Checked          = false;
                radioDelete.Checked          = false;
                labelSystemMessage.Text      = Constants.msgLabelDefault;
                labelSystemMessage.ForeColor = System.Drawing.Color.Black;
                textBoxName.Text             = null;

                dataGridViewMasterInformation.DataSource = null;
                MasterLogic masterLogic = new MasterLogic();

                switch (comboBoxMasterInformation.SelectedItem.ToString())
                {
                case "Author":
                    dataGridViewMasterInformation.DataSource = masterLogic.GetAllAuthors();
                    break;

                case "Category":
                    dataGridViewMasterInformation.DataSource = masterLogic.GetAllCategories();
                    break;

                case "Language":
                    dataGridViewMasterInformation.DataSource = masterLogic.GetAllLanguages();
                    break;
                }

                dataGridViewMasterInformation.Columns[Constants.fieldID].Visible = false;
            }
            catch (BusinessLogicException ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                labelSystemMessage.Text      = Constants.msgErrorBusinessToUser + ex.Message;
            }
            catch (Exception ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                labelSystemMessage.Text      = Constants.msgErrorSystemToUser;
            }
        }
示例#13
0
        private void BookMaintenanceForm_Load(object sender, EventArgs e)
        {
            try
            {
                MasterLogic masterLogic = new MasterLogic();
                comboBoxAuthor.DataSource    = masterLogic.GetAllAuthors();
                comboBoxAuthor.DisplayMember = "Description";
                comboBoxAuthor.ValueMember   = "ID";

                comboBoxCategory.DataSource    = masterLogic.GetAllCategories();
                comboBoxCategory.DisplayMember = "Description";
                comboBoxCategory.ValueMember   = "ID";

                comboBoxLanguage.DataSource    = masterLogic.GetAllLanguages();
                comboBoxLanguage.DisplayMember = "Description";
                comboBoxLanguage.ValueMember   = "ID";

                this.disableComboBoxes();
                this.disableFieldsOfMaintenance();

                this.clearAllFields();
            }
            catch (BusinessLogicException ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                labelSystemMessage.Text      = Constants.msgErrorBusinessToUser + ex.Message;
            }
            catch (Exception ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                labelSystemMessage.Text      = Constants.msgErrorSystemToUser;
            }
        }
示例#14
0
    // Start is called before the first frame update
    void Awake()
    {
        ML               = GetComponent <MasterLogic>();
        isDamaged        = false;
        currentlyTrapped = false;
        damaged          = GameObject.Find("Damage");
        damaged.SetActive(false);
        //allProps = new List<List<GameObject>>() { };
        allProps = new List <GameObject>[7] {
            rocks, mushrooms, rats, webs, gems, stalagmites, cracks
        };
        transformPoints = new List <List <Vector2> >()
        {
        };

        foreach (GameObject r in rockSpawn)
        {
            rockTransformPoints.Add(r.transform.position);
        }
        transformPoints.Add(rockTransformPoints);

        foreach (GameObject s in shroomSpawn)
        {
            shroomTransformPoints.Add(s.transform.position);
        }
        transformPoints.Add(shroomTransformPoints);

        foreach (GameObject r in ratSpawn)
        {
            ratTransformPoints.Add(r.transform.position);
        }
        transformPoints.Add(ratTransformPoints);

        foreach (GameObject w in webSpawn)
        {
            webTransformPoints.Add(w.transform.position);
        }
        transformPoints.Add(webTransformPoints);

        foreach (GameObject g in gemSpawn)
        {
            gemTransformPoints.Add(g.transform.position);
        }
        transformPoints.Add(gemTransformPoints);

        foreach (GameObject s in stalagmiteSpawn)
        {
            stalagmiteTransformPoints.Add(s.transform.position);
        }
        transformPoints.Add(stalagmiteTransformPoints);

        foreach (GameObject c in crackSpawn)
        {
            crackTransformPoints.Add(c.transform.position);
        }
        transformPoints.Add(crackTransformPoints);

        foreach (GameObject b in backPackSpawnPoints)
        {
            backpackTransformPoints.Add(b.transform.position);
        }

        //Debugging Purposes
        Debug.Log("GameStart");
        DontDestroyOnLoad(gameObject);

        /*
         * allProps.Add(rocks);
         * allProps.Add(mushrooms);
         * allProps.Add(rats);
         * allProps.Add(webs);
         * allProps.Add(gems);
         * allProps.Add(stalagmites);
         * allProps.Add(cracks);
         */
    }
        private void buttonExecute_Click(object sender, EventArgs e)
        {
            try
            {
                labelSystemMessage.ForeColor = System.Drawing.Color.Black;
                labelSystemMessage.Text      = Constants.msgLabelDefault;

                if (radioInsert.Checked)
                {
                    if (textBoxName.Text.Length == 0)
                    {
                        labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                        labelSystemMessage.Text      = Constants.msgValidInformation;
                    }
                    else
                    {
                        int         resultOperation = 0;
                        MasterLogic masterLogic     = new MasterLogic();
                        switch (comboBoxMasterInformation.SelectedItem.ToString())
                        {
                        case "Author":
                            resultOperation = masterLogic.insertAuthor(textBoxName.Text);
                            break;

                        case "Category":
                            resultOperation = masterLogic.insertCategory(textBoxName.Text);
                            break;

                        case "Language":
                            resultOperation = masterLogic.insertLanguage(textBoxName.Text);
                            break;
                        }

                        if (resultOperation == 0)
                        {
                            labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                            labelSystemMessage.Text      = Constants.msgErrorBusinessToUser;
                        }
                        else
                        {
                            labelSystemMessage.Text = Constants.msgOperationCompleted;
                            this.buttonList_Click(sender, e);
                        }
                    }
                }
                else if (radioUpdate.Checked)
                {
                    if ((textBoxName.Text.Length == 0) ||
                        (dataGridViewMasterInformation.DataSource == null && dataGridViewMasterInformation.SelectedRows.Count == 0))
                    {
                        labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                        labelSystemMessage.Text      = Constants.msgSelectRecord;
                    }
                    else
                    {
                        int         resultOperation = 0;
                        MasterLogic masterLogic     = new MasterLogic();
                        int         iDColumnIndex   = (int)AppEnum.TabMasterModel.ID;
                        int         informationID   = (int)dataGridViewMasterInformation.SelectedRows[0].Cells[iDColumnIndex].Value;

                        switch (comboBoxMasterInformation.SelectedItem.ToString())
                        {
                        case "Author":
                            resultOperation = masterLogic.updateAuthor(textBoxName.Text, informationID);
                            break;

                        case "Category":
                            resultOperation = masterLogic.updateCategory(textBoxName.Text, informationID);
                            break;

                        case "Language":
                            resultOperation = masterLogic.updateLanguage(textBoxName.Text, informationID);
                            break;
                        }

                        if (resultOperation == 0)
                        {
                            labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                            labelSystemMessage.Text      = Constants.msgErrorBusinessToUser;
                        }
                        else
                        {
                            labelSystemMessage.ForeColor = System.Drawing.Color.Black;
                            labelSystemMessage.Text      = Constants.msgOperationCompleted;
                            this.buttonList_Click(sender, e);
                        }
                    }
                }
                else if (radioDelete.Checked)
                {
                    if ((textBoxName.Text.Length == 0) ||
                        (dataGridViewMasterInformation.DataSource == null && dataGridViewMasterInformation.SelectedRows.Count == 0))
                    {
                        labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                        labelSystemMessage.Text      = Constants.msgSelectRecord;
                    }
                    else
                    {
                        int         resultOperation = 0;
                        MasterLogic masterLogic     = new MasterLogic();
                        int         iDColumnIndex   = (int)AppEnum.TabMasterModel.ID;
                        int         informationID   = (int)dataGridViewMasterInformation.SelectedRows[0].Cells[iDColumnIndex].Value;

                        switch (comboBoxMasterInformation.SelectedItem.ToString())
                        {
                        case "Author":
                            resultOperation = masterLogic.DeleteAuthor(informationID);
                            break;

                        case "Category":
                            resultOperation = masterLogic.DeleteCategory(informationID);
                            break;

                        case "Language":
                            resultOperation = masterLogic.DeleteLanguage(informationID);
                            break;
                        }

                        if (resultOperation == 0)
                        {
                            labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                            labelSystemMessage.Text      = Constants.msgErrorBusinessToUser;
                        }
                        else
                        {
                            labelSystemMessage.ForeColor = System.Drawing.Color.Black;
                            labelSystemMessage.Text      = Constants.msgOperationCompleted;
                            this.buttonList_Click(sender, e);
                        }
                    }
                }
                else
                {
                    labelSystemMessage.Text = Constants.msgSelectRecord;
                }
            }
            catch (BusinessLogicException ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                labelSystemMessage.Text      = Constants.msgErrorBusinessToUser + ex.Message;
            }
            catch (Exception ex)
            {
                //Error log simulate
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
                labelSystemMessage.ForeColor = System.Drawing.Color.Red;
                labelSystemMessage.Text      = Constants.msgErrorSystemToUser;
            }
        }
        public JsonResult Menu()
        {
            MasterLogic mastermodel = new MasterLogic(new MvcRouteHelper(Url));

            return(Json(mastermodel.CreateMenu(Path.Combine(Global.PhysicalPath, "WebMvcSitemap.Xml"))));
        }
示例#17
0
 void Start()
 {
     ML   = GameObject.Find("LogicHandler").GetComponent <MasterLogic>();
     toss = GameObject.Find("AudioManager").GetComponent <AudioMaster>();
 }
 private void Start()
 {
     cameraSizeStart = sceneCamera.orthographicSize;
     fadeImage.CrossFadeAlpha(0, 0, true);
     ML = GameObject.Find("LogicHandler").GetComponent <MasterLogic>();
 }