Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string result = QueryNewName.Show("Enter new Page name");

            if (result.Length > 0)
            {
                string result2 = QueryNewName.Show("Enter new Page number");
                if (result2.Length > 0)
                {
                    int n = 0;
                    try
                    {
                        n = Convert.ToInt32(result2);
                    }
                    catch (Exception e2)
                    {
                    }
                    if (n > 0)
                    {
                        Local.session_info.pages.AddPage(result, n);
                    }
                    else
                    {
                        MessageBox.Show("Invalid Page Number");
                    }
                }
            }
        }
Exemplo n.º 2
0
 void ButtonCreateItem_Click(object sender, ReflectorButtonEventArgs e)
 {
     if (ItemManagmentState.current_inventory_type != null)
     {
         String newname = QueryNewName.Show("Enter new " + ItemManagmentState.current_inventory_type["inv_type"] + " item name");
         if (newname != null && newname != "")
         {
             String condition = "inv_type='"
                                + DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable,
                                                       DsnConnection.ConnectionFlavor.Unknown, ItemManagmentState.current_inventory_type["inv_type"].ToString()) + "'"
                                + " and item_name='"
                                + DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable,
                                                       DsnConnection.ConnectionFlavor.Unknown, newname) + "'";
             DataRow[] existing = ItemManagmentState.item_dataset.item_descriptions.Select(condition);
             if (existing.Length < 1)
             {
                 DataRow newrow = ItemManagmentState.item_dataset.item_descriptions.CreateItem(newname);
                 newrow["inv_type"] = ItemManagmentState.current_inventory_type["inv_type"];
                 ItemManagmentState.current_item = newrow;
                 DsnSQLUtil.CommitChanges(ItemManagmentState.item_dataset_dsn, ItemManagmentState.item_dataset);
             }
             else
             {
                 MessageBox.Show("Inventory item of specified type already exists");
             }
         }
     }
     else
     {
         Banner.Show("Must Select Inventory Type");
     }
 }
Exemplo n.º 3
0
        void ButtonDecrementSerial_Click(object sender, ReflectorButtonEventArgs e)
        {
            String barcode = QueryNewName.Show("Enter new Barcode");

            ItemManagmentState.Barcode = barcode;
            ItemManagmentState.current_serial_length = ItemManagmentState.Barcode.Length;
        }
Exemplo n.º 4
0
        private void AddImageButton_Click(object sender, EventArgs e)
        {
            Stream         myStream;
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = ".";
            openFileDialog1.Filter           = "image files (*.png;*.bmp;*.ico;*.gif;*.jpg)|*.png;*.bmp;*.ico;*.gif;*.jpg|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 1;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Bitmap image = new Bitmap(openFileDialog1.FileName);
                    String s     = openFileDialog1.FileName;
                    int    x     = s.LastIndexOf('.');
                    int    w     = s.LastIndexOf('\\');
                    if (w < 0)
                    {
                        w = s.LastIndexOf('/');
                    }
                    if (w <= 0)
                    {
                        w = 0;
                    }
                    else
                    {
                        w++;                         // skip the / or \
                    }
                    string result2 = QueryNewName.Show("Enter Image Name", s.Substring(w, x - w));
                    if (result2.Length > 0)
                    {
                        Stream  stream = openFileDialog1.OpenFile();
                        DataRow row    = Local.session_info.images.NewRow();
                        row[1] = result2;
                        byte[] buffer = new byte[stream.Length];
                        stream.Read(buffer, 0, (int)stream.Length);
                        row[2] = s;
                        row[3] = buffer;
                        Local.session_info.images.Rows.Add(row);
                        Local.session_info.images.AcceptChanges();

                        // add the image to the image list...
                        Local.imageList1.Images.Add(image);
                        // add the text and image index tot he view
                        imageList.Items.Add(result2, Local.imageList1.Images.Count - 1);
                    }
                    else
                    {
                        image.Dispose();
                    }
                }
                catch (Exception e2)
                {
                    Console.WriteLine(e2.Message);
                }
            }
        }
Exemplo n.º 5
0
        private void buttonNewStyle_Click(object sender, EventArgs e)
        {
            String newname = QueryNewName.Show("Enter new style name");

            core_common.GetGlareSetAttributes(newname);
            listBox2.DataSource = null;
            listBox2.DataSource = core_common.glare_attribs;
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string result = QueryNewName.Show("Enter new Session Sales name");

            if (result.Length > 0)
            {
                Local.session_info.AddSession(result);
            }
        }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            String project = QueryNewName.Show("Enter new project path");

            if (project != null && project.Length > 1)
            {
                ProjectData.project_data_set.NewProjectGroup(project, project);
            }
        }
