예제 #1
0
        private void FindPaymentsList()
        {
            foreach (var series in chart2.Series)
            {
                series.Points.Clear();
            }
            var searchList = payments.Where(x => x.PaymentDate >= dateTimeDetailFirst.Value).ToList();

            if (searchList.Count > 0)
            {
                dataGridView2.DataSource = searchList;
                //  dataGridView2.Visible = true;
                dataGridView1.Visible = false;
                chart1.Visible        = false;
                chart2.Visible        = true;
                for (int i = 0; i < searchList.Count; i++)
                {
                    chart2.Series["Ödemeler"].Points.AddXY(searchList[i].Name, searchList[i].PayforDay);
                    btnExtractExcell.Enabled = true;
                }
                dataGridView2.Columns[0].Visible = false;
                DataTableColumnNameChange.ChangeDataGridHeader(dataGridView2, "Ödeme Adı", "Ödenen Gün", "Ödeme Tarihi");
                dataGridView2.Columns[3].DefaultCellStyle.Format = "dd/MM/yyyy";
            }
            else
            {
                btnExtractExcell.Enabled = false;
                chart2.Visible           = false;
                dataGridView2.Visible    = false;
                MessageBox.Show("Bu Tarihler Arasında Ödeme Yapılmamıştır !", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
예제 #2
0
        public void ReadWorkOrderJson()
        {
            try
            {
                if (File.Exists(jsonWorkOrderDataPath) && new FileInfo(jsonWorkOrderDataPath).Length > 0)
                {
                    workOrders = DataListing.ReadWorkOrderJson(jsonWorkOrderDataPath, workOrders);
                    List <WorkOrder> currentWorkOrders = new List <WorkOrder>();
                    currentWorkOrders.AddRange(workOrders);
                    currentWorkOrders = currentWorkOrders.Where(x => x.ExpiredDate == null).ToList();
                    isDoneWorkOrders  = workOrders.Where(x => x.ExpiredDate != null).ToList();
                    if (checkedFilter)
                    {
                        dataGridView1.DataSource = workOrders.OrderBy(x => x.StartingDate).ToList();
                    }
                    else
                    {
                        dataGridView1.DataSource = currentWorkOrders.OrderBy(x => x.StartingDate).ToList();
                    }
                    dataGridView1.Columns[0].Visible = true;
                    dataGridView1.Columns[2].Visible = false;
                    DataTableColumnNameChange.ChangeDataGridHeader(dataGridView1, "İş Adı", "Açıklama", "Başlangıç Tarihi", "Bitirme Tarihi", "Teslim Tarihi", "Adam/Gün");
                    dataGridView1.Columns[3].DefaultCellStyle.Format = "dd/MM/yyyy";
                    dataGridView1.Columns[4].DefaultCellStyle.Format = "dd/MM/yyyy";
                    dataGridView1.Columns[5].DefaultCellStyle.Format = "dd/MM/yyyy";
                }
                if (File.Exists(jsonPaymentsDataPath) && new FileInfo(jsonPaymentsDataPath).Length > 0)
                {
                    payments = DataListing.ReadPaymentJson(jsonPaymentsDataPath, payments);
                    payments.Reverse();
                    dataGridView2.DataSource = payments;
                    DataTableColumnNameChange.ChangeDataGridHeader(dataGridView2, "Ödeme Adı", "Ödenen Gün", "Ödeme Tarihi");
                    dataGridView2.Columns[0].Visible = false;
                    dataGridView2.Columns[3].DefaultCellStyle.Format = "dd/MM/yyyy";
                }
                if (File.Exists(jsonPaymentsDataPath) || File.Exists(jsonWorkOrderDataPath))
                {
                    CalculatePayments(isDoneWorkOrders, payments);
                }

                CheckDataGridEmpty();
            }
            catch (Exception)
            {
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
예제 #3
0
        private void FindWorkOrders()
        {
            foreach (var series in chart1.Series)
            {
                series.Points.Clear();
            }
            var searchList = workOrders.Where(x => x.ExpiredDate >= dateTimeDetailFirst.Value && x.ExpiredDate <= dateTimeDetailExpired.Value).ToList();
            var listCount  = searchList.Count;

            if (listCount > 0)
            {
                dataGridView1.DataSource = searchList;
                // dataGridView1.Visible = true;
                chart1.Visible = true;
                for (int i = 0; i < searchList.Count; i++)
                {
                    chart1.Series["İş Emirleri"].Points.AddXY(searchList[i].Name, searchList[i].ManOfDay);
                    btnExtractExcell.Enabled = true;
                }
                dataGridView1.Columns[0].Visible = false;
                DataTableColumnNameChange.ChangeDataGridHeader(dataGridView1, "İş Adı", "Açıklama", "Başlangıç Tarihi", "Bitirme Tarihi", "Teslim Tarihi", "Adam/Gün");
                dataGridView1.Columns[3].DefaultCellStyle.Format = "dd/MM/yyyy";
                dataGridView1.Columns[4].DefaultCellStyle.Format = "dd/MM/yyyy";
                dataGridView1.Columns[5].DefaultCellStyle.Format = "dd/MM/yyyy";
                btnExtractExcell.Enabled = true;
            }
            else
            {
                btnExtractExcell.Enabled = false;
                chart1.Visible           = false;
                dataGridView1.Visible    = false;
                MessageBox.Show("Bu Tarihler Arasında İş Yapılmamıştır !", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }