Exemplo n.º 1
0
        private void setSetTotalWidths(float[] mainTableAbsoluteWidths)
        {
            if (SharedData.PageSetup.MainTablePreferences.TableType != TableType.NormalTable)
            {
                return;
            }

            if (mainTableAbsoluteWidths.Any(x => x > 0))
            {
                MainTable.SetTotalWidth(mainTableAbsoluteWidths);
            }
            else
            {
                MainTable.SetWidths(SharedData.ColumnsWidths);
            }
        }
Exemplo n.º 2
0
        public static Mock <IDbConnectionFactory> StorageDbFactoryMocks()
        {
            var connectionMock = new Mock <SQLiteConnection>();

            MainTable dataTable = new MainTable();



            connectionMock.Setup(x => x.Table <MainTable>().FirstOrDefault()).Returns(dataTable);

            var dbfactorymock = new Mock <IDbConnectionFactory>();

            dbfactorymock.Setup(x => x.GetConnection()).Returns(connectionMock.Object);

            return(dbfactorymock);
        }
Exemplo n.º 3
0
        /* the most major method for the class -> return table to the client */
        public override DataTable GetTable()
        {
            // reset table just in case and set current to zero
            MainTable.Reset();
            Current = 0;

            AddColumn(MainTable, "Ashlin SKU", false);
            AddColumn(MainTable, "BP Item ID", false);
            AddColumn(MainTable, "On Hand", false);
            AddColumn(MainTable, "Reorder Quantity", false);
            AddColumn(MainTable, "Reorder Level", false);
            AddColumn(MainTable, "Purchase Order", true);
            AddColumn(MainTable, "Discontinue", true);

            // starting work for begin loading data to the table
            DataTable table = Properties.Settings.Default.StockQuantityTable;

            // start loading data
            MainTable.BeginLoadData();

            // add data to each row
            foreach (string sku in skuList)
            {
                DataRow row = MainTable.NewRow();
                Current++;

                row[0] = sku;                                 // ashlin sku
                try
                {
                    DataRow rowCopy = table.Select("SKU = \'" + sku + '\'')[0];
                    row[1] = rowCopy[1];                      // bp item id
                    row[2] = rowCopy[2];                      // on hand
                    row[3] = rowCopy[3];                      // reorder quantity
                    row[4] = rowCopy[4];                      // reorder level
                }
                catch { /* ignore -> null case */ }
                row[5] = false;                               // purchase order
                row[6] = false;                               // discontinue

                MainTable.Rows.Add(row);
            }

            // finish loading data
            MainTable.EndLoadData();

            return(MainTable);
        }
Exemplo n.º 4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Company   newcompany   = new Company();
            MainTable newmaintable = new MainTable();
            Resources newresources = new Resources();
            Client    newclient    = new Client();
            Order     neworder     = new Order();


            newcompany.CompanyName = tbCompanyName.Text;

            newresources.PerformersDepartment    = tbPerformersDepartment.Text;
            newresources.PhoneNumberOfPerformers = tbPhoneNumberOfPerformers.Text;
            newresources.HoursToCompleteTheOrder = Convert.ToInt32(tbHoursToCompleteTheOrder.Text);
            newresources.ResponsibleForTheOrder  = tbResponsibleForTheOrder.Text;

            newclient.FullName        = tbFullName.Text;
            newclient.DeliveryAddress = tbDeliveryAddress.Text;
            newclient.Telephone       = tbTelephone.Text;
            newclient.FaxNumber       = tbFaxNumber.Text;

            neworder.Cost                    = Convert.ToInt32(tbCost.Text);
            neworder.Product                 = tbProduct.Text;
            neworder.Manufacturer            = tbManufacturer.Text;
            neworder.SerialNumber            = tbSerialNumber.Text;
            neworder.OrderCompletionDate     = (tbOrderCompletionDate.SelectedDate);
            neworder.DateOfReceiptOfTheOrder = (tbDateOfReceiptOfTheOrder.SelectedDate);


            newmaintable.IDClient    = newclient.ID;
            newmaintable.IDOrder     = neworder.ID;
            newmaintable.IDResources = newresources.ID;
            newclient.IDСompany      = newcompany.ID;



            dbcontext.db.MainTable.Add(newmaintable);
            dbcontext.db.Company.Add(newcompany);
            dbcontext.db.Resources.Add(newresources);
            dbcontext.db.Client.Add(newclient);
            dbcontext.db.Order.Add(neworder);

            dbcontext.db.SaveChanges();

            MessageBox.Show("Вы добавили данные", "Уведомление");
        }
Exemplo n.º 5
0
        public IActionResult EliminateRecord(MainTable passedMummy)
        {
            //Find the right record to delete
            IQueryable <MainTable> removingRecord = _mummyContext.MainTables.Where(p => p.PrimaryKeyId == passedMummy.PrimaryKeyId);

            //loop to remove the record in the database
            foreach (var x in removingRecord)
            {
                _mummyContext.MainTables.Remove(x);
            }

            //Submit changes for the database to process
            _mummyContext.SaveChanges();

            //Redirect to the confirmation page for the user to know that everything was successful
            return(View("Confirmation", passedMummy));
        }
Exemplo n.º 6
0
 private void DealNewRandomHands()
 {
     Services.GameServices.SelectedHand = null;
     Services.TableServices.RemoveAllHandsFromTable(TableVm.MainTable);
     Services.TableServices.ClearCommunityCards(TableVm.MainTable);
     Services.TableServices.PutHandsOnTable(TableVm.MainTable, new Random().Next(2, TableVm.MainTable.MaxHands + 1));
     TableVm.OnPropertyChanged(nameof(TableVm.MainTable));
     TableVm.RefreshHandViews();
     TableVm.CommunityVM.RefreshImageSources();
     MainTable.OnPropertyChanged(nameof(TableVm.MainTable.Hands));
     MainTable.State            = TableState.PreFlop;
     MainTable.HasSelectedHands = false;
     GetHandsInfo();
     GameInfoText = "Select your hand on table.";
     SetMainButton();
     Services.GameServices.Bet = Services.GameServices.StartingBet;
 }
Exemplo n.º 7
0
        /* the real thing -> return the table !!! */
        public override DataTable GetTable()
        {
            // reset table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "supplier id");                                    // 1
            AddColumn(MainTable, "store name");                                     // 2
            AddColumn(MainTable, "sku");                                            // 3
            AddColumn(MainTable, "quantity");                                       // 4
            AddColumn(MainTable, "out of stock quantity");                          // 5
            AddColumn(MainTable, "restock date");                                   // 6
            AddColumn(MainTable, "standard fulfillment latency");                   // 7
            AddColumn(MainTable, "priority fulfillment latency");                   // 8
            AddColumn(MainTable, "backorderable");                                  // 9
            AddColumn(MainTable, "return not desired");                             // 10
            AddColumn(MainTable, "inventory as of date");                           // 11
            AddColumn(MainTable, "external inventory id");                          // 12
            AddColumn(MainTable, "shipping comments");                              // 13

            // local field for inserting data to table
            DataTable table = Properties.Settings.Default.StockQuantityTable;

            // start loading data
            MainTable.BeginLoadData();

            // add data to each row
            foreach (string sku in SkuList)
            {
                DataRow row = MainTable.NewRow();

                row[0] = "ashlin_bpg";                               // brand
                row[1] = "nishis_boutique";                          // store name
                row[2] = sku;                                        // sku
                row[3] = table.Select("SKU='" + sku + '\'')[0][2];   // quantity
                row[8] = true;                                       // backorderable

                MainTable.Rows.Add(row);
                Progress++;
            }

            // finish loading data
            MainTable.EndLoadData();

            return(MainTable);
        }
Exemplo n.º 8
0
        public async Task <IActionResult> MummyRecordDetails(MainTable mainTable)
        {
            if (mainTable == null)
            {
                return(NotFound());
            }

            //Queried object that is equal to the selected record
            var mummy = await _mummyContext.MainTables
                        .FirstOrDefaultAsync(m => m.PrimaryKeyId == mainTable.PrimaryKeyId);

            if (mummy == null)
            {
                return(NotFound());
            }

            return(View(mummy));
        }
Exemplo n.º 9
0
        public static void UpdateItems(int i, MainTable mt)
        {
            var    job      = JobsModel.GetOneJobs(mt.JobId);
            string JobTitle = job.Count() > 0 ? job.First().Title : "";

            l.Items[i].SubItems[I_FNAME].Text           = T(mt.FName);
            l.Items[i].SubItems[I_MNAME].Text           = T(mt.MName);
            l.Items[i].SubItems[I_LNAME].Text           = T(mt.LName);
            l.Items[i].SubItems[I_JOB_ID].Text          = JobTitle;
            l.Items[i].SubItems[I_SEX].Text             = mt.Sex ? "Чоловік" : "Жінка";
            l.Items[i].SubItems[I_EMAIL].Text           = T(mt.Email);
            l.Items[i].SubItems[I_TEL_WORK].Text        = T(mt.TelWork);
            l.Items[i].SubItems[I_IS_ACTIVITY].Text     = T(mt.IsActivity);
            l.Items[i].SubItems[I_EMPLOYMENT_DATE].Text = T(mt.EmploymentDate);
            l.Items[i].SubItems[I_UPDATE_AT].Text       = T(mt.UpdateAt);

            ColorRows(i, mt);
        }
Exemplo n.º 10
0
        public void AddData(MainTable objectData)
        {
            if (objectData.Id == 0)
            {
                var obj = new MainTable();
                obj.HeaderColor = objectData.HeaderColor;
                obj.DataColor   = objectData.DataColor;
                obj.CellColor   = objectData.CellColor;
                obj.FooterColor = objectData.FooterColor;
                context.MainTable.Add(obj);
                context.SaveChanges();
                objectData.Id = obj.Id;
            }
            else
            {
                var CheckMainTableData = context.MainTable.Where(x => x.Id == objectData.Id).FirstOrDefault();
                CheckMainTableData.HeaderColor = objectData.HeaderColor;
                CheckMainTableData.DataColor   = objectData.DataColor;
                CheckMainTableData.CellColor   = objectData.CellColor;
                CheckMainTableData.FooterColor = objectData.FooterColor;
            }

            foreach (var item in objectData.ListOfCalculations)
            {
                if (item.Id != 0)
                {
                    var OldData = context.ListOfCalculations.Where(x => x.Id == item.Id).FirstOrDefault();
                    OldData.ListDate     = item.ListDate;
                    OldData.Organization = item.Organization;
                    OldData.TotalCost    = item.TotalCost;
                    OldData.BakrPortion  = item.BakrPortion;
                    OldData.YomePortion  = item.YomePortion;
                    OldData.BakrDebit    = item.BakrDebit;
                    OldData.YomeDebit    = item.YomeDebit;
                    OldData.BakrCredit   = item.BakrCredit;
                    OldData.YomeCredit   = item.YomeCredit;
                }
                if (item.Id == 0)
                {
                    item.MainTableId = objectData.Id;
                    context.ListOfCalculations.Add(item);
                }
            }
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckCreatorKey();

            if (!Page.IsPostBack)
            {
                //ScriptManager.RegisterStartupScript(this.Page, typeof(string), "Resize", "changeWidth.resizeWidth();", true);

                ASPxHiddenField entText = MainTable.FindHeaderTemplateControl(MainTable.Columns[0], "ASPxHiddenFieldEnt") as ASPxHiddenField;
                entText["hidden_value"] = Session["EntityCode"].ToString();
            }

            BindMRP(Convert.ToInt32(Session["viewAllMRP"]), Session["EntityCode"].ToString(), Session["BUCode"].ToString());

            if (!Page.IsAsync)
            {
                //ASPxHiddenFieldEnt
            }
        }
