private void MainForm_Load(object sender, EventArgs e)
        {
            if (!SessionHelper.SYS_START_UP)
            {
                //that work!
                var message = new MassageBoxModel();
                message.TITLE       = SessionHelper.SYS_TITLE;
                message.MESSAGE     = SessionHelper.SYS_ERROR_CODE + " : " + SessionHelper.SYS_ERROR_MESSAGE;
                message.BUTTON_TYPE = ButtonType.OK;

                using (MassageBox box = new MassageBox(message))
                {
                    box.ShowDialog(this);
                }

                Application.Exit();
            }
            else
            {
                _obj = this;
                UserControlHelper.SetUserControl(panelClientBody, userControl: new UCClientBody(), dockStyle: UserControlDockStyle.DockStyleFill);

                // panelClientBody.BackgroundImage = Character.Resources.CharacterRes.bg_01;
            }
        }
Beispiel #2
0
 private void btnHome_Click(object sender, EventArgs e)
 {
     MainForm.Instance.PnlTitle.BackColor = Color.Black;
     if (!MainForm.Instance.PnlClientBody.Controls.ContainsKey("UCClientBody"))
     {
         UserControlHelper.SetUserControl(MainForm.Instance.PnlClientBody, userControl: new UCClientBody(), dockStyle: UserControlDockStyle.DockStyleFill);
     }
     MainForm.Instance.PnlClientBody.Controls["UCClientBody"].BringToFront();
 }
 private void btnSetting_Click(object sender, EventArgs e)
 {
     if (!MainForm.Instance.PnlClientBody.Controls.ContainsKey("UCClientCharacter"))
     {
         UserControlHelper.SetUserControl(MainForm.Instance.PnlClientBody, userControl: new UCClientCharacter(), dockStyle: UserControlDockStyle.DockStyleFill);
     }
     MainForm.Instance.PnlClientBody.Controls["UCClientCharacter"].BringToFront();
     MainForm.Instance.PnlTitle.BackColor = Color.FromArgb(32, 32, 32);
 }
        /// <summary>
        /// Shows the inspection hystoric by spaceship id.
        /// </summary>
        /// <param name="spaceshipId">The spaceship id.</param>
        public void ShowInspectionHystoricBySpaceshipId(string spaceshipId)
        {
            var inspectionHystoricView = UserControlHelper.GetView("InspectionHystoric");
            var viewModel = inspectionHystoricView.DataContext as InspectionHystoricViewModel;

            if (viewModel == null)
            {
                MessageBox.Show("Error mostrando el historial del aeronave.");
            }
            else
            {
                viewModel.SpaceshipId = spaceshipId;
                viewModel.ShowSpaceshipInspectionHystoricCommand.Execute(null);
                UserControlHelper.ShowView(inspectionHystoricView);
            }
        }
Beispiel #5
0
 private void btnFFAffiliation_Click(object sender, EventArgs e)
 {
     Global.PActiveHide(panelClient);
     Global.PActiveShow(PActiveFFAffiliation);
     UserControlHelper.SetUserControl(panelClientTask, userControl: new UCFFAffiliation(), dockStyle: UserControlDockStyle.DockStyleFill);
 }
