Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CrossGeneralManager crossGeneralManager = new CrossGeneralManager();

            if (Form1.GDMLType == "U")
            {
                crossGeneralManager.UpdateCode(TXTCode.Text, Form1.GUrunMarka, Form1.GId);
                MessageBox.Show("Kayıt Güncellendi.");
            }
            else if (Form1.GDMLType == "I")
            {
                var modelList = new List <CrossGeneralModel>();
                modelList.Add(new CrossGeneralModel
                {
                    Oem       = TXTOem.Text,
                    Marka     = TXTOemMarka.Text,
                    UrunKodu  = TXTCode.Text,
                    AracTipi  = TXTCarType.Text,
                    UrunMarka = TXTMarka.Text
                });

                crossGeneralManager.AddData(modelList);
                MessageBox.Show("Yeni Kayıt Eklendi.");
            }

            this.Close();
        }
Пример #2
0
        private void veriAktar(string veriyolu, string extension)
        {
            if (String.IsNullOrEmpty(veriyolu))
            {
                MessageBox.Show("Dosya Seçmediniz !!!");
                return;
            }
            List <CrossGeneralModel> uruns = new List <CrossGeneralModel>();
            FileStream streamTemp          = File.Open(veriyolu, FileMode.Open, FileAccess.Read);

            ExcelPackage.LicenseContext = LicenseContext.NonCommercial;

            using (var package = new ExcelPackage(streamTemp))
            {
                var currentSheet = package.Workbook.Worksheets;
                var workSheet    = currentSheet[0];//florists
                var noOfCol      = workSheet.Dimension.End.Column;
                var noOfRow      = workSheet.Dimension.End.Row;
                for (int rowIterator = 1; rowIterator <= noOfRow; rowIterator++)
                {
                    var urun = new CrossGeneralModel();
                    urun.AracTipi  = workSheet.Cells[rowIterator, 1].Value != null ? workSheet.Cells[rowIterator, 1].Value.ToString() : string.Empty;
                    urun.Marka     = workSheet.Cells[rowIterator, 2].Value != null ? workSheet.Cells[rowIterator, 2].Value.ToString() : string.Empty;
                    urun.Oem       = workSheet.Cells[rowIterator, 3].Value != null ? workSheet.Cells[rowIterator, 3].Value.ToString() : string.Empty;
                    urun.UrunKodu  = workSheet.Cells[rowIterator, 4].Value != null ? workSheet.Cells[rowIterator, 4].Value.ToString() : string.Empty;
                    urun.UrunMarka = workSheet.Cells[rowIterator, 5].Value != null ? workSheet.Cells[rowIterator, 5].Value.ToString() : string.Empty;
                    if (!(String.IsNullOrEmpty(urun.AracTipi)))
                    {
                        uruns.Add(urun);
                    }

                    progressBar1.Value = (progressBar1.Value >= 100) ? 0 : progressBar1.Value;
                    progressBar1.Value++;
                }
                GRPLoader.Text = "Veriler Okundu";
                int i = 0;
                foreach (var item in uruns)
                {
                    if (i == 0)
                    {
                        CrossGeneralManager crossGeneralManager = new CrossGeneralManager();
                        crossGeneralManager.AddData(uruns);
                    }
                    progressBar1.Value = (progressBar1.Value >= 100) ? 0 : progressBar1.Value;
                    progressBar1.Value++;
                    GRPLoader.Text = "Veriler Dbye Yazılıyor.";
                    i++;
                }


                GRPLoader.Text    = "Veriler Dbye Yazıldı";
                GRPLoader.Visible = false;
                MessageBox.Show("Aktarım Tamamlandı");
            }
        }
Пример #3
0
        private void gezginGetir()
        {
            string itemCode = TXTCode.Text;
            //  //GridGezgin.Visible = true;
            CrossGeneralManager crossGeneralManager = new CrossGeneralManager();

            gridData             = crossGeneralManager.SearchCrossB2B(itemCode);
            GridItems.DataSource = gridData;
            var markalar = gridData.GroupBy(x => x.Marka).Select(x => x.Key).OrderBy(x => x).ToList();

            CMBMarka.Items.Add("Tümü");
            CMBMarka.Items.AddRange(markalar.ToArray());
            this.Text = "Kayıt Sayısı :" + GridItems.Rows.Count;
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            CrossGeneralManager crossGeneralManager = new CrossGeneralManager();
            var modelList = new List <CrossGeneralModel>();

            modelList.Add(new CrossGeneralModel {
                Oem       = TXTOem.Text,
                Marka     = TXTOemMarka.Text,
                UrunKodu  = TXTCode.Text,
                AracTipi  = TXTCarType.Text,
                UrunMarka = TXTMarka.Text
            });

            crossGeneralManager.AddData(modelList);
            this.Close();
        }
Пример #5
0
        private void BTNSil_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show(GOEM + " Oem Kaydı Silinecektir Emin misiniz ?", "Kayıt Sil", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                if (!String.IsNullOrEmpty(GId))
                {
                    CrossGeneralManager crossGeneralManager = new CrossGeneralManager();
                    var deleteResult = crossGeneralManager.DeleteCross(GId);
                    if (deleteResult)
                    {
                        gezginGetir();
                    }
                }
            }
            else if (dialogResult == DialogResult.No)
            {
            }
        }