void ButtonAssignElectronicToItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            if (ItemManagmentState.current_item == null)
            {
                Banner.Show("Need to select an\nitem description to assign.");
                return;
            }
            if (ItemManagmentState.current_electronic == null)
            {
                Banner.Show("Need to select a\nElectronic Pack to assign.");
                return;
            }
            DataRow result = MySQLRelationTable.AddGroupMember(ItemManagmentState.item_dataset.floor_item_map
                                                               , ItemManagmentState.current_electronic
                                                               , ItemManagmentState.current_item
                                                               , false
                                                               , true
                                                               , true);

            if (result != null)
            {
                result["paper_item_name"] = ItemManagmentState.current_item["item_name"];
                result["floor_name"]      = ItemManagmentState.current_electronic.ToString();
                result["electronic_item"] = true;
                ItemManagmentState.RefreshLists();
            }
        }
示例#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");
     }
 }
示例#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;
        }
示例#4
0
 void ButtonDecrementSerial_Click(object sender, ReflectorButtonEventArgs e)
 {
     if (ItemManagmentState.Barcode == null)
     {
         return;
     }
     ItemManagmentState.current_serial_length = ItemManagmentState.Barcode.Length;
 }
示例#5
0
 void ButtonAssignMacroToItem_Click(object sender, ReflectorButtonEventArgs e)
 {
     if (ItemManagmentState.current_item_serial == null)
     {
         MessageBox.Show("Need to select an item to retire.");
         return;
     }
     ItemManagmentState.current_item_serial["retire"] = 1;
 }
        void ButtonAssignElectronicToItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            DataRow current_electronic = ItemManagmentState.current_assigned_electronic;

            if (current_electronic != null && current_electronic.RowState != DataRowState.Deleted)
            {
                current_electronic["deleted"] = 1;
                current_electronic.Delete();
            }
        }
示例#7
0
 public void ClickHandler(object sender, ReflectorButtonEventArgs e)
 {
     if (SessionManagementState.open_for_play)
     {
         SessionManagementState.CloseSessionPlay();
     }
     else
     {
         SessionManagementState.OpenSessionPlay();
     }
     e.handled = true;
 }
示例#8
0
 void ButtonToggleRetired_Click(object sender, ReflectorButtonEventArgs e)
 {
     ItemManagmentState.ShowRetiredItems = !ItemManagmentState.ShowRetiredItems;
     if (ItemManagmentState.ShowRetiredItems)
     {
         Highlight = true;
     }
     else
     {
         Highlight = false;
     }
 }
示例#9
0
        void ButtonAssignMiscToItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            DataRow result = MySQLRelationTable.AddGroupMember(ItemManagmentState.item_dataset.floor_item_map
                                                               , ItemManagmentState.current_misc
                                                               , ItemManagmentState.current_item
                                                               , false
                                                               , true);

            result["paper_item_name"] = ItemManagmentState.current_item["item_name"];
            result["floor_name"]      = ItemManagmentState.current_misc.ToString();
            result["misc_item"]       = true;
        }
示例#10
0
        bool IReflectorButton.OnClick()
        {
            //InvokeOnClick( this, new EventArgs() );
            //throw new Exception( "The method or operation is not implemented." );
            ReflectorButtonEventArgs args = new ReflectorButtonEventArgs();

            if (Click != null)
            {
                Click(this, args);
            }

            return(args.handled);
        }
示例#11
0
        public void ClickHandler(object sender, ReflectorButtonEventArgs e)
        {
            DateTime end = new DateTime(2013, 12, 31);

            for (DateTime day = new DateTime(2013, 01, 01); day <= end; day = day.AddDays(1))
            {
                int n = 0;
                foreach (DataRow session in SessionManagementState.schedule.sessions.Rows)
                {
                    n++;
                    SessionManagementState.AddNewSession(day, session);
                    Application.DoEvents();
                    SessionManagementState.OpenNewSession();
                    Application.DoEvents();
                }
            }
            e.handled = true;
        }