Beispiel #6
0
 private void btnGuild_Click(object sender, EventArgs e)
 {
     Global.PActiveHide(panelClient);
     Global.PActiveShow(PActiveGuild);
     UserControlHelper.SetUserControl(panelClientTask, userControl: new UCGuild(), dockStyle: UserControlDockStyle.DockStyleFill);
 }
        protected void mainContent_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
        {
            // When the callback is called, reset just this frame
            mainContent.Controls.Clear();
            List <string> paramCollection = Utils.SplitStringToGenericList(e.Parameter, "||||");
            string        param           = e.Parameter;

            if (paramCollection.Count > 1)
            {
                param = paramCollection[0];
            }
            //int test = 1;

            // Get the url that was passed and load the proper control
            string pageTarget = (param.EndsWith("/") ? param.Substring(0, param.Length - 1) : param).ToLower();

            pageTarget = (pageTarget.StartsWith("/") ? pageTarget.Substring(1) : pageTarget);
            List <string> targets = Utils.SplitStringToGenericList(pageTarget, "/");
            string        keyVal  = string.Empty;
            long?         id      = null;

            //List<Control> loadedControls = new List<Control>();
            switch (targets[0])
            {
            case "personnel":                               // The Personnel functions
                switch (targets[1])
                {
                case "contact":                                     // /Personnel/Contact
                    switch (targets[2])
                    {
                    case "list":                                                                                                                            // /Personnel/Contact/List
                        ucListEmployees cntrlList = ((ucListEmployees)UserControlHelper.LoadControl(Page,
                                                                                                    "~/Personnel/ucListEmployees.ascx", new object[] { })); // Load the user control and place it
                        cntrlList.ID = "ucContactList";
                        mainContent.Controls.Add(cntrlList);
                        break;

                    case "edit":
                        // Get the ID	// /Personnel/Contact/Edit/-9223372036854775767
                        id = long.Parse(targets.Count > 3 ? targets[3] : null);

                        // Find out if we're coming back around on an edit
                        if (paramCollection.Count > 1)
                        {
                            keyVal = "ucContactEdit_";

                            // Yup - this is saved from an edit
                            Dictionary <string, string> kvp = new Dictionary <string, string>();
                            List <string> nv       = Utils.SplitStringToGenericList(paramCollection[1], "||");
                            List <string> tmpSplit = new List <string>();
                            foreach (string s in nv)
                            {
                                tmpSplit = Utils.SplitStringToGenericList(s, "|");                                                              // Split the value
                                kvp.Add(tmpSplit[0].Replace(keyVal, string.Empty),
                                        (tmpSplit.Count > 1 ? tmpSplit[1] : string.Empty));
                                //if (tmpSplit.Count > 1)
                                //{
                                //	kvp.Add(tmpSplit[0].Replace(keyVal, string.Empty), tmpSplit[1]);
                                //}
                                //else
                                //{
                                //	kvp.Add(tmpSplit[0].Replace(keyVal, string.Empty), string.Empty);
                                //}
                            }

                            // Update the value in the db
                            ContactCollection           coll   = new ContactCollection("iContactID = " + kvp["txtID"].ToString());
                            ClassGenExceptionCollection errors = new ClassGenExceptionCollection();
                            if (coll.Count > 0)
                            {
                                coll[0].FirstName = kvp["txtFirstName"];
                                coll[0].LastName  = kvp["txtLastName"];
                                errors.AddRange(coll.AddUpdateAll());
                            }
                        }

                        // Go out and get the new employee info
                        ucEditEmployee cntrlEdit = ((ucEditEmployee)UserControlHelper.LoadControl(Page,
                                                                                                  "~/Personnel/ucEditEmployee.ascx", new object[] { id })); // Load the user control and place it
                        mainContent.Controls.Add(cntrlEdit);
                        break;
                    }
                    break;

                default:
                    break;
                }

                break;

            default:
                break;
            }
        }
 private void btnSetting_Click(object sender, EventArgs e)
 {
     UserControlHelper.SetUserControl(panelBody, userControl: new UCSetting(), dockStyle: UserControlDockStyle.DockStyleFill);
 }
 private void btnMenu_Click(object sender, EventArgs e)
 {
     UserControlHelper.SetControlSizePanel(panelLeft, 190, 60);
 }
Beispiel #10
0
 public MyController(UserControlHelper helper)
 {
     ViewBag.FullName = helper.GetUserData(UserId, "Name");
 }
Beispiel #11
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     panelMenuTask.Hide();
     UserControlHelper.SetUserControl(panelClientBody, userControl: new UCClientBody(), dockStyle: UserControlDockStyle.DockStyleFill);
 }