Exemplo n.º 1
0
        public void AddClick(object sender, EventArgs e)
        {
            pop_up_medium pop_up = new pop_up_medium();

            pop_up.SetParentForm(memory.GetTaskbarForm());
            if (pop_up.GetChoosen())
            {
                if (main.CB_type.SelectedIndex == 0)
                {
                    Asset asset = new Asset();
                    asset.Name        = main.TF_asset_name.Text;
                    asset.ValueTypeId = 1;
                    asset.StringValue = main.TF_asset_text.Text;
                    asset.Description = main.TF_asset_description.Text;
                    DBQueries.AddNewAsset(asset, AssetType.Text);
                }
                else
                {
                    Asset asset = new Asset();
                    asset.Name               = main.TF_asset_name.Text;
                    asset.ValueTypeId        = 4;
                    asset.CredentialUsername = main.TF_asset_text.Text;
                    asset.CredentialPassword = AesCryptography.Pasword.Encrypt(main.TF_asset_password.Text);
                    asset.Description        = main.TF_asset_description.Text;
                    DBQueries.AddNewAsset(asset, AssetType.Credential);
                }
                new set_panel_changer(memory.GetPanelChanger(), new Assets_Panel().MainPanel);
            }
        }
Exemplo n.º 2
0
        public void AddPress(object sender, EventArgs e)
        {
            pop_up_medium pop_up = new pop_up_medium();

            pop_up.SetParentForm(memory.GetTaskbarForm());
            if (pop_up.GetChoosen())
            {
                if (main.BT_add_schedule.Text.Equals("ADD"))
                {
                    if (main.CB_sunday.Checked)
                    {
                        dayChoosen = dayChoosen + "SUN|";
                    }
                    if (main.CB_monday.Checked)
                    {
                        dayChoosen = dayChoosen + "MON|";
                    }
                    if (main.CB_tuesday.Checked)
                    {
                        dayChoosen = dayChoosen + "TUE|";
                    }
                    if (main.CB_wednesday.Checked)
                    {
                        dayChoosen = dayChoosen + "WED|";
                    }
                    if (main.CB_thursday.Checked)
                    {
                        dayChoosen = dayChoosen + "THU|";
                    }
                    if (main.CB_friday.Checked)
                    {
                        dayChoosen = dayChoosen + "FRI|";
                    }
                    if (main.CB_saturday.Checked)
                    {
                        dayChoosen = dayChoosen + "SAT|";
                    }
                    dayChoosen = dayChoosen.Remove(dayChoosen.Length - 1, 1);

                    new schedule_db().AddSchedule(
                        main.TF_schedule_name.Text,
                        main.CB_robot_list.Text,
                        dayChoosen,
                        main.TF_hour.Text + ":" + main.TF_minute.Text,
                        memory.GetUsername()
                        );
                }
                else
                {
                }

                Schedule_Panel schedule       = new Schedule_Panel();
                Panel          schedule_panel = schedule.MainPanel;
                new set_panel_changer(memory.GetPanelChanger(), schedule_panel);
                memory.menuChoosen = "schedule";
                memory.RetrieveScheduleModel();
                schedule.attach_model_data();
            }
        }
Exemplo n.º 3
0
        public void SolvePress(object sender, EventArgs e)
        {
            pop_up_medium pop_up = new pop_up_medium();

            pop_up.SetParentForm(memory.GetTaskbarForm());
            if (pop_up.GetChoosen())
            {
                Console.WriteLine(main.label_queue_identifier.Text + " is set as solve....");
            }
        }
Exemplo n.º 4
0
        public void DeleteSchedule(object sender, EventArgs e)
        {
            pop_up_medium pop_up = new pop_up_medium();

            pop_up.SetParentForm(memory.GetTaskbarForm());
            if (pop_up.GetChoosen())
            {
                new schedule_db().DeleteSchedule(
                    main.schedule_id
                    );
                memory.RetrieveScheduleModel();
                main.main.attach_model_data();
            }
        }