示例#12
0
        void ButtonAssignMacroToItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            DataRow      current_macro = ItemManagmentState.current_macro;
            List <Point> indexes       = new List <Point>();

            foreach (ListboxCurrentMacroItems list in ItemManagmentState.macro_item_list)
            {
                foreach (DataGridViewCell cell in list.SelectedCells)
                {
                    cell.Selected = false;
                    indexes.Add(new Point(cell.RowIndex, cell.ColumnIndex));
                }
            }
            if (current_macro != null)
            {
                DataRow[] children = current_macro.GetChildRows("macro_item_floor_item_map");
                foreach (DataRow child in children)
                {
                    //child["item_description_id"] = DBNull.Value;
                    //child["paper_item_name"] = "";
                    child["deleted"] = 1;
                    child.Delete();
                }
            }
            foreach (ListboxCurrentMacroItems list in ItemManagmentState.macro_item_list)
            {
                foreach (DataGridViewCell cell in list.SelectedCells)
                {
                    cell.Selected = false;
                }
            }
            int n = 0;

            foreach (ListboxCurrentMacroItems list in ItemManagmentState.macro_item_list)
            {
                foreach (Point cell in indexes)
                {
                    list.Rows[cell.X].Cells[cell.Y].Selected = true;
                }
                n++;
            }
        }
示例#13
0
        void ButtonAssignMacroToItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            if (ItemManagmentState.current_item == null)
            {
                MessageBox.Show("Need to select an item description to assign.");
                return;
            }
            DataRow result = MySQLRelationTable.AddGroupMember(ItemManagmentState.item_dataset.floor_item_map
                                                               , ItemManagmentState.current_macro
                                                               , ItemManagmentState.current_item
                                                               , false
                                                               , true
                                                               , true);

            if (result != null)
            {
                result["paper_item_name"] = ItemManagmentState.current_item["item_name"];
                result["floor_name"]      = ItemManagmentState.current_macro.ToString();
                result["macro_item"]      = true;
            }
        }
示例#14
0
 void ButtonAssignPaperToItem_Click(object sender, ReflectorButtonEventArgs e)
 {
     foreach (DataRow row in ItemManagmentState.item_dataset.floor_paper_names.Rows)
     {
         DataRow[] items = ItemManagmentState.item_dataset.item_descriptions.Select("item_name='" + row["name"] + "' and inv_type='Paper'");
         if (items.Length > 0)
         {
             DataRow[] existing_relation = ItemManagmentState.item_dataset.floor_item_map.Select("floor_name='" + row["name"] + "' and paper_item_name='" + items[0]["item_name"] + "'");
             if (existing_relation.Length == 0)
             {
                 DataRow new_relation = ItemManagmentState.item_dataset.floor_item_map.NewRow();
                 new_relation["floor_name"]          = row["name"];
                 new_relation["paper_item_name"]     = items[0]["item_name"];
                 new_relation["paper_item"]          = true;
                 new_relation["item_description_id"] = items[0]["item_description_id"];
                 new_relation["floor_paper_name_id"] = row["floor_paper_name_id"];
                 ItemManagmentState.item_dataset.floor_item_map.Rows.Add(new_relation);
             }
         }
     }
 }
示例#15
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.");
                }
            }
        }
示例#16
0
        void ButtonCreateItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            DialogResult result = Banner.Show("Are you sure you want to change " + ItemManagmentState.current_item["item_name"] + "\n"
                                              + " from " + ItemManagmentState.current_item["inv_type"] + " to " + ItemManagmentState.current_inventory_type["inv_type"]
                                              , MessageBoxButtons.YesNo
                                              );

            if (result == DialogResult.Yes)
            {
                DataRow[] existing = ItemManagmentState.item_dataset.item_descriptions.Select("inv_type='" + ItemManagmentState.current_inventory_type["inv_type"]
                                                                                              + "' and item_name='" + ItemManagmentState.current_item["item_name"] + "'");
                if (existing.Length < 1)
                {
                    ItemManagmentState.current_item["inv_type"]
                        = ItemManagmentState.current_inventory_type["inv_type"];
                }
                else
                {
                    MessageBox.Show("An inventory item already exists that is the new type");
                }
            }
        }