Exemplo n.º 12
0
        private void ButtonDelete_Click(object sender, RoutedEventArgs e)
        {
            MainTable deleterow = (MainTable)DataGridMain.SelectedItem;

            if (MessageBox.Show("Хотите удалить строку?", "Уведомление", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            {
                if (deleterow != null)
                {
                    dbcontext.db.MainTable.Remove(deleterow);
                    dbcontext.db.SaveChanges();
                    Page_Loaded(null, null);
                    MessageBox.Show("Вы удалили строку", "Уведомление");
                }
                else
                {
                    MessageBox.Show("Вы не выбрали строку", "Уведомление");
                }
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Starts a new group by creating a new table and initializing its properties.
        /// </summary>
        /// <param name="groupHeaderRowCellsData">New group's header row data</param>
        /// <param name="shouldCheckOneGroupPerPage">Do we need a new page again?</param>
        public void StartNewGroup(IEnumerable <CellData> groupHeaderRowCellsData, bool shouldCheckOneGroupPerPage)
        {
            MainTable.ElementComplete = true; //print the last footer
            var hasRows = MainTable.Rows.Any();

            if (hasRows)
            {
                if (SharedData.ShouldWrapTablesInColumns)
                {
                    MainGroupTable.AddCell(new PdfPCell(MainTable)
                    {
                        Border = 0
                    });
                }
                else
                {
                    MainTable.SpacingAfter += MainTable.HeaderHeight + 2.5f;
                    tryFitToContent();
                    SharedData.PdfDoc.Add(MainTable);
                    MainTable.DeleteBodyRows();
                }
            }

            if (SharedData.MainTableEvents != null && _groupNumber > 0)
            {
                SharedData.MainTableEvents.GroupAdded(new EventsArguments {
                    PdfDoc = SharedData.PdfDoc, PdfWriter = SharedData.PdfWriter, Table = MainGroupTable, ColumnCellsSummaryData = SharedData.ColumnCellsSummaryData, PreviousTableRowData = CurrentRowInfoData.PreviousTableRowData, PageSetup = SharedData.PageSetup, PdfFont = SharedData.PdfFont, PdfColumnsAttributes = SharedData.PdfColumnsAttributes
                });
            }

            _groupNumber++;
            if (shouldCheckOneGroupPerPage)
            {
                showOneGroupPerPage();
            }
            renderGroupHeader(groupHeaderRowCellsData);
            initMainTable();
            RowsManager.TableInitAddHeaderAndFooter();
            reset();
        }
Exemplo n.º 14
0
        public AddJob(IRobotWare root) :
            this()
        {
            mRoot = root;
            if (!mRoot.IsLicensed)
            {
                Utils.DoRequestLicense(mRoot.ApplicationName, mRoot.Version, Resources.robot_32x32, () => mRoot.IsLicensed);
            }

            // have to explicitly remove specification list otherwise we get a ghost version
            MainTable.Controls.Remove(mSpecs);

            // recreate specification list from the correct root aka location
            mSpecs = new SpecificationCtl(mRoot)
            {
                Dock = DockStyle.Fill
            };
            MainTable.Controls.Add(mSpecs, 0, 0);
            MainTable.SetColumnSpan(mSpecs, 3);
            mSpecs.SpecificationDoubleClick     += Specs_SpecificationDoubleClick;
            mSpecs.SelectedSpecificationChanged += Specs_SelectedSpecificationChanged;
        }
Exemplo n.º 15
0
        public IActionResult AddMummyRecord(MainTable newRecord)
        {
            //Logic to ensure that the submitted record is assigned the largest primarykeyId
            var wumbo = _mummyContext.MainTables.OrderByDescending(x => x.PrimaryKeyId).FirstOrDefault();

            newRecord.PrimaryKeyId = wumbo.PrimaryKeyId + 1;

            //Submit the info for the database to store
            if (ModelState.IsValid == true)
            {
                //Communicates with the sqlite database through the private context object to modify data in the database
                _mummyContext.MainTables.Add(newRecord);
                _mummyContext.SaveChanges();

                return(View("Confirmation", newRecord));
            }

            //If there are missing fields or incorrect fields then reload the page with errors for the user to see
            else
            {
                //Reload the page in a way that allows mistyped info to be called-out
                return(View());
            }
        }
        private void ImportPGButton_Click(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog
            {
                Filter           = "txt files (*.txt)|*.txt",
                FilterIndex      = 2,
                RestoreDirectory = true
            };

            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            _tasks.Clear();
            _agents.Clear();

            var allPg = File.ReadAllLines(openFileDialog.FileName);

            foreach (var splitted in allPg.Select(pg => pg.Split('|')))
            {
                if (splitted.Length != 2)
                {
                    SetStatus("Bad format of file " + openFileDialog.FileName);
                    break;
                }
                AddJob(splitted[1].Trim(), splitted[0].Trim());
            }

            if (MainTable.Rows.Count > 0)
            {
                MainTable.AutoResizeRowHeadersWidth(0, DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
            }

            RebuildGrid();
        }
Exemplo n.º 17
0
        /* the real thing -> return the table !!! */
        public override DataTable GetTable()
        {
            // reset the table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "SKU Ashlin");                             // 1
            AddColumn(MainTable, "Design Service Code");                    // 2
            AddColumn(MainTable, "Design Service Fashion Name Ashlin");     // 3
            AddColumn(MainTable, "Design_Short Description");               // 4
            AddColumn(MainTable, "Design Extended Description");            // 5
            AddColumn(MainTable, "Material Code");                          // 6
            AddColumn(MainTable, "Colour Code");                            // 7
            AddColumn(MainTable, "Material Description Extended");          // 8
            AddColumn(MainTable, "Colour Description Extended");            // 9
            AddColumn(MainTable, "Design Service Family Description");      // 10
            AddColumn(MainTable, "Option 1");                               // 11
            AddColumn(MainTable, "Option 2");                               // 12
            AddColumn(MainTable, "Option 3");                               // 13
            AddColumn(MainTable, "Option 4");                               // 14
            AddColumn(MainTable, "Option 5");                               // 15
            AddColumn(MainTable, "Strap");                                  // 16
            AddColumn(MainTable, "Detachable Strap");                       // 17
            AddColumn(MainTable, "Zippered Enclosure");                     // 18
            AddColumn(MainTable, "Shippable Weight grams");                 // 19
            AddColumn(MainTable, "Shippable Weight lb");                    // 20
            AddColumn(MainTable, "Imprintable");                            // 21
            AddColumn(MainTable, "Imprint Area cm");                        // 22
            AddColumn(MainTable, "Imprint Area in");                        // 23
            AddColumn(MainTable, "Finished Dimensions (cm)");               // 24
            AddColumn(MainTable, "Finished Dimensions (in)");               // 25
            AddColumn(MainTable, "Price 1 C Blank");                        // 26
            AddColumn(MainTable, "Price 6 C Blank");                        // 27
            AddColumn(MainTable, "Price 24 C Blank");                       // 28
            AddColumn(MainTable, "Price 50 C Blank");                       // 29
            AddColumn(MainTable, "Price 100 C Blank");                      // 30
            AddColumn(MainTable, "Price 250 C Blank");                      // 31
            AddColumn(MainTable, "Price 500 C Blank");                      // 32
            AddColumn(MainTable, "Price 1000 C Blank");                     // 33
            AddColumn(MainTable, "Price 2500 C Blank");                     // 34
            AddColumn(MainTable, "Price RUSH 1 C Blank");                   // 35
            AddColumn(MainTable, "Price RUSH 6 C Blank");                   // 36
            AddColumn(MainTable, "Price RUSH 24 C Blank");                  // 37
            AddColumn(MainTable, "Price RUSH 50 C Blank");                  // 38
            AddColumn(MainTable, "Price RUSH 100 C Blank");                 // 39
            AddColumn(MainTable, "Price RUSH 250 C Blank");                 // 40
            AddColumn(MainTable, "Price RUSH 500 C Blank");                 // 41
            AddColumn(MainTable, "Price RUSH 1000 C Blank");                // 42
            AddColumn(MainTable, "Price RUSH 2500 C Blank");                // 43
            AddColumn(MainTable, "Price 1 Net Blank");                      // 44
            AddColumn(MainTable, "Price 6 Net Blank");                      // 45
            AddColumn(MainTable, "Price 24 Net Blank");                     // 46
            AddColumn(MainTable, "Price 50 Net Blank");                     // 47
            AddColumn(MainTable, "Price 100 Net Blank");                    // 48
            AddColumn(MainTable, "Price 250 Net Blank");                    // 49
            AddColumn(MainTable, "Price 500 Net Blank");                    // 50
            AddColumn(MainTable, "Price 1000 Net Blank");                   // 51
            AddColumn(MainTable, "Price 2500 Net Blank");                   // 52
            AddColumn(MainTable, "Price RUSH 1 Net Blank");                 // 53
            AddColumn(MainTable, "Price RUSH 6 Net Blank");                 // 54
            AddColumn(MainTable, "Price RUSH 24 Net Blank");                // 55
            AddColumn(MainTable, "Price RUSH 50 Net Blank");                // 56
            AddColumn(MainTable, "Price RUSH 100 Net Blank");               // 57
            AddColumn(MainTable, "Price RUSH 250 Net Blank");               // 58
            AddColumn(MainTable, "Price RUSH 500 Net Blank");               // 59
            AddColumn(MainTable, "Price RUSH 1000 Net Blank");              // 60
            AddColumn(MainTable, "Price RUSH 2500 Net Blank");              // 61
            AddColumn(MainTable, "Price 1 C Imprinted");                    // 62
            AddColumn(MainTable, "Price 6 C Imprinted");                    // 63
            AddColumn(MainTable, "Price 24 C Imprinted");                   // 64
            AddColumn(MainTable, "Price 50 C Imprinted");                   // 65
            AddColumn(MainTable, "Price 100 C Imprinted");                  // 66
            AddColumn(MainTable, "Price 250 C Imprinted");                  // 67
            AddColumn(MainTable, "Price 500 C Imprinted");                  // 68
            AddColumn(MainTable, "Price 1000 C Imprinted");                 // 69
            AddColumn(MainTable, "Price 2500 C Imprinted");                 // 70
            AddColumn(MainTable, "Price Rush 1 C Imprinted");               // 71
            AddColumn(MainTable, "Price Rush 6 C Imprinted");               // 72
            AddColumn(MainTable, "Price Rush 24 C Imprinted");              // 73
            AddColumn(MainTable, "Price Rush 50 C Imprinted");              // 74
            AddColumn(MainTable, "Price Rush 100 C Imprinted");             // 75
            AddColumn(MainTable, "Price Rush 250 C Imprinted");             // 76
            AddColumn(MainTable, "Price Rush 500 C Imprinted");             // 77
            AddColumn(MainTable, "Price Rush 1000 C Imprinted");            // 78
            AddColumn(MainTable, "Price Rush 2500 C Imprinted");            // 79
            AddColumn(MainTable, "Price 1 Net Imprinted");                  // 80
            AddColumn(MainTable, "Price 6 Net Imprinted");                  // 81
            AddColumn(MainTable, "Price 24 Net Imprinted");                 // 82
            AddColumn(MainTable, "Price 50 Net Imprinted");                 // 83
            AddColumn(MainTable, "Price 100 Net Imprinted");                // 84
            AddColumn(MainTable, "Price 250 Net Imprinted");                // 85
            AddColumn(MainTable, "Price 500 Net Imprinted");                // 86
            AddColumn(MainTable, "Price 1000 Net Imprinted");               // 87
            AddColumn(MainTable, "Price 2500 Net Imprinted");               // 88
            AddColumn(MainTable, "Price RUSH 1 Net Imprinted");             // 89
            AddColumn(MainTable, "Price RUSH 6 Net Imprinted");             // 90
            AddColumn(MainTable, "Price RUSH 24 Net Imprinted");            // 91
            AddColumn(MainTable, "Price RUSH 50 Net Imprinted");            // 92
            AddColumn(MainTable, "Price RUSH 100 Net Imprinted");           // 93
            AddColumn(MainTable, "Price RUSH 250 Net Imprinted");           // 94
            AddColumn(MainTable, "Price RUSH 500 Net Imprinted");           // 95
            AddColumn(MainTable, "Price RUSH 1000 Net Imprinted");          // 96
            AddColumn(MainTable, "Price RUSH 2500 Net Imprinted");          // 97
            AddColumn(MainTable, "Image 1 Path");                           // 98
            AddColumn(MainTable, "Image 2 Path");                           // 99
            AddColumn(MainTable, "Image 3 Path");                           // 100
            AddColumn(MainTable, "Image 4 Path");                           // 101
            AddColumn(MainTable, "Image 5 Path");                           // 102
            AddColumn(MainTable, "Image 6 Path");                           // 103
            AddColumn(MainTable, "Image 7 Path");                           // 104
            AddColumn(MainTable, "Image 8 Path");                           // 105
            AddColumn(MainTable, "Image 9 Path");                           // 106
            AddColumn(MainTable, "Image 10 Path");                          // 107
            AddColumn(MainTable, "Image Group 1 Path");                     // 108
            AddColumn(MainTable, "Image Group 2 Path");                     // 109
            AddColumn(MainTable, "Image Group 3 Path");                     // 110
            AddColumn(MainTable, "Image Group 4 Path");                     // 111
            AddColumn(MainTable, "Image Group 5 Path");                     // 112
            AddColumn(MainTable, "Image Model 1 Path");                     // 113
            AddColumn(MainTable, "Image Model 2 Path");                     // 114
            AddColumn(MainTable, "Image Model 3 Path");                     // 115
            AddColumn(MainTable, "Image Model 4 Path");                     // 116
            AddColumn(MainTable, "Image Model 5 Path");                     // 117
            AddColumn(MainTable, "Swatch Path");                            // 118
            AddColumn(MainTable, "Wholesale");                              // 119
            AddColumn(MainTable, "Keywords");                               // 120

            // local field for price calculation
            double[][] discountList = GetDiscount();

            // start loading data
            MainTable.BeginLoadData();
            Connection.Open();

            // add data to each row
            foreach (string sku in SkuList)
            {
                ArrayList list = GetData(sku);
                DataRow   row  = MainTable.NewRow();

                row[0]  = sku;                                                // sku ashlin
                row[1]  = list[0];                                            // design service code
                row[2]  = list[3];                                            // design service fashion name ashlin
                row[3]  = list[4];                                            // design short description
                row[4]  = list[5];                                            // design extended description
                row[5]  = list[1];                                            // material code
                row[6]  = list[2];                                            // colour code
                row[7]  = list[44];                                           // material description extended
                row[8]  = list[45];                                           // colour description extended
                row[9]  = list[46];                                           // design service family description
                row[10] = list[6];                                            // option 1
                row[11] = list[7];                                            // option 2
                row[12] = list[8];                                            // option 3
                row[13] = list[9];                                            // option 4
                row[14] = list[10];                                           // option 5
                row[15] = list[11];                                           // strap
                row[16] = list[12];                                           // detachable strap
                row[17] = list[13];                                           // zippered enclosure
                row[18] = list[14];                                           // shippable weight grams
                if (!list[14].Equals(DBNull.Value))
                {
                    row[19] = Convert.ToDouble(list[14]) / 453.592;           // shippable weight lb
                }
                row[20] = list[15];                                           // imprintable
                row[21] = list[16] + " cm x " + list[17] + " cm";             // imprint area cm
                if (!list[16].Equals(DBNull.Value))
                {
                    row[22] = Math.Round(Convert.ToDouble(list[16]) / 2.54, 2) + " in x " + Math.Round(Convert.ToDouble(list[16]) / 2.54, 2) + " in";                                                                  // imprint area in
                }
                row[23] = list[18] + " cm x " + list[19] + " cm x " + list[19] + " cm";                                                                                                                                // finished dimensions (cm)
                if (!list[18].Equals(DBNull.Value))
                {
                    row[24] = Math.Round(Convert.ToDouble(list[18]) / 2.54, 2) + " in x " + Math.Round(Convert.ToDouble(list[19]) / 2.54, 2) + " in x " + Math.Round(Convert.ToDouble(list[19]) / 2.54, 2) + " in";    // finished dimensions (in)
                }
                double msrp      = Convert.ToDouble(list[22]) * discountList[7][0];
                double runCharge = list[21].Equals(DBNull.Value) ? Math.Round(msrp * 0.05) / 0.6 : Math.Round(msrp * 0.05) / 0.6 + Convert.ToInt32(list[21]) - 1;
                if (runCharge > 8)
                {
                    runCharge = 8;
                }
                else if (runCharge < 1)
                {
                    runCharge = 1;
                }
                int k;
                switch (Convert.ToInt32(list[43]))
                {
                case 1:
                    k = 1;
                    break;

                case 2:
                    k = 2;
                    break;

                case 3:
                    k = 3;
                    break;

                case 4:
                    k = 4;
                    break;

                case 5:
                    k = 5;
                    break;

                case 6:
                    k = 6;
                    break;

                default:
                    k = 0;
                    break;
                }
                row[25]  = Math.Round(msrp * discountList[k][1], 2);                        // price 1 c
                row[26]  = Math.Round(msrp * discountList[k][2], 2);                        // price 6 c
                row[27]  = Math.Round(msrp * discountList[k][3], 2);                        // price 24 c
                row[28]  = Math.Round(msrp * discountList[k][4], 2);                        // price 50 c
                row[29]  = Math.Round(msrp * discountList[k][5], 2);                        // price 100 c
                row[30]  = Math.Round(msrp * discountList[k][6], 2);                        // price 250 c
                row[31]  = Math.Round(msrp * discountList[k][7], 2);                        // price 500 c
                row[32]  = Math.Round(msrp * discountList[k][8], 2);                        // price 1000 c
                row[33]  = Math.Round(msrp * discountList[k][9], 2);                        // price 2500 c
                row[34]  = Math.Round(msrp * discountList[k][0] * discountList[k][1], 2);   // price rush 1 c
                row[35]  = Math.Round(msrp * discountList[k][0] * discountList[k][2], 2);   // price rush 6 c
                row[36]  = Math.Round(msrp * discountList[k][0] * discountList[k][3], 2);   // price rush 24 c
                row[37]  = Math.Round(msrp * discountList[k][0] * discountList[k][4], 2);   // price rush 50 c
                row[38]  = Math.Round(msrp * discountList[k][0] * discountList[k][5], 2);   // price rush 100 c
                row[39]  = Math.Round(msrp * discountList[k][0] * discountList[k][6], 2);   // price rush 250 c
                row[40]  = Math.Round(msrp * discountList[k][0] * discountList[k][7], 2);   // price rush 500 c
                row[41]  = Math.Round(msrp * discountList[k][0] * discountList[k][8], 2);   // price rush 1000 c
                row[42]  = Math.Round(msrp * discountList[k][0] * discountList[k][9], 2);   // price rush 2500 c
                row[43]  = Math.Round(msrp * discountList[k][11], 2);                       // price 1 net
                row[44]  = Math.Round(msrp * discountList[k][12], 2);                       // price 6 net
                row[45]  = Math.Round(msrp * discountList[k][13], 2);                       // price 24 net
                row[46]  = Math.Round(msrp * discountList[k][14], 2);                       // price 50 net
                row[47]  = Math.Round(msrp * discountList[k][15], 2);                       // price 100 net
                row[48]  = Math.Round(msrp * discountList[k][16], 2);                       // price 250 net
                row[49]  = Math.Round(msrp * discountList[k][17], 2);                       // price 500 net
                row[50]  = Math.Round(msrp * discountList[k][18], 2);                       // price 1000 net
                row[51]  = Math.Round(msrp * discountList[k][19], 2);                       // price 2500 net
                row[52]  = Math.Round(msrp * discountList[k][10] * discountList[k][11], 2); // price rush 1 net
                row[53]  = Math.Round(msrp * discountList[k][10] * discountList[k][12], 2); // price rush 6 net
                row[54]  = Math.Round(msrp * discountList[k][10] * discountList[k][13], 2); // price rush 24 net
                row[55]  = Math.Round(msrp * discountList[k][10] * discountList[k][14], 2); // price rush 50 net
                row[56]  = Math.Round(msrp * discountList[k][10] * discountList[k][15], 2); // price rush 100 net
                row[57]  = Math.Round(msrp * discountList[k][10] * discountList[k][16], 2); // price rush 250 net
                row[58]  = Math.Round(msrp * discountList[k][10] * discountList[k][17], 2); // price rush 500 net
                row[59]  = Math.Round(msrp * discountList[k][10] * discountList[k][18], 2); // price rush 1000 net
                row[60]  = Math.Round(msrp * discountList[k][10] * discountList[k][19], 2); // price rush 2500 net
                msrp    += runCharge;
                row[61]  = Math.Round(msrp * discountList[k][1], 2);                        // price 1 c imprinted
                row[62]  = Math.Round(msrp * discountList[k][2], 2);                        // price 6 c imprinted
                row[63]  = Math.Round(msrp * discountList[k][3], 2);                        // price 24 c imprinted
                row[64]  = Math.Round(msrp * discountList[k][4], 2);                        // price 50 c imprinted
                row[65]  = Math.Round(msrp * discountList[k][5], 2);                        // price 100 c imprinted
                row[66]  = Math.Round(msrp * discountList[k][6], 2);                        // price 250 c imprinted
                row[67]  = Math.Round(msrp * discountList[k][7], 2);                        // price 500 c imprinted
                row[68]  = Math.Round(msrp * discountList[k][8], 2);                        // price 1000 c imprinted
                row[69]  = Math.Round(msrp * discountList[k][9], 2);                        // price 2500 c imprinted
                row[70]  = Math.Round(msrp * discountList[k][0] * discountList[k][1], 2);   // price rush 1 c imprinted
                row[71]  = Math.Round(msrp * discountList[k][0] * discountList[k][2], 2);   // price rush 6 c imprinted
                row[72]  = Math.Round(msrp * discountList[k][0] * discountList[k][3], 2);   // price rush 24 c imprinted
                row[73]  = Math.Round(msrp * discountList[k][0] * discountList[k][4], 2);   // price rush 50 c imprinted
                row[74]  = Math.Round(msrp * discountList[k][0] * discountList[k][5], 2);   // price rush 100 c imprinted
                row[75]  = Math.Round(msrp * discountList[k][0] * discountList[k][6], 2);   // price rush 250 c imprinted
                row[76]  = Math.Round(msrp * discountList[k][0] * discountList[k][7], 2);   // price rush 500 c imprinted
                row[77]  = Math.Round(msrp * discountList[k][0] * discountList[k][8], 2);   // price rush 1000 c imprinted
                row[78]  = Math.Round(msrp * discountList[k][0] * discountList[k][9], 2);   // price rush 2500 c imprinted
                row[79]  = Math.Round(msrp * discountList[k][11], 2);                       // price 1 net imprinted
                row[80]  = Math.Round(msrp * discountList[k][12], 2);                       // price 6 net imprinted
                row[81]  = Math.Round(msrp * discountList[k][13], 2);                       // price 24 net imprinted
                row[82]  = Math.Round(msrp * discountList[k][14], 2);                       // price 50 net imprinted
                row[83]  = Math.Round(msrp * discountList[k][15], 2);                       // price 100 net imprinted
                row[84]  = Math.Round(msrp * discountList[k][16], 2);                       // price 250 net imprinted
                row[85]  = Math.Round(msrp * discountList[k][17], 2);                       // price 500 net imprinted
                row[86]  = Math.Round(msrp * discountList[k][18], 2);                       // price 1000 net imprinted
                row[87]  = Math.Round(msrp * discountList[k][19], 2);                       // price 2500 net imprinted
                row[88]  = Math.Round(msrp * discountList[k][10] * discountList[k][11], 2); // price rush 1 net imprinted
                row[89]  = Math.Round(msrp * discountList[k][10] * discountList[k][12], 2); // price rush 6 net imprinted
                row[90]  = Math.Round(msrp * discountList[k][10] * discountList[k][13], 2); // price rush 24 net imprinted
                row[91]  = Math.Round(msrp * discountList[k][10] * discountList[k][14], 2); // price rush 50 net imprinted
                row[92]  = Math.Round(msrp * discountList[k][10] * discountList[k][15], 2); // price rush 100 net imprinted
                row[93]  = Math.Round(msrp * discountList[k][10] * discountList[k][16], 2); // price rush 250 net imprinted
                row[94]  = Math.Round(msrp * discountList[k][10] * discountList[k][17], 2); // price rush 500 net imprinted
                row[95]  = Math.Round(msrp * discountList[k][10] * discountList[k][18], 2); // price rush 1000 net imprinted
                row[96]  = Math.Round(msrp * discountList[k][10] * discountList[k][19], 2); // price rush 2500 net imprinted
                row[97]  = list[23];                                                        // image 1 path
                row[98]  = list[24];                                                        // image 2 path
                row[99]  = list[25];                                                        // image 3 path
                row[100] = list[26];                                                        // image 4 path
                row[101] = list[27];                                                        // image 5 path
                row[102] = list[28];                                                        // image 6 path
                row[103] = list[29];                                                        // image 7 path
                row[104] = list[30];                                                        // image 8 path
                row[105] = list[31];                                                        // image 9 path
                row[106] = list[32];                                                        // image 10 path
                row[107] = list[33];                                                        // image group 1 path
                row[108] = list[34];                                                        // image group 2 path
                row[109] = list[35];                                                        // image group 3 path
                row[110] = list[36];                                                        // image group 4 path
                row[111] = list[37];                                                        // image group 5 path
                row[112] = list[38];                                                        // image model 1 path
                row[113] = list[39];                                                        // image model 2 path
                row[114] = list[40];                                                        // image model 3 path
                row[115] = list[41];                                                        // image model 4 path
                row[116] = list[42];                                                        // image model 5 path
                row[117] = GetSwatch(sku);                                                  // swatch material colour path
                row[118] = (msrp - runCharge) * discountList[k][20];                        // whole sale
                row[119] = list[47];                                                        // keywords

                MainTable.Rows.Add(row);
                Progress++;
            }

            // finish loading data
            MainTable.EndLoadData();
            Connection.Close();

            return(MainTable);
        }
Exemplo n.º 18
0
        /* the real thing -> return the table !!! */
        public override DataTable GetTable()
        {
            // reset table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "item_name");                                      // 1
            AddColumn(MainTable, "feed_product_type");                              // 2
            AddColumn(MainTable, "brand_name");                                     // 3
            AddColumn(MainTable, "manufacturer");                                   // 4
            AddColumn(MainTable, "external_product_id");                            // 5
            AddColumn(MainTable, "external_product_id_type");                       // 6
            AddColumn(MainTable, "item_sku");                                       // 7
            AddColumn(MainTable, "part_number");                                    // 8
            AddColumn(MainTable, "product description");                            // 9
            AddColumn(MainTable, "update_delete");                                  // 10
            AddColumn(MainTable, "standard_price");                                 // 11
            AddColumn(MainTable, "currency");                                       // 12
            AddColumn(MainTable, "condition_type");                                 // 13
            AddColumn(MainTable, "condition_note");                                 // 14
            AddColumn(MainTable, "is_discountinued_by_manufacturer");               // 15
            AddColumn(MainTable, "restock_date");                                   // 16
            AddColumn(MainTable, "quantity");                                       // 17
            AddColumn(MainTable, "max_aggregate_ship_quantity");                    // 18
            AddColumn(MainTable, "item_package_quantity");                          // 19
            AddColumn(MainTable, "number_of_items");                                // 20
            AddColumn(MainTable, "missing_keyset_reason");                          // 21
            AddColumn(MainTable, "product_site_launch_date");                       // 22
            AddColumn(MainTable, "product_tax_code");                               // 23
            AddColumn(MainTable, "merchant_release_date");                          // 24
            AddColumn(MainTable, "sale_price");                                     // 25
            AddColumn(MainTable, "sale_end_date");                                  // 26
            AddColumn(MainTable, "sale_from_date");                                 // 27
            AddColumn(MainTable, "fulfillment_latency");                            // 28
            AddColumn(MainTable, "offering_can_be_gift_mes");                       // 29
            AddColumn(MainTable, "offering_can_be_giftwrapped");                    // 30
            AddColumn(MainTable, "item_height");                                    // 31
            AddColumn(MainTable, "item_length");                                    // 32
            AddColumn(MainTable, "item_width");                                     // 33
            AddColumn(MainTable, "item_dimensions_unit_of_measure");                // 34
            AddColumn(MainTable, "item_weight");                                    // 35
            AddColumn(MainTable, "item_weight_unit_of_measure");                    // 36
            AddColumn(MainTable, "website_shipping_weight");                        // 37
            AddColumn(MainTable, "website_shipping_weight_unit_of_measure");        // 38
            AddColumn(MainTable, "volumn_capacity_name");                           // 39
            AddColumn(MainTable, "volumn_capacity_name_unit_of_measure");           // 40
            AddColumn(MainTable, "KeyWords_Amazon_1");                              // 41
            AddColumn(MainTable, "KeyWrods_Amazon_2");                              // 42
            AddColumn(MainTable, "KeyWrods_Amazon_3");                              // 43
            AddColumn(MainTable, "KeyWrods_Amazon_4");                              // 44
            AddColumn(MainTable, "KeyWrods_Amazon_5");                              // 45
            AddColumn(MainTable, "target_audience_base1");                          // 46
            AddColumn(MainTable, "target_audience_base2");                          // 47
            AddColumn(MainTable, "target_audience_base3");                          // 48
            AddColumn(MainTable, "target_audience_base4");                          // 49
            AddColumn(MainTable, "target_audience_base5");                          // 50
            AddColumn(MainTable, "platinum_keywords");                              // 51
            AddColumn(MainTable, "recommended_browse_nodes1");                      // 52
            AddColumn(MainTable, "recommended_browse_nodes2");                      // 53
            AddColumn(MainTable, "bullet_point_1");                                 // 54
            AddColumn(MainTable, "bullet_point_2");                                 // 55
            AddColumn(MainTable, "bullet_point_3");                                 // 56
            AddColumn(MainTable, "bullet_point_4");                                 // 57
            AddColumn(MainTable, "bullet_point_5");                                 // 58
            AddColumn(MainTable, "catalog_number");                                 // 59
            AddColumn(MainTable, "main_image_url");                                 // 60
            AddColumn(MainTable, "swatch_image_url");                               // 61
            AddColumn(MainTable, "other_iamge_url1");                               // 62
            AddColumn(MainTable, "other_image_url2");                               // 63
            AddColumn(MainTable, "other_image_url3");                               // 64
            AddColumn(MainTable, "other_image_url4");                               // 65
            AddColumn(MainTable, "other_image_url5");                               // 66
            AddColumn(MainTable, "other_image_url6");                               // 67
            AddColumn(MainTable, "other_image_url7");                               // 68
            AddColumn(MainTable, "other_image_url8");                               // 69
            AddColumn(MainTable, "fulfillment_center_id");                          // 70
            AddColumn(MainTable, "package_height");                                 // 71
            AddColumn(MainTable, "package_height_unit_of_measure");                 // 72
            AddColumn(MainTable, "package_length");                                 // 73
            AddColumn(MainTable, "package_length_unit_of_measure");                 // 74
            AddColumn(MainTable, "package_width");                                  // 75
            AddColumn(MainTable, "package_width_unit_of_measure");                  // 76
            AddColumn(MainTable, "package_weight");                                 // 77
            AddColumn(MainTable, "package_weight_unit_of_measure");                 // 78
            AddColumn(MainTable, "relation_type");                                  // 79
            AddColumn(MainTable, "variation_theme");                                // 80
            AddColumn(MainTable, "parent_sku");                                     // 81
            AddColumn(MainTable, "parent_child");                                   // 82
            AddColumn(MainTable, "safty_warning");                                  // 83
            AddColumn(MainTable, "country_of_origin");                              // 84
            AddColumn(MainTable, "legal_disclaimer-description");                   // 85
            AddColumn(MainTable, "size_name");                                      // 86
            AddColumn(MainTable, "color_name1");                                    // 87
            AddColumn(MainTable, "color_name2");                                    // 88
            AddColumn(MainTable, "color_map");                                      // 89
            AddColumn(MainTable, "team_name");                                      // 90
            AddColumn(MainTable, "outer_material_type");                            // 91
            AddColumn(MainTable, "wheel_type");                                     // 92
            AddColumn(MainTable, "number_of_wheels");                               // 93
            AddColumn(MainTable, "material_type");                                  // 94
            AddColumn(MainTable, "leather_type");                                   // 95
            AddColumn(MainTable, "fabric_type");                                    // 96
            AddColumn(MainTable, "inner_material_type");                            // 97
            AddColumn(MainTable, "lining_description");                             // 98
            AddColumn(MainTable, "model_year");                                     // 99
            AddColumn(MainTable, "configuration");                                  // 100
            AddColumn(MainTable, "department_name");                                // 101
            AddColumn(MainTable, "shell_type");                                     // 102
            AddColumn(MainTable, "is_stain_resistant");                             // 103
            AddColumn(MainTable, "specification_met1");                             // 104
            AddColumn(MainTable, "specification_met2");                             // 105
            AddColumn(MainTable, "specification_met3");                             // 106
            AddColumn(MainTable, "specification_met4");                             // 107
            AddColumn(MainTable, "specification_met5");                             // 108
            AddColumn(MainTable, "pattern_name");                                   // 109
            AddColumn(MainTable, "strap_type");                                     // 110
            AddColumn(MainTable, "shoulder_strap_drop");                            // 111
            AddColumn(MainTable, "shoulder_strap_droup_unit_of_measure");           // 112
            AddColumn(MainTable, "closure_type");                                   // 113
            AddColumn(MainTable, "external_testing_certification1");                // 114
            AddColumn(MainTable, "external_testgin_certification2");                // 115
            AddColumn(MainTable, "special_features1");                              // 116
            AddColumn(MainTable, "special_features2");                              // 117
            AddColumn(MainTable, "special_features3");                              // 118
            AddColumn(MainTable, "special_features4");                              // 119
            AddColumn(MainTable, "special_features5");                              // 120
            AddColumn(MainTable, "style_name1");                                    // 121
            AddColumn(MainTable, "style_name2");                                    // 122
            AddColumn(MainTable, "style_name3");                                    // 123
            AddColumn(MainTable, "style_name4");                                    // 124
            AddColumn(MainTable, "style_name5");                                    // 125
            AddColumn(MainTable, "seasons");                                        // 126
            AddColumn(MainTable, "lifestyle");                                      // 127
            AddColumn(MainTable, "collection_name");                                // 128
            AddColumn(MainTable, "are_batteries_included");                         // 129
            AddColumn(MainTable, "battery_description");                            // 130
            AddColumn(MainTable, "number_of_batteries");                            // 131
            AddColumn(MainTable, "batery_cell_composition");                        // 132
            AddColumn(MainTable, "lithium_battery_weight_unit_of_measure");         // 133
            AddColumn(MainTable, "lithium_battery_weight");                         // 134
            AddColumn(MainTable, "battery_form_factor");                            // 135
            AddColumn(MainTable, "battery_type");                                   // 136

            // local field for inserting data to table
            double[] price = GetPriceList();

            // start loading data
            MainTable.BeginLoadData();
            Connection.Open();

            // add data to each row
            foreach (string sku in SkuList)
            {
                ArrayList list = GetData(sku);
                DataRow   row  = MainTable.NewRow();

                row[0]   = list[0] + " " + list[37] + ' ' + list[36] + " [" + sku + ']';                                           // item name
                row[2]   = "Ashlin®";                                                                                              // brand name
                row[3]   = "Ashlin®";                                                                                              // manufacturer
                row[4]   = list[24];                                                                                               // external product_id
                row[5]   = "UPC";                                                                                                  // external product id type
                row[6]   = sku;                                                                                                    // item sku
                row[7]   = "Ashlin®";                                                                                              // part number
                row[8]   = list[1];                                                                                                // product description
                row[9]   = "PartiaUpdate";                                                                                         // update delete
                row[10]  = Math.Ceiling(Convert.ToDouble(list[25]) * price[0] * (1 - price[1] / 100) + price[3]) - (1 - price[2]); // standard price
                row[11]  = "CAD";                                                                                                  // currency
                row[12]  = "NEW";                                                                                                  // condition type
                row[13]  = "Brand New";                                                                                            // condition note
                row[16]  = MinorTable.Select("SKU='" + sku + "'")[0][2];                                                           // quantity
                row[17]  = 1;                                                                                                      // max aggregate ship quantity
                row[18]  = 1;                                                                                                      // item package quantity
                row[19]  = 1;                                                                                                      // number_of_items
                row[22]  = "A_GEN_NOTAX";                                                                                          // product tax code
                row[28]  = true;                                                                                                   // offering can be gift messaged
                row[29]  = true;                                                                                                   // offering can be giftwrapped
                row[30]  = list[2];                                                                                                // item height
                row[31]  = list[3];                                                                                                // item length
                row[32]  = list[4];                                                                                                // item width
                row[33]  = "CM";                                                                                                   // item dimention unit of measure
                row[34]  = list[5];                                                                                                // item weight
                row[35]  = "GR";                                                                                                   // item weight unit of measure
                row[36]  = list[6];                                                                                                // website shipping weight
                row[37]  = "GR";                                                                                                   // service outside mnf warranty
                row[40]  = list[17];                                                                                               // keyword amazon 1
                row[41]  = list[18];                                                                                               // keyword amazon 2
                row[42]  = list[19];                                                                                               // keyword amazon 3
                row[43]  = list[20];                                                                                               // keyword amazon 4
                row[44]  = list[21];                                                                                               // keyword amazon 5
                row[45]  = "man";                                                                                                  // target audience base 1
                row[46]  = "wonmen";                                                                                               // target audience base 2
                row[47]  = "boys";                                                                                                 // target audience base 3
                row[48]  = "girls";                                                                                                // target audience base 4
                row[49]  = "unisex";                                                                                               // target audience base 5
                row[51]  = list[22];                                                                                               // recommended browse nodes 1
                row[52]  = list[23];                                                                                               // recommended browse nodes 2
                row[53]  = list[7];                                                                                                // bullet point 1
                row[54]  = list[8];                                                                                                // bullet point 2
                row[55]  = list[9];                                                                                                // bullet point 3
                row[56]  = list[10];                                                                                               // bullet point 4
                row[57]  = list[11];                                                                                               // bullet point 5
                row[59]  = list[26];                                                                                               // main image url
                row[60]  = GetSwatch(sku);                                                                                         // swatch image url
                row[61]  = list[27];                                                                                               // other image url 1
                row[62]  = list[28];                                                                                               // other image url 2
                row[63]  = list[29];                                                                                               // other image url 3
                row[64]  = list[30];                                                                                               // other image url 4
                row[65]  = list[31];                                                                                               // other image url 5
                row[66]  = list[32];                                                                                               // other image url 6
                row[67]  = list[33];                                                                                               // other image url 7
                row[68]  = list[34];                                                                                               // other image url 8
                row[70]  = list[12];                                                                                               // package height
                row[71]  = "CM";                                                                                                   // package height unit of measure
                row[72]  = list[13];                                                                                               // package length
                row[73]  = "CM";                                                                                                   // package length unit of measure
                row[74]  = list[14];                                                                                               // package width
                row[75]  = "CM";                                                                                                   // package width unit of measure
                row[76]  = list[15];                                                                                               // package weight
                row[77]  = "GR";                                                                                                   // package weight unit of measure
                row[83]  = "IN";                                                                                                   // country of region
                row[86]  = list[35];                                                                                               // color name 1
                row[88]  = list[35];                                                                                               // color map
                row[90]  = list[16];                                                                                               // outer material type
                row[93]  = list[16];                                                                                               // material type
                row[94]  = list[16];                                                                                               // leather type
                row[95]  = "Leather";                                                                                              // fabric type
                row[125] = "All Seasons";                                                                                          // seasons
                row[126] = "Casual, Formal, Travel, Executive";                                                                    // lifestyle
                row[127] = "ASHLIN";                                                                                               // collection name

                MainTable.Rows.Add(row);
                Progress++;
            }

            // finish loading table
            MainTable.EndLoadData();
            Connection.Close();

            return(MainTable);
        }
Exemplo n.º 19
0
        void ReleaseDesignerOutlets()
        {
            if (AlignXButton != null)
            {
                AlignXButton.Dispose();
                AlignXButton = null;
            }

            if (BrightnessSlider != null)
            {
                BrightnessSlider.Dispose();
                BrightnessSlider = null;
            }

            if (BrightnessToolItem != null)
            {
                BrightnessToolItem.Dispose();
                BrightnessToolItem = null;
            }

            if (CancelToolItem != null)
            {
                CancelToolItem.Dispose();
                CancelToolItem = null;
            }

            if (EditThumbsButton != null)
            {
                EditThumbsButton.Dispose();
                EditThumbsButton = null;
            }

            if (FrameSelectedLabel != null)
            {
                FrameSelectedLabel.Dispose();
                FrameSelectedLabel = null;
            }

            if (FrameSelectSlider != null)
            {
                FrameSelectSlider.Dispose();
                FrameSelectSlider = null;
            }

            if (GraphResetButton != null)
            {
                GraphResetButton.Dispose();
                GraphResetButton = null;
            }

            if (MainGraph != null)
            {
                MainGraph.Dispose();
                MainGraph = null;
            }

            if (MainProgressBar != null)
            {
                MainProgressBar.Dispose();
                MainProgressBar = null;
            }

            if (MainTable != null)
            {
                MainTable.Dispose();
                MainTable = null;
            }

            if (MainTabView != null)
            {
                MainTabView.Dispose();
                MainTabView = null;
            }

            if (MetadataToolItem != null)
            {
                MetadataToolItem.Dispose();
                MetadataToolItem = null;
            }

            if (OpenFileToolItem != null)
            {
                OpenFileToolItem.Dispose();
                OpenFileToolItem = null;
            }

            if (ProcessToolItem != null)
            {
                ProcessToolItem.Dispose();
                ProcessToolItem = null;
            }

            if (Statuslabel != null)
            {
                Statuslabel.Dispose();
                Statuslabel = null;
            }

            if (TabChangeButton != null)
            {
                TabChangeButton.Dispose();
                TabChangeButton = null;
            }

            if (ThumbEditView != null)
            {
                ThumbEditView.Dispose();
                ThumbEditView = null;
            }

            if (ThumbViewGraph != null)
            {
                ThumbViewGraph.Dispose();
                ThumbViewGraph = null;
            }

            if (ThumbViewList != null)
            {
                ThumbViewList.Dispose();
                ThumbViewList = null;
            }

            if (YToEndButton != null)
            {
                YToEndButton.Dispose();
                YToEndButton = null;
            }

            if (YToStartButton != null)
            {
                YToStartButton.Dispose();
                YToStartButton = null;
            }
        }
Exemplo n.º 20
0
        public BmpMain()
        {
            InitializeComponent();

            this.UpdatePerformance();

            BmpUpdate update = new BmpUpdate();

            if (!Program.programOptions.DisableUpdate)
            {
                updateResult = update.ShowDialog();
                if (updateResult == DialogResult.Yes)
                {
                    updateTitle  = update.version.updateTitle;
                    updateText   = update.version.updateText;
                    updateResult = DialogResult.Yes;
                }
                if (updateResult == DialogResult.Ignore)
                {
                    string log = " This is a preview of a future version of BMP! Please be kind and report any bugs or unexpected behaviors to discord channel.";
                    ChatLogAll.AppendRtf(BmpChatParser.FormatRtf(log, Color.LightYellow, true));
                }
                if (!string.IsNullOrEmpty(update.version.updateLog))
                {
                    string log = string.Format("= BMP Update =\n {0} \n", update.version.updateLog);
                    ChatLogAll.AppendRtf(BmpChatParser.FormatRtf(log, Color.LightGreen, true));
                }
            }
            this.Text = update.version.ToString();

            // Clear local orchestra
            InfoTabs.TabPages.Remove(localOrchestraTab);

            LocalOrchestra.onMemoryCheck += delegate(Object o, bool status) {
                if (status)
                {
                    this.FFXIV.memory.StopThread();
                }
                else
                {
                    this.FFXIV.memory.StartThread();
                }
            };

            FFXIV.findProcessRequest += delegate(Object o, EventArgs empty) {
                this.Invoke(t => t.FindProcess());
            };

            FFXIV.findProcessError += delegate(Object o, BmpHook.ProcessError error) {
                this.Invoke(t => t.ErrorProcess(error));
            };

            FFXIV.hotkeys.OnFileLoad += delegate(Object o, EventArgs empty) {
                this.Invoke(t => t.Hotkeys_OnFileLoad(FFXIV.hotkeys));
            };
            FFXIV.hook.OnKeyPressed     += Hook_OnKeyPressed;
            FFXIV.memory.OnProcessReady += delegate(object o, Process proc) {
                this.Log(string.Format("[{0}] Process scanned and ready.", proc.Id));
                if (Sharlayan.Reader.CanGetActors())
                {
                    if (!Sharlayan.Reader.CanGetCharacterId())
                    {
                        this.Log("[MEMORY] Cannot get Character ID.\n Key bindings won't be loaded, load it manually by selecting an ID in the bottom right.");
                    }
                    if (!Sharlayan.Reader.CanGetChatInput())
                    {
                        this.Log("[MEMORY] Cannot get chat input status.\n Automatic pausing when chatting won't work.");
                    }
                    if (!Sharlayan.Reader.CanGetPerformance())
                    {
                        this.Log("[MEMORY] Cannot get performance status.\n Performance detection will not work. Force it to work by ticking Settings > Force playback.");
                    }
                }
                else
                {
                    List <Sharlayan.Models.Signature> signatures = Sharlayan.Signatures.Resolve().ToList();
                    int sigCount = signatures.Count;
                    foreach (Sharlayan.Models.Signature sig in signatures)
                    {
                        if (Sharlayan.Scanner.Instance.Locations.ContainsKey(sig.Key))
                        {
                            sigCount--;
                        }
                        else
                        {
                            Console.WriteLine(string.Format("Could not find signature {0}", sig.Key));
                        }
                    }
                    if (sigCount == signatures.Count)
                    {
                        this.Log(string.Format("[MEMORY] Cannot read memory ({0}/{1}). Functionality will be severely limited.", sigCount, signatures.Count));
                        this.Invoke(t => t.ErrorProcess(BmpHook.ProcessError.ProcessNonAccessible));
                    }
                    else
                    {
                        this.Log("[MEMORY] Cannot read actors. Local performance will be broken.");
                    }
                }
            };
            FFXIV.memory.OnProcessLost += delegate(object o, EventArgs arg) {
                this.Log("Attached process exited.");
            };
            FFXIV.memory.OnChatReceived += delegate(object o, ChatLogItem item) {
                this.Invoke(t => t.Memory_OnChatReceived(item));
            };
            FFXIV.memory.OnPerformanceChanged += delegate(object o, List <uint> ids) {
                this.Invoke(t => t.LocalOrchestraUpdate((o as FFXIVMemory).GetActorItems(ids)));
            };
            FFXIV.memory.OnPerformanceReadyChanged += delegate(object o, bool performance) {
                this.Invoke(t => t.Memory_OnPerformanceReadyChanged(performance));
            };
            FFXIV.memory.OnCurrentPlayerJobChange += delegate(object o, CurrentPlayerResult res) {
                this.Invoke(t => t.Memory_OnCurrentPlayerJobChange(res));
            };
            FFXIV.memory.OnCurrentPlayerLogin += delegate(object o, CurrentPlayerResult res) {
                string world = string.Empty;
                if (Sharlayan.Reader.CanGetWorld())
                {
                    world = Sharlayan.Reader.GetWorld();
                }
                if (string.IsNullOrEmpty(world))
                {
                    this.Log(string.Format("Character [{0}] logged in.", res.CurrentPlayer.Name));
                }
                else
                {
                    this.Log(string.Format("Character [{0}] logged in at [{1}].", res.CurrentPlayer.Name, world));
                }

                if (!Program.programOptions.DisableUpdate)
                {
                    BmpDonationChecker don = new BmpDonationChecker(res.CurrentPlayer.Name, world);
                    don.OnDonatorResponse += delegate(Object obj, BmpDonationChecker.DonatorResponse donres) {
                        if (donres.donator)
                        {
                            if (!string.IsNullOrEmpty(donres.donationMessage))
                            {
                                this.Log(donres.donationMessage);
                            }
                        }
                        this.Invoke(t => t.DonationStatus = donres.donator);
                    };
                }

                this.Invoke(t => t.UpdatePerformance());
            };
            FFXIV.memory.OnCurrentPlayerLogout += delegate(object o, CurrentPlayerResult res) {
                string format = string.Format("Character [{0}] logged out.", res.CurrentPlayer.Name);
                this.Log(format);
            };
            FFXIV.memory.OnPartyChanged += delegate(object o, PartyResult res) {
                this.Invoke(t => t.LocalOrchestraUpdate());
            };

            Player.OnStatusChange += delegate(object o, PlayerStatus status) {
                this.Invoke(t => t.UpdatePerformance());
            };

            Player.OnSongSkip += OnSongSkip;

            Player.OnMidiProgressChange += OnPlayProgressChange;

            Player.OnMidiStatusChange += OnPlayStatusChange;
            Player.OnMidiStatusEnded  += OnPlayStatusEnded;

            Player.OnMidiNote  += OnMidiVoice;
            Player.OffMidiNote += OffMidiVoice;

            Player.Player.OpenInputDevice(Settings.GetMidiInput().name);

            Settings.OnMidiInputChange += delegate(object o, MidiInput input) {
                Player.Player.CloseInputDevice();
                if (input.id != -1)
                {
                    Player.Player.OpenInputDevice(input.name);
                    Log(string.Format("Switched to {0} ({1})", input.name, input.id));
                }
            };
            Settings.OnKeyboardTest += delegate(object o, EventArgs arg) {
                foreach (FFXIVKeybindDat.Keybind keybind in FFXIV.hotkeys.GetPerformanceKeybinds())
                {
                    FFXIV.hook.SendSyncKeybind(keybind);
                    Thread.Sleep(100);
                }
            };

            Settings.OnForcedOpen += delegate(object o, bool open)
            {
                this.Invoke(t => {
                    if (open)
                    {
                        Log(string.Format("Forced playback was enabled. You will not be able to use keybinds, such as spacebar."));
                        WarningLog("Forced playback enabled.");
                    }

                    t.UpdatePerformance();
                });
            };

            Explorer.OnBrowserVisibleChange += delegate(object o, bool visible) {
                MainTable.SuspendLayout();
                MainTable.RowStyles[MainTable.GetRow(ChatPlaylistTable)].Height   = visible ? 0 : 100;
                MainTable.RowStyles[MainTable.GetRow(ChatPlaylistTable)].SizeType = visible ? SizeType.Absolute : SizeType.Percent;
                //ChatPlaylistTable.Invoke(t => t.Visible = !visible);

                MainTable.RowStyles[MainTable.GetRow(Explorer)].Height   = visible ? 100 : 30;
                MainTable.RowStyles[MainTable.GetRow(Explorer)].SizeType = visible ? SizeType.Percent : SizeType.Absolute;
                MainTable.ResumeLayout(true);
            };
            Explorer.OnBrowserSelect += Browser_OnMidiSelect;

            Playlist.OnMidiSelect               += Playlist_OnMidiSelect;
            Playlist.OnPlaylistRequestAdd       += Playlist_OnPlaylistRequestAdd;
            Playlist.OnPlaylistManualRequestAdd += Playlist_OnPlaylistManualRequestAdd;

            this.ResizeBegin += (s, e) => {
                LocalOrchestra.SuspendLayout();
            };
            this.ResizeEnd += (s, e) => {
                LocalOrchestra.ResumeLayout(true);
            };

            if (Properties.Settings.Default.SaveLog)
            {
                FileTarget target = new NLog.Targets.FileTarget("chatlog")
                {
                    FileName          = "logs/ff14log.txt",
                    Layout            = @"${date:format=yyyy-MM-dd HH\:mm\:ss} ${message}",
                    ArchiveDateFormat = "${shortdate}",
                    ArchiveEvery      = FileArchivePeriod.Day,
                    ArchiveFileName   = "logs/ff14log-${shortdate}.txt",
                    Encoding          = Encoding.UTF8,
                    KeepFileOpen      = true,
                };

                var config = new NLog.Config.LoggingConfiguration();
                config.AddRule(LogLevel.Info, LogLevel.Info, target);
                NLog.LogManager.Configuration = config;
            }

            string upath = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoaming).FilePath;

            //Console.WriteLine(string.Format(".config: [{0}]", upath));

            Settings.RefreshMidiInput();

            Log("Bard Music Player initialized.");
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            if (isNew)
            {
                id = MainModel.GetCountRecords() + 1;
            }

            int jobID = string.IsNullOrWhiteSpace(comboBox1.Text)
                ? 0
                : JobsModel.GetOneJobs(comboBox1.Text).First().Id;

            bool isCorrectSalary = Double.TryParse(textBox10.Text, out double salary);

            if (!isCorrectSalary)
            {
                MessageBox.Show("Зарплата не вірна");
                return;
            }

            var main = new MainTable
            {
                Id               = id,
                FName            = textBox2.Text, // Top
                MName            = textBox3.Text,
                LName            = textBox1.Text,
                JobId            = jobID,
                TimeTableNum     = textBox9.Text, // Middle Main
                IndividualTaxNum = textBox8.Text,
                Sex              = comboBox3.Text.Equals("Чоловік"),
                EmploymentDate   = dateTimePicker2.Value.Date,
                DateDismissal    = dateTimePicker3.Value.Date,
                UpdateAt         = DateTime.Today,
                Email            = textBox5.Text,
                TelWork          = textBox6.Text,
                TelHome          = textBox7.Text,
                About            = textBox4.Text,
                Salary           = salary,
                IsActivity       = comboBox2.Text.Equals("Працює") // Bottom
            };

            int isUpdated = isNew ? MainModel.Insert(main) : MainModel.Update(main);

            if (isUpdated == 1)
            {
                if (isNew)
                {
                    EmployeesLV.AddOneData(id);
                }
                else
                {
                    EmployeesLV.UpdateOneData(id);
                }

                EmployeesLV.UpdateSelected();
                label19.BackColor = Color.DarkSlateGray;
                label19.Text      = "Збережено";
            }
            else
            {
                label19.BackColor = Color.FromArgb(185, 46, 59);
                label19.Text      = "Не збережено";
            }

            label19.Visible = true;
            timer1.Enabled  = true;
        }
Exemplo n.º 22
0
        /* method that get the table */
        public override DataTable GetTable()
        {
            // reset table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "Design Service Code");               // 1
            AddColumn(MainTable, "Brand");                             // 2
            AddColumn(MainTable, "Design Service Flag");               // 3
            AddColumn(MainTable, "Design Service Family Code");        // 4
            AddColumn(MainTable, "Ashlin Internal Name");              // 5
            AddColumn(MainTable, "Short Description");                 // 6
            AddColumn(MainTable, "Extended Description");              // 7
            AddColumn(MainTable, "Trend Short Description");           // 8
            AddColumn(MainTable, "Trend Extended Description");        // 9
            AddColumn(MainTable, "Online Description");                // 10
            AddColumn(MainTable, "Gift Box");                          // 11
            AddColumn(MainTable, "Imprintable");                       // 12
            AddColumn(MainTable, "Imprintable Height");                // 13
            AddColumn(MainTable, "Imprinttable Width");                // 14
            AddColumn(MainTable, "Width");                             // 15
            AddColumn(MainTable, "Height");                            // 16
            AddColumn(MainTable, "Depth");                             // 17
            AddColumn(MainTable, "Weight");                            // 18
            AddColumn(MainTable, "Flat Shippable");                    // 19
            AddColumn(MainTable, "Fold Shippable");                    // 20
            AddColumn(MainTable, "Shippable Width");                   // 21
            AddColumn(MainTable, "Shippable Height");                  // 22
            AddColumn(MainTable, "Shippable Depth");                   // 23
            AddColumn(MainTable, "Shippable Weight");                  // 24
            AddColumn(MainTable, "Detachable Strap");                  // 25
            AddColumn(MainTable, "Zippered Enclosure");                // 26
            AddColumn(MainTable, "Country of Origin");                 // 27
            AddColumn(MainTable, "Shoulder Drop Length");              // 28
            AddColumn(MainTable, "Handle/Strap Drop Length");          // 29
            AddColumn(MainTable, "Notable Strap or General Features"); //30
            AddColumn(MainTable, "Protective Feet");                   // 31
            AddColumn(MainTable, "Closure");                           // 32
            AddColumn(MainTable, "Inner Pocket");                      // 33
            AddColumn(MainTable, "Outside Pocket");                    // 34
            AddColumn(MainTable, "Size Differentiation");              // 35
            AddColumn(MainTable, "Dust Bag");                          // 36
            AddColumn(MainTable, "Authenticity Card");                 // 37
            AddColumn(MainTable, "Bill Compartment");                  // 38
            AddColumn(MainTable, "Card Slot");                         // 39
            AddColumn(MainTable, "Option 1");                          // 40
            AddColumn(MainTable, "Option 2");                          // 41
            AddColumn(MainTable, "Option 3");                          // 42
            AddColumn(MainTable, "Option 4");                          // 43
            AddColumn(MainTable, "Option 5");                          // 44
            AddColumn(MainTable, "Active");                            // 45

            // start loading data
            MainTable.BeginLoadData();
            Connection.Open();

            // add data to each row
            foreach (string sku in SkuList)
            {
                ArrayList list = GetData(sku);
                DataRow   row  = MainTable.NewRow();

                row[0]  = list[0];      // design service code
                row[1]  = list[1];      // brand
                row[2]  = list[2];      // design service flag
                row[3]  = list[3];      // design service family code
                row[4]  = list[4];      // ashlin internal name
                row[5]  = list[5];      // short description
                row[6]  = list[6];      // extended description
                row[7]  = list[7];      // trend short description
                row[8]  = list[8];      // trend extended description
                row[9]  = list[9];      // online description
                row[10] = list[10];     // gift box
                row[11] = list[11];     // imprintable
                row[12] = list[12];     // imprintable height
                row[13] = list[13];     // imprintable width
                row[14] = list[14];     // width
                row[15] = list[15];     // height
                row[16] = list[16];     // depth
                row[17] = list[17];     // weight
                row[18] = list[18];     // flat shippable
                row[19] = list[19];     // fold shippable
                row[20] = list[20];     // shippable width
                row[21] = list[21];     // shippable height
                row[22] = list[22];     // shippable depth
                row[23] = list[23];     // shippable weight
                row[24] = list[24];     // detachable strap
                row[25] = list[25];     // zippered enclosure
                row[26] = list[26];     // country
                row[27] = list[27];     // shoulder drop length
                row[28] = list[28];     // handle strap drop length
                row[29] = list[29];     // notable strap or general features
                row[30] = list[30];     // protective feet
                row[31] = list[31];     // closure
                row[32] = list[32];     // inner pocket
                row[33] = list[33];     // outside pocket
                row[34] = list[34];     // size differentiation
                row[35] = list[35];     // dust bag
                row[36] = list[36];     // authenticity card
                row[37] = list[37];     // bill compartment
                row[38] = list[38];     // card slot
                row[39] = list[39];     // option 1
                row[40] = list[40];     // option 2
                row[41] = list[41];     // option 3
                row[42] = list[42];     // option 4
                row[43] = list[43];     // option 5
                row[44] = list[44];     // active

                MainTable.Rows.Add(row);
                Progress++;
            }

            // finish loading data
            MainTable.EndLoadData();
            Connection.Close();

            return(MainTable);
        }
Exemplo n.º 23
0
        /* the real thing -> return the table !!! */
        public override DataTable GetTable()
        {
            // reset table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "BP item ID#");          // 1
            AddColumn(MainTable, "SKU#");                 // 2
            AddColumn(MainTable, "Description");          // 3
            AddColumn(MainTable, "QTY breaks");           // 4
            AddColumn(MainTable, "COSTS breaks");         // 5

            // local field for inserting data to table
            DataTable table = Properties.Settings.Default.StockQuantityTable;

            double[][] discountList = GetDiscount();

            // start loading data
            MainTable.BeginLoadData();
            Connection.Open();

            // add data to each row
            foreach (string sku in SkuList)
            {
                DataRow  row  = MainTable.NewRow();
                object[] list = GetData(sku);

                row[0] = table.Select("SKU = \'" + sku + "\'")[0][1];       // BP item id#
                row[1] = sku;                                               // sku#
                row[2] = list[2] + " - " + list[3] + " - " + list[4];       // description
                row[3] = "1; 6; 24; 50; 100; 250; 500; 1000; 2500";         // qty breaks
                double msrp = Convert.ToDouble(list[0]) * discountList[7][0];
                int    k;
                switch (Convert.ToInt32(list[5]))
                {
                case 1:
                    k = 1;
                    break;

                case 2:
                    k = 2;
                    break;

                case 3:
                    k = 3;
                    break;

                case 4:
                    k = 4;
                    break;

                case 5:
                    k = 5;
                    break;

                case 6:
                    k = 6;
                    break;

                default:
                    k = 0;
                    break;
                }
                double runCharge = list[1].Equals(DBNull.Value)? Math.Round(msrp * 0.05) / 0.6 : Math.Round(msrp * 0.05) / 0.6 + Convert.ToInt32(list[1]) - 1;
                if (runCharge > 8)
                {
                    runCharge = 8;
                }
                else if (runCharge < 1)
                {
                    runCharge = 1;
                }
                msrp = msrp + runCharge;
                // costs breaks
                row[4] = Math.Round(msrp * discountList[k][0], 4) + "; " + Math.Round(msrp * discountList[k][1], 4) + "; " + Math.Round(msrp * discountList[k][2], 4) + "; " + Math.Round(msrp * discountList[k][3], 4) + "; "
                         + Math.Round(msrp * discountList[k][4], 4) + "; " + Math.Round(msrp * discountList[k][5], 4) + "; " + Math.Round(msrp * discountList[k][6], 4) + "; " + Math.Round(msrp * discountList[k][7], 4) + "; "
                         + Math.Round(msrp * discountList[k][8], 4);

                MainTable.Rows.Add(row);
                Progress++;
            }

            // finish loading data
            MainTable.EndLoadData();
            Connection.Close();

            return(MainTable);
        }
Exemplo n.º 24
0
 public void SelectTableRow(int index)
 {
     MainTable.SelectRow(index, false);
 }
Exemplo n.º 25
0
        /* method that get the table */
        public override DataTable GetTable()
        {
            // reset table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "SKU");                    // 1
            AddColumn(MainTable, "Design Service Code");    // 2
            AddColumn(MainTable, "Material Code");          // 3
            AddColumn(MainTable, "Colour Code");            // 4
            AddColumn(MainTable, "SKU Sears.ca");           // 5
            AddColumn(MainTable, "SKU TSC.ca");             // 6
            AddColumn(MainTable, "SKU The Bay");            // 7
            AddColumn(MainTable, "SKU Bestbuy.ca");         // 8
            AddColumn(MainTable, "SKU Amazon.ca");          // 9
            AddColumn(MainTable, "SKU Amazon.com");         // 10
            AddColumn(MainTable, "SKU Shop.ca");            // 11
            AddColumn(MainTable, "Base Price");             // 12
            AddColumn(MainTable, "Pricing Tier");           // 13
            AddColumn(MainTable, "Reorder Quantity");       // 14
            AddColumn(MainTable, "Reorder Level");          // 15
            AddColumn(MainTable, "UPC Code 9");             // 16
            AddColumn(MainTable, "UPC Code 10");            // 17
            AddColumn(MainTable, "Location Full");          // 18
            AddColumn(MainTable, "HTS CA");                 // 19
            AddColumn(MainTable, "HTS US");                 // 20
            AddColumn(MainTable, "Duty CA");                // 21
            AddColumn(MainTable, "Duty US");                // 22
            AddColumn(MainTable, "Lining Material");        // 23
            AddColumn(MainTable, "Trim");                   // 24
            AddColumn(MainTable, "Hardware Colour");        // 25
            AddColumn(MainTable, "Handle Material");        // 26
            AddColumn(MainTable, "Active");                 // 27

            // start loading data
            MainTable.BeginLoadData();
            Connection.Open();

            // add data to each row
            foreach (string sku in SkuList)
            {
                ArrayList list = GetData(sku);
                DataRow   row  = MainTable.NewRow();

                row[0]  = list[0];      // sku
                row[1]  = list[1];      // design service code
                row[2]  = list[2];      // material code
                row[3]  = list[3];      // colour code
                row[4]  = list[4];      // sku sears ca
                row[5]  = list[5];      // sku tsc ca
                row[6]  = list[6];      // sku the bay
                row[7]  = list[7];      // sku bestbuy ca
                row[8]  = list[8];      // sku amazon ca
                row[9]  = list[9];      // sku amazon com
                row[10] = list[10];     // sku shop ca
                row[11] = list[11];     // base price
                row[12] = list[12];     // pricing tier
                row[13] = list[13];     // reorder quantity
                row[14] = list[14];     // reorder level
                row[15] = list[15];     // upc code 9
                row[16] = list[16];     // upc code 10
                row[17] = list[17];     // location full
                row[18] = list[18];     // hts ca
                row[19] = list[19];     // hts us
                row[20] = list[20];     // duty ca
                row[21] = list[21];     // duty us
                row[22] = list[22];     // lining material
                row[23] = list[23];     // trim
                row[24] = list[24];     // hardware color
                row[25] = list[25];     // handle material
                row[26] = list[26];     // active

                MainTable.Rows.Add(row);
                Progress++;
            }

            // finish loading data
            MainTable.EndLoadData();
            Connection.Close();

            return(MainTable);
        }
Exemplo n.º 26
0
        /* the real thing -> return the table !!! */
        public override DataTable GetTable()
        {
            // reset the table just in case
            MainTable.Reset();

            // add column to table
            AddColumn(MainTable, "supplier id");                             // 1
            AddColumn(MainTable, "store name");                              // 2
            AddColumn(MainTable, "sku");                                     // 3
            AddColumn(MainTable, "title");                                   // 4
            AddColumn(MainTable, "description");                             // 5
            AddColumn(MainTable, "shipping weight");                         // 6
            AddColumn(MainTable, "shipping weight unit of measure");         // 7
            AddColumn(MainTable, "primary product category id");             // 8
            AddColumn(MainTable, "product type");                            // 9
            AddColumn(MainTable, "main image location");                     // 10
            AddColumn(MainTable, "standard product id");                     // 11
            AddColumn(MainTable, "standard product id type");                // 12
            AddColumn(MainTable, "availability");                            // 13
            AddColumn(MainTable, "brand");                                   // 14
            AddColumn(MainTable, "launch date");                             // 15
            AddColumn(MainTable, "release date");                            // 16
            AddColumn(MainTable, "product condition");                       // 17
            AddColumn(MainTable, "item package quantity");                   // 18
            AddColumn(MainTable, "number of items");                         // 19
            AddColumn(MainTable, "designer");                                // 20
            AddColumn(MainTable, "package height");                          // 21
            AddColumn(MainTable, "package length");                          // 22
            AddColumn(MainTable, "package width");                           // 23
            AddColumn(MainTable, "package dimension unit of measure");       // 24
            AddColumn(MainTable, "max order quantity");                      // 25
            AddColumn(MainTable, "legal disclaimer");                        // 26
            AddColumn(MainTable, "manufacturer");                            // 27
            AddColumn(MainTable, "mfr part number");                         // 28
            AddColumn(MainTable, "search terms");                            // 29
            AddColumn(MainTable, "parent sku");                              // 30
            AddColumn(MainTable, "secondary product category id");           // 31
            AddColumn(MainTable, "is new product");                          // 32
            AddColumn(MainTable, "alt image location 1");                    // 33
            AddColumn(MainTable, "alt image location 2");                    // 34
            AddColumn(MainTable, "alt image location 3");                    // 35
            AddColumn(MainTable, "alt image location 4");                    // 36
            AddColumn(MainTable, "alt image location 5");                    // 37
            AddColumn(MainTable, "alt image location 6");                    // 38
            AddColumn(MainTable, "alt image location 7");                    // 39
            AddColumn(MainTable, "alt image location 8");                    // 40
            AddColumn(MainTable, "alt image location 9");                    // 41
            AddColumn(MainTable, "video location");                          // 42
            AddColumn(MainTable, "material");                                // 43
            AddColumn(MainTable, "color");                                   // 44
            AddColumn(MainTable, "style");                                   // 45
            AddColumn(MainTable, "trend");                                   // 47
            AddColumn(MainTable, "strap type");                              // 46
            AddColumn(MainTable, "closure type");                            // 48
            AddColumn(MainTable, "generic size");                            // 49
            AddColumn(MainTable, "features");                                // 50

            // start loading data
            MainTable.BeginLoadData();
            Connection.Open();

            // add data to each row
            foreach (string sku in SkuList)
            {
                ArrayList list   = GetData(sku);
                DataRow   newRow = MainTable.NewRow();

                newRow[0]  = "ashlin_bpg";                                                       // supplier id
                newRow[1]  = "nishis_boutique";                                                  // store name
                newRow[2]  = list[24];                                                           // sku
                newRow[3]  = "Ashlin® " + list[0] + " " + list[21] + " " + list[23];             // title
                newRow[4]  = list[1];                                                            // description
                newRow[5]  = list[2];                                                            // shipping weight
                newRow[6]  = "GM";                                                               // shipping weight unit of measure
                newRow[7]  = 151048;                                                             // primary product category id
                newRow[8]  = list[18];                                                           // product type
                newRow[9]  = list[25];                                                           // main image location
                newRow[10] = list[37];                                                           // standard product id
                newRow[11] = "UPC";                                                              // standard product id type
                newRow[12] = true;                                                               // availability
                newRow[13] = "Ashlin®";                                                          // brand
                newRow[14] = list[26];                                                           // launch date
                newRow[15] = list[36];                                                           // release date
                newRow[16] = "NEW";                                                              // product condition
                newRow[17] = 1;                                                                  // item package quantity
                newRow[18] = 1;                                                                  // number of items
                newRow[19] = "Ashlin®";                                                          // designer
                newRow[20] = list[3];                                                            // package height
                newRow[21] = list[4];                                                            // package length
                newRow[22] = list[5];                                                            // package width
                newRow[23] = "CM";                                                               // package dimension unit of measure
                newRow[24] = 100;                                                                // max order quantity
                newRow[25] = "";                                                                 // legal disclaimer
                newRow[26] = "Ashlin BPG Marketing INC";                                         // manufacturer
                newRow[27] = list[24];                                                           // mfr part number
                newRow[28] = list[19];                                                           // search term
                newRow[29] = list[24].ToString().Substring(0, list[24].ToString().IndexOf('-')); // parent sku
                newRow[30] = 620977;                                                             // secondary product category id
                newRow[31] = true;                                                               // is new product
                newRow[32] = list[27];                                                           // alt iamge location 1
                newRow[33] = list[28];                                                           // alt iamge location 2
                newRow[34] = list[29];                                                           // alt iamge location 3
                newRow[35] = list[30];                                                           // alt iamge location 4
                newRow[36] = list[31];                                                           // alt iamge location 5
                newRow[37] = list[32];                                                           // alt iamge location 6
                newRow[38] = list[33];                                                           // alt iamge location 7
                newRow[39] = list[34];                                                           // alt iamge location 8
                newRow[40] = list[35];                                                           // alt iamge location 9
                newRow[42] = list[20];                                                           // material
                newRow[43] = list[22];                                                           // colour
                newRow[44] = list[0];                                                            // style
                newRow[45] = list[12];                                                           // trend
                if ((bool)list[6] && (bool)list[7])                                              // strap type

                {
                    newRow[46] = true + " Detachable strap";
                }
                else if ((bool)list[6])
                {
                    newRow[46] = true;
                }
                else
                {
                    newRow[46] = false;
                }
                if ((bool)list[8])  // colsure type
                {
                    newRow[47] = "Zippered enclosure";
                }
                newRow[48] = list[9] + "cm x " + list[10] + "cm x " + list[11] + "cm";                         // generic size
                newRow[49] = list[13] + " " + list[14] + " " + list[15] + " " + list[16] + " " + list[17];     // features

                MainTable.Rows.Add(newRow);
                Progress++;
            }

            // finish loading data
            MainTable.EndLoadData();
            Connection.Close();

            return(MainTable);
        }
Exemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // Bind tables to UI components
     MainTable.SetDataSource("III. Magic Items");
     DataBind();
 }
Exemplo n.º 28
0
        // Public Methods (7)

        /// <summary>
        /// Adds a new PdfPCell to the MainTable
        /// </summary>
        /// <param name="backgroundColor"></param>
        /// <param name="foreColor"></param>
        /// <param name="rawData"></param>
        /// <param name="columnNumber"></param>
        /// <param name="pdfRowType"></param>
        /// <param name="pdfCellType"></param>
        /// <param name="rowValues"></param>
        /// <param name="horizontalAlignment"></param>
        /// <param name="pdfFontStyle"></param>
        /// <param name="rotation"></param>
        /// <param name="setItemTemplate"></param>
        /// <param name="colSpan"></param>
        /// <returns></returns>
        public CellAttributes AddGeneralCell(
            BaseColor backgroundColor,
            BaseColor foreColor,
            object rawData,
            int columnNumber,
            RowType pdfRowType,
            CellType pdfCellType,
            IList <CellData> rowValues = null,
            HorizontalAlignment horizontalAlignment = HorizontalAlignment.None,
            DocumentFontStyle pdfFontStyle          = DocumentFontStyle.None,
            int rotation         = 0,
            bool setItemTemplate = false,
            int colSpan          = 1)
        {
            var col = SharedData.PdfColumnsAttributes[columnNumber];

            var cellData = new CellAttributes
            {
                RowData = new CellRowData
                {
                    TableRowData          = rowValues,
                    Value                 = rawData,
                    PdfRowType            = pdfRowType,
                    ColumnNumber          = columnNumber,
                    PropertyName          = col.PropertyName,
                    LastRenderedRowNumber = CurrentRowInfoData.LastRenderedRowNumber
                },
                SharedData = new CellSharedData
                {
                    PdfColumnAttributes = col,
                    DataRowNumber       = CurrentRowInfoData.LastOverallDataRowNumber,
                    GroupNumber         = CurrentRowInfoData.LastGroupRowNumber,
                    PdfDoc          = SharedData.PdfDoc,
                    PdfWriter       = SharedData.PdfWriter,
                    SummarySettings = SharedData.SummarySettings,
                    Template        = SharedData.Template
                },
                ItemTemplate    = setItemTemplate ? col.ColumnItemsTemplate : null,
                BasicProperties = new CellBasicProperties
                {
                    PdfFont             = SharedData.PdfFont,
                    Rotation            = rotation,
                    PdfFontStyle        = (pdfFontStyle == DocumentFontStyle.None) ? DocumentFontStyle.Normal : pdfFontStyle,
                    BackgroundColor     = backgroundColor,
                    BorderColor         = SharedData.Template.CellBorderColor,
                    FontColor           = foreColor,
                    RunDirection        = SharedData.PageSetup.PagePreferences.RunDirection,
                    ShowBorder          = SharedData.Template.ShowGridLines,
                    HorizontalAlignment = (horizontalAlignment == HorizontalAlignment.None) ? col.CellsHorizontalAlignment : horizontalAlignment,
                    FixedHeight         = col.FixedHeight,
                    MinimumHeight       = col.MinimumHeight,
                    CellPadding         = col.Padding,
                    PaddingBottom       = col.PaddingBottom,
                    PaddingLeft         = col.PaddingLeft,
                    PaddingRight        = col.PaddingRight,
                    PaddingTop          = col.PaddingTop
                }
            };

            if (SharedData.MainTableEvents != null)
            {
                SharedData.MainTableEvents.CellCreated(new EventsArguments {
                    PdfDoc = SharedData.PdfDoc, PdfWriter = SharedData.PdfWriter, Cell = cellData, CellType = pdfCellType, RowType = pdfRowType, ColumnNumber = columnNumber, ColumnCellsSummaryData = SharedData.ColumnCellsSummaryData, PreviousTableRowData = CurrentRowInfoData.PreviousTableRowData, PageSetup = SharedData.PageSetup, PdfFont = SharedData.PdfFont, PdfColumnsAttributes = SharedData.PdfColumnsAttributes
                });
            }
            var cell = cellData.CreateSafePdfPCell(new TextBlockField());

            if (SharedData.ColumnCellsFinalSummaryData == null)
            {
                SharedData.ColumnCellsFinalSummaryData = new List <CellRowData>();
            }

            cell.CellEvent = new MainTableCellsEvent(cellData)
            {
                SummaryCellsData   = SharedData.ColumnCellsSummaryData,
                IsGroupingEnabled  = SharedData.IsGroupingEnabled,
                CurrentRowInfoData = CurrentRowInfoData,
                SharedData         = SharedData,
                CellType           = pdfCellType
            };

            if (colSpan > 1)
            {
                cell.Colspan = colSpan;
            }

            MainTable.AddCell(cell);
            if (SharedData.MainTableEvents != null)
            {
                SharedData.MainTableEvents.CellAdded(new EventsArguments {
                    PdfDoc = SharedData.PdfDoc, PdfWriter = SharedData.PdfWriter, Cell = cellData, CellType = pdfCellType, RowType = pdfRowType, ColumnNumber = columnNumber, ColumnCellsSummaryData = SharedData.ColumnCellsSummaryData, PreviousTableRowData = CurrentRowInfoData.PreviousTableRowData, PageSetup = SharedData.PageSetup, PdfFont = SharedData.PdfFont, PdfColumnsAttributes = SharedData.PdfColumnsAttributes
                });
            }

            return(cellData);
        }
Exemplo n.º 29
0
 //Очищаем таблицу
 private void ResetDataGridView()
 {
     MainTable.CancelEdit();
     MainTable.Columns.Clear();
     MainTable.DataSource = null;
 }
Exemplo n.º 30
0
        private EditTagWindow(IconSource source, NbtTag tag, NbtContainerTag parent, bool set_name, bool set_value, EditPurpose purpose)
        {
            InitializeComponent();

            NameBox.SetTags(tag, parent);
            ValueBox.SetTags(tag, parent, fill_current_value: purpose != EditPurpose.Create);

            SettingName = set_name;
            if (!SettingName)
            {
                this.MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height - MainTable.GetRowHeights()[0]);
                this.Height     -= MainTable.GetRowHeights()[0];
                MainTable.RowStyles[0].Height = 0;
                NameLabel.Visible             = false;
                NameBox.Visible = false;
            }

            SettingValue = set_value;
            if (!SettingValue)
            {
                this.MinimumSize   = new Size(MinimumSize.Width, MinimumSize.Height - MainTable.GetRowHeights()[1]);
                this.Height       -= MainTable.GetRowHeights()[1];
                ValueLabel.Visible = false;
                ValueBox.Visible   = false;
            }

            if (tag.TagType == NbtTagType.String)
            {
                ValueBox.Multiline     = true;
                ValueBox.AcceptsReturn = true;
                ValueBox.Anchor        = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
                this.AutoSize          = false;
                this.Width             = (int)(this.Width * 1.5);
                this.Height            = (int)(this.Height * 1.5);
                this.FormBorderStyle   = FormBorderStyle.Sizable;
                WordWrapCheck.Visible  = true;
                WordWrapCheck_CheckedChanged(this, EventArgs.Empty);
            }
            else if (NbtUtil.IsNumericType(tag.TagType))
            {
                ValueBox.PlaceholderText = "0";
            }
            this.Icon = NbtUtil.TagTypeImage(source, tag.TagType).Icon;
            if (purpose == EditPurpose.Create)
            {
                this.Text = $"Create {NbtUtil.TagTypeName(tag.TagType)} Tag";
            }
            else if (purpose == EditPurpose.EditValue || purpose == EditPurpose.Rename)
            {
                this.Text = $"Edit {NbtUtil.TagTypeName(tag.TagType)} Tag";
            }

            if (SettingName && (!SettingValue || purpose != EditPurpose.EditValue))
            {
                NameBox.Select();
                NameBox.SelectAll();
            }
            else if (SettingValue)
            {
                ValueBox.Select();
                ValueBox.SelectAll();
            }
        }