Beispiel #1
0
        private void btnviewchart_Click(object sender, EventArgs e)
        {
            Lab_Total.Visible = true;
            fill_grid();
            if (Dgv_ChartExpanse.Rows.Count < 1)
            {
                int x = (panel3.Size.Width - Lab_Msg.Size.Width) / 2;
                Lab_Msg.Location = new Point(x, Lab_Msg.Location.Y);
                Lab_Msg.Show();
            }
            else
            {
                Lab_Msg.Hide();
            }
            Dgv_Expanse.Hide();
            chart_EXpanse.Show();
            btngrddailytreatment.Visible = true;
            chart_EXpanse.Location       = new Point(22, 50);
            chart_EXpanse.Size           = new Size(1306, 378);
            this.Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
            dateTimePickerdailytreatment1.MaxDate = DateTime.Now;
            dateTimePickerdailytreatment2.MaxDate = DateTime.Now;
            DateTime now  = DateTime.Now;
            DateTime date = new DateTime(now.Year, now.Month, 1);
            int      row  = Dgv_Expanse.Rows.Count;

            Lab_Total.Text = row.ToString();
        }
Beispiel #2
0
        private void btnselect_Click(object sender, EventArgs e)
        {
            var d1 = dateTimePickerdailytreatment1.Value.ToShortDateString();
            var d2 = dateTimePickerdailytreatment2.Value.ToShortDateString();

            if (Convert.ToDateTime(d1).Date > Convert.ToDateTime(d2).Date)
            {
                MessageBox.Show("From date should be less than to date", "From Date is grater ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                dateTimePickerdailytreatment1.Value = DateTime.Today;
                return;
            }
            fill_grid();
            if (Dgv_Expanse.Visible)
            {
                if (Dgv_ChartExpanse.Rows.Count < 1)
                {
                    int x = (panel3.Size.Width - Lab_Msg.Size.Width) / 2;
                    Lab_Msg.Location = new Point(x, Lab_Msg.Location.Y);
                    Lab_Msg.Show();
                }
                else
                {
                    Lab_Msg.Hide();
                }

                int row = Dgv_Expanse.Rows.Count;
                Lab_Total.Text = row.ToString();
                Dgv_Expanse.Show();
                chart_EXpanse.Hide();
                btngrddailytreatment.Visible = true;
                chart_EXpanse.Location       = new Point(22, 50);
                chart_EXpanse.Size           = new Size(1306, 378);
            }
            else
            {
                Dgv_Expanse.Hide();
                chart_EXpanse.Show();
                btngrddailytreatment.Visible = true;
                chart_EXpanse.Location       = new Point(22, 50);
                chart_EXpanse.Size           = new Size(1306, 378);
                this.Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
                dateTimePickerdailytreatment1.MaxDate = DateTime.Now;
                dateTimePickerdailytreatment2.MaxDate = DateTime.Now;
                DateTime now  = DateTime.Now;
                DateTime date = new DateTime(now.Year, now.Month, 1);
                int      row  = Dgv_Expanse.Rows.Count;
                Lab_Total.Text = row.ToString();
                if (Dgv_ChartExpanse.Rows.Count < 1)
                {
                    int x = (panel3.Size.Width - Lab_Msg.Size.Width) / 2;
                    Lab_Msg.Location = new Point(x, Lab_Msg.Location.Y);
                    Lab_Msg.Show();
                }
                else
                {
                    Lab_Msg.Hide();
                }
            }
        }
Beispiel #3
0
        private void Expense_Category_Wise_Report_Load(object sender, EventArgs e)
        {
            this.Dgv_Expanse.RowPostPaint += new DataGridViewRowPostPaintEventHandler(Dgv_Expanse_RowPostPaint);
            Dgv_Expanse.Hide();
            comboflag = true;
            this.Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
            //AddStaff.Select s = new AddStaff.Select();
            this.chart_EXpanse.Titles.Add("Category Wise Expense Count");
            dateTimePickerdailytreatment1.MaxDate = DateTime.Now;
            dateTimePickerdailytreatment2.MaxDate = DateTime.Now;
            DateTime now  = DateTime.Now;
            DateTime date = new DateTime(now.Year, now.Month, 1);

            dateTimePickerdailytreatment1.Value = date;
            //string date1 = dateTimePickerdailytreatment1.Value.ToString("MM/dd/yyyy");
            //string date2 = dateTimePickerdailytreatment2.Value.ToString("MM/dd/yyyy");
            chart_EXpanse.Location = new Point(22, 50);
            chart_EXpanse.Size     = new Size(1306, 378);
            foreach (var series in chart_EXpanse.Series)
            {
                series.Points.Clear();
            }
            Cmb_AccountName.Items.Add("All Accounts");
            Cmb_AccountName.ValueMember   = "0";
            Cmb_AccountName.DisplayMember = "All Accounts";
            System.Data.DataTable doctor_rs = this.cntrl.load_type();// db.table("select distinct id,name from tbl_expense_type");
            if (doctor_rs.Rows.Count > 0)
            {
                for (int i = 0; i < doctor_rs.Rows.Count; i++)
                {
                    Cmb_AccountName.Items.Add(doctor_rs.Rows[i]["name"].ToString());
                    Cmb_AccountName.ValueMember   = doctor_rs.Rows[i]["id"].ToString();
                    Cmb_AccountName.DisplayMember = doctor_rs.Rows[i]["name"].ToString();
                }
            }
            Cmb_AccountName.SelectedIndex = 0;
            Cmb_Ledger.Items.Add("All Ledger");
            Cmb_Ledger.ValueMember   = "0";
            Cmb_Ledger.DisplayMember = "All Ledger";
            System.Data.DataTable Ledger = this.cntrl.load_ledger();
            if (doctor_rs.Rows.Count > 0)
            {
                for (int i = 0; i < Ledger.Rows.Count; i++)
                {
                    Cmb_Ledger.Items.Add(Ledger.Rows[i]["Group_Name"].ToString());
                    Cmb_Ledger.ValueMember   = Ledger.Rows[i]["id"].ToString();
                    Cmb_Ledger.DisplayMember = Ledger.Rows[i]["Group_Name"].ToString();
                }
            }
            Cmb_Ledger.SelectedIndex = 0;
            if (Dgv_ChartExpanse.Rows.Count < 1)
            {
                int x = (panel3.Size.Width - Lab_Msg.Size.Width) / 2;
                Lab_Msg.Location = new Point(x, Lab_Msg.Location.Y);
                Lab_Msg.Show();
            }
            else
            {
                Lab_Msg.Hide();
            }
            Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.BackColor = Color.DimGray;
            Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.Font      = new System.Drawing.Font("Sego UI", 8, FontStyle.Bold);
            Dgv_ChartExpanse.EnableHeadersVisualStyles = false;
            foreach (DataGridViewColumn cl in Dgv_ChartExpanse.Columns)
            {
                cl.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            comboflag = false;
        }
Beispiel #4
0
        private void Expense_Daily_Report_Load(object sender, EventArgs e)
        {
            this.Dgv_Expanse.RowPostPaint += new DataGridViewRowPostPaintEventHandler(Dgv_Expanse_RowPostPaint);
            Dgv_Expanse.Hide();
            comboflag = true;
            this.Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
            this.chart_EXpanse.Titles.Add("Daily Expense Count");
            var dateFrom = dateTimePickerdailytreatment2.Value.ToShortDateString();
            var dateTo   = dateTimePickerdailytreatment2.Value.ToShortDateString();

            if (Convert.ToDateTime(dateFrom).Date > Convert.ToDateTime(dateTo).Date)
            {
                MessageBox.Show("From date should be less than to date", "From Date is grater ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                dateTimePickerdailytreatment2.Value = DateTime.Today;
                return;
            }
            DateTime now  = DateTime.Now;
            DateTime date = new DateTime(now.Year, now.Month, 1);

            dateTimePickerdailytreatment1.Value = date;
            string date1 = dateTimePickerdailytreatment1.Value.ToString("yyyy-MM-dd");
            string date2 = dateTimePickerdailytreatment2.Value.ToString("yyyy-MM-dd");

            chart_EXpanse.Location = new Point(10, 50);
            chart_EXpanse.Size     = new Size(1306, 378);
            foreach (var series in chart_EXpanse.Series)
            {
                series.Points.Clear();
            }
            Cmb_AccountName.Items.Add("All Accounts");
            Cmb_AccountName.ValueMember   = "0";
            Cmb_AccountName.DisplayMember = "All Accounts";
            DataTable doctor_rs = this.ctrlr.getdctrdtls();

            if (doctor_rs.Rows.Count > 0)
            {
                for (int i = 0; i < doctor_rs.Rows.Count; i++)
                {
                    Cmb_AccountName.Items.Add(doctor_rs.Rows[i]["name"].ToString());
                    Cmb_AccountName.ValueMember   = doctor_rs.Rows[i]["id"].ToString();
                    Cmb_AccountName.DisplayMember = doctor_rs.Rows[i]["name"].ToString();
                }
            }
            Cmb_AccountName.SelectedIndex = 0;
            fill_grid();
            if (Dgv_ChartExpanse.Rows.Count < 1)
            {
                int x = (panel3.Size.Width - Lab_Msg.Size.Width) / 2;
                Lab_Msg.Location = new Point(x, Lab_Msg.Location.Y);
                Lab_Msg.Show();
            }
            else
            {
                Lab_Msg.Hide();
            }
            Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.BackColor = Color.DimGray;
            Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            Dgv_ChartExpanse.ColumnHeadersDefaultCellStyle.Font      = new System.Drawing.Font("Sego UI", 8, FontStyle.Bold);
            Dgv_ChartExpanse.EnableHeadersVisualStyles = false;
            foreach (DataGridViewColumn cl in Dgv_ChartExpanse.Columns)
            {
                cl.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            Dgv_Expanse.ColumnHeadersDefaultCellStyle.BackColor = Color.DimGray;
            Dgv_Expanse.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            Dgv_Expanse.ColumnHeadersDefaultCellStyle.Font      = new System.Drawing.Font("Sego UI", 8, FontStyle.Bold);
            Dgv_Expanse.EnableHeadersVisualStyles             = false;
            Dgv_Expanse.Columns[6].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            Dgv_Expanse.Columns[5].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            Dgv_Expanse.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            Dgv_Expanse.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            Dgv_Expanse.Columns[7].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            Dgv_Expanse.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            foreach (DataGridViewColumn cl in Dgv_Expanse.Columns)
            {
                cl.SortMode = DataGridViewColumnSortMode.NotSortable;
                cl.Width    = 100;
            }
            comboflag = false;
        }