示例#17
0
 void ButtonInvoice_Click(object sender, ReflectorButtonEventArgs e)
 {
     if (ItemManagmentState.Barcode == null)
     {
         Banner.Show("No Scanned Barcode");
         return;
     }
     if (ItemManagmentState.scanned_item == null)
     {
         String  serial   = ItemManagmentState.Barcode.Substring(0, ItemManagmentState.current_serial_length);
         DataRow new_item = ItemManagmentState.item_dataset.items.NewRow();
         new_item["series"]              = serial;
         new_item["serial_length"]       = ItemManagmentState.current_serial_length;
         new_item["item_description_id"] = ItemManagmentState.current_item["Item_description_id"];
         new_item["retire"]              = 0;
         ItemManagmentState.item_dataset.items.Rows.Add(new_item);
     }
     else
     {
         Banner.Show("Barcode already assigned to an item");
     }
 }
示例#18
0
        void ButtonAssignPaperToItem_Click(object sender, ReflectorButtonEventArgs e)
        {
            DataRow[] previous_row = ItemManagmentState.item_dataset.floor_item_map.Select(
                XDataTable.ID(ItemManagmentState.current_item.Table)
                + "='"
                + ItemManagmentState.current_item[XDataTable.ID(ItemManagmentState.current_item.Table)] + "'");
            if (previous_row.Length == 0)
            {
                previous_row = ItemManagmentState.item_dataset.floor_item_map.Select(
                    "paper_item_name"
                    + "='"
                    + DsnConnection.Escape(DsnConnection.ConnectionMode.NativeDataTable
                                           , DsnConnection.ConnectionFlavor.Unknown
                                           , ItemManagmentState.current_item[XDataTable.Name(ItemManagmentState.current_item.Table)].ToString()) + "'");
            }
            if (previous_row.Length > 0)
            {
                previous_row[0]["floor_paper_name_id"] = ItemManagmentState.current_paper["floor_paper_name_id"];
                previous_row[0]["paper_item_name"]     = ItemManagmentState.current_item["item_name"];
                previous_row[0]["floor_name"]          = ItemManagmentState.current_paper.ToString();
                previous_row[0]["paper_item"]          = true;
                //ItemManagmentState.current_floor_paper_paper_items.
            }
            else
            {
                DataRow result = MySQLRelationTable.AddGroupMember(ItemManagmentState.item_dataset.floor_item_map
                                                                   , ItemManagmentState.current_paper
                                                                   , ItemManagmentState.current_item
                                                                   , false
                                                                   , true);

                result["paper_item_name"] = ItemManagmentState.current_item["item_name"];
                result["floor_name"]      = ItemManagmentState.current_paper.ToString();
                result["paper_item"]      = true;
            }
        }
示例#19
0
 void ButtonForgetChanges_Click(object sender, ReflectorButtonEventArgs e)
 {
     ItemManagmentState.max_session = 0;
     ItemManagmentState.dataset_state.Fill(StaticDsnConnection.dsn);
     ItemManagmentState.SetMaxSession(Convert.ToInt32(ItemManagmentState.item_dataset.pos_macro_items.Compute("max(session)", null)));
 }
示例#20
0
 void ButtonDecrementSerial_Click(object sender, ReflectorButtonEventArgs e)
 {
     ItemManagmentState.current_serial_length--;
 }
示例#21
0
 public void ClickHandler(object sender, ReflectorButtonEventArgs e)
 {
     SessionManagementState.SetActiveSession();
     e.handled = true;
 }
示例#22
0
 void ButtonCreateItem_Click(object sender, ReflectorButtonEventArgs e)
 {
     ItemManagmentState.flags.filter_assigned = !ItemManagmentState.flags.filter_assigned;
     ItemManagmentState.RefreshLists();
     this.Highlight = ItemManagmentState.flags.filter_assigned;
 }