Exemplo n.º 8
0
        private void buttonCreateGlareset_Click(object sender, EventArgs e)
        {
            String dialog = QueryNewName.Show("Enter New Glare Set Name");

            if (dialog != null && dialog.Length > 0)
            {
                GlareSetData gsd = core_common.GetGlareSetData(dialog);
                listBox1.DataSource = null;
                listBox1.DataSource = core_common.glaresets;
            }
        }
Exemplo n.º 9
0
        private void NewFont_Click(object sender, EventArgs e)
        {
            QueryNewName qnn = new QueryNewName("Enter a name for this font...");

            qnn.ShowDialog();
            if (qnn.DialogResult == DialogResult.OK)
            {
                font_tracker f = FontEditor.GetFontTracker(qnn.textBox1.Text);
                this.FontList.DataSource = null;
                this.FontList.DataSource = fonts;
            }
            qnn.Dispose();
        }
Exemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            String value = QueryNewName.Show("Enter new game name");

            if (value != null && value.Length > 0)
            {
                DataRow game = Local.schedule.games.NewGame(value);
                if (game != null)
                {
                    EditGamePatterns.Show(game);
                }
            }
        }
Exemplo n.º 11
0
        private void buttonNewMacro_Click(object sender, EventArgs e)
        {
            QueryNewName name = new QueryNewName("Enter New Session Macro Name");

            name.ShowDialog();
            if (name.DialogResult == DialogResult.OK)
            {
                DataRow row = table1.NewRow();
                row[xperdex.classes.XDataTable.Name(table1)] = name.textBox1.Text;
                row.EndEdit();
                table1.Rows.Add(row);
                table1.AcceptChanges();
            }
        }
Exemplo n.º 12
0
        protected override void OnClick(EventArgs e)
        {
            if (ControlList.data.current_session_macro_session != null)
            {
                DataRow current_session_macro_session = ControlList.data.current_session_macro_session;
                DataRow session = current_session_macro_session.GetParentRow("session_in_session_macro");
                DataRow group   = current_session_macro_session.GetParentRow("session_macro_has_session");
                String  NewName = QueryNewName.Show("Enter name for session " + session[SessionTable.NameColumn] + " in group " + group[SessionMacroTable.NameColumn]
                                                    , current_session_macro_session[SessionDayMacroSessionTable.NameColumn] as string);

                current_session_macro_session[SessionDayMacroSessionTable.NameColumn] = NewName;
                //dataRow[SessionDayMacroSessionTable.NameColumn] = NewName;
                //current_session_macro_session.Table.AcceptChanges();
                //MySQLDataTable dt = current_session_macro_session.Table as MySQLDataTable;
                //if( dt != null )
                //		dt.CommitChanges();
            }
        }
Exemplo n.º 13
0
 public Pattern(ScheduleDataSet schedule, Patterns pattern_data)
 {
     ID   = Guid.Empty;
     row  = schedule.patterns.NewRow();
     Name = QueryNewName.Show("Enter new pattern name");
     if (Name == null || Name == "")
     {
         throw new NullReferenceException("Name cannot be blank.");
     }
     _repeat_count = 1;
     algorithm     = 0;
     _mode_mod     = mode_modifications.NoExpansion;
     masks         = new List <System.Collections.Specialized.BitVector32>(25);
     sub_patterns  = new List <Pattern>();
     //row["pattern_name"] = Name;
     changed           = true;
     this.pattern_list = pattern_data;
     //pattern_data = schedule.pattern_data;
     schedule.patterns.Rows.Add(row);
     UpdateRow();
 }
Exemplo n.º 14
0
        void ButtonCreateItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            String newname = QueryNewName.Show("Enter new inventory type");

            if (newname != null && newname != "")
            {
                DataRow[] existing = ItemManagmentState.inventory_types.Select("inv_type='"
                                                                               + DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable, DsnConnection.ConnectionFlavor.Unknown, newname)
                                                                               + "'");
                if (existing.Length < 1)
                {
                    DataRow row = ItemManagmentState.inventory_types.NewRow();
                    row["inv_type"] = newname;
                    ItemManagmentState.inventory_types.Rows.Add(row);
                    ItemManagmentState.current_inventory_type = row;
                }
                else
                {
                    MessageBox.Show("Inventory type already exists.");
                }
            }
        }