Exemple #1
0
        private void lst_dailydet_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (lst_dailydet.SelectedItems.Count > 0)
                {
                    DailyPumperTotal tot = (DailyPumperTotal)lst_dailydet.SelectedItems[0].Tag;
                    if (tot != null)
                    {
                        lbl_totalValss.Text = tot.Total.ToString();
                        lbl_saletype.Text   = tot.SaleType;

                        var dets = CustomeRepository.GetGetCollectionFOrDay_Pumper_SaleType(tot.DayID, tot.PumperId, tot.SaleId, commonFunctions.ToInt(cmb_sessions.SelectedValue.ToString()));
                        if (dets != null)
                        {
                            dgmain.AutoGenerateColumns = false;
                            dgmain.DataSource          = dets.Breaks;
                        }
                        //lbl_cash.Text = dets.CashTotal.ToString();
                        //lbl_card.Text = dets.CardTotal.ToString();
                        //lbl_Voucher.Text = dets.VoucherTotal.ToString();
                        //lbl_expense.Text = dets.Expenses.ToString();
                        //lbl_othertotal.Text = dets.Other.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Has found in program. Please forword following details to technical" + Environment.NewLine + "[" + ex.Message + Environment.NewLine + ex.Source + "]", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void btn_show_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmb_days.SelectedValue == null)
                {
                    MessageBox.Show("Please select a day to continue", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                if (cmb_pumper.SelectedValue == null)
                {
                    MessageBox.Show("Please select a Pumper to continue", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                if (cmb_sessions.SelectedValue == null)
                {
                    MessageBox.Show("Please select a session to continue", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                lbl_card.Text       = "0.00";
                lbl_cash.Text       = "0.00";
                lbl_Voucher.Text    = "0.00";
                lbl_expense.Text    = "0.00";
                lbl_totalValss.Text = "0.00";

                GetNozzelsForPumperOnGivenDay();
                List <DailyPumperTotal> tovals = CustomeRepository.GetDailyPumperTotal(
                    commonFunctions.ToInt(cmb_days.SelectedValue.ToString()),
                    commonFunctions.ToInt(cmb_pumper.SelectedValue.ToString()),
                    commonFunctions.ToInt(cmb_sessions.SelectedValue.ToString())).ToList();
                if (tovals != null)
                {
                    LoadListView(tovals);
                }

                decimal totalCollection = 0;
                foreach (var item in tovals)
                {
                    totalCollection += item.Total;
                }
                lbl_totalCollection.Text = totalCollection.ToString();

                TwoKeyNumer SystemTotal = CustomeRepository.GetSystemTotalForPumperForDay(
                    commonFunctions.ToInt(cmb_days.SelectedValue.ToString()),
                    commonFunctions.ToInt(cmb_pumper.SelectedValue.ToString()),
                    commonFunctions.ToInt(cmb_sessions.SelectedValue.ToString())
                    );
                if (SystemTotal != null)
                {
                    lbl_systemtotal.Text = SystemTotal.Value.ToString();
                }
                else
                {
                    lbl_systemtotal.Text = "0.00";
                }

                var dets = CustomeRepository.GetGetCollectionFOrDay_Pumper_SaleType(
                    commonFunctions.ToInt(cmb_days.SelectedValue.ToString()),
                    commonFunctions.ToInt(cmb_pumper.SelectedValue.ToString()),
                    1,
                    commonFunctions.ToInt(cmb_sessions.SelectedValue.ToString())
                    );
                if (dets != null)
                {
                    lbl_cash.Text       = dets.CashTotal.ToString();
                    lbl_card.Text       = dets.CardTotal.ToString();
                    lbl_Voucher.Text    = dets.VoucherTotal.ToString();
                    lbl_expense.Text    = dets.Expenses.ToString();
                    lbl_othertotal.Text = dets.Other.ToString();
                }

                RunGetDiff();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Has found in program. Please forword following details to technical" + Environment.NewLine + "[" + ex.Message + Environment.NewLine + ex.Source + "]", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }