Ejemplo n.º 1
0
        private void AddorReduceCash(bool isadd)
        {
            decimal valuesaved = decimal.Zero;

            if (isadd)
            {
                valuesaved = num_cashtotal.Value;
            }
            else
            {
                valuesaved = -1 * num_cashtotal.Value;
            }
            CustomeRepository.InsertCollectionBreakdown(
                valuesaved,
                commonFunctions.ToInt(cmb_days.SelectedValue.ToString()),
                commonFunctions.ToInt(cmb_pumperForcashcol.SelectedValue.ToString()), 0,
                1,
                1, //sales type,
                txt_creditcardNo.Text,
                txt_voucherNo.Text.Trim(),
                commonFunctions.ToInt(cmb_bank.SelectedValue.ToString()),
                1,
                0, commonFunctions.ToInt(cmb_sessions.SelectedValue.ToString())
                );


            GetTotalForPumperForGivenDay(commonFunctions.ToInt(lbl_salesID.Text.ToString()));

            LogRepository.Log("Cash Collection Manual Change To : " + lbl_currentCashTot.Text.ToString(), LogType.Log, commonFunctions.LoginuserID);
        }
Ejemplo n.º 2
0
        private void btn_savecashDet_Click(object sender, EventArgs e)
        {
            try
            {
                if (num_amount.Value <= 0)
                {
                    return;
                }

                if (MessageBox.Show("Do you want to Save this record?", Messaging.MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    int vehicleid = 1;
                    switch (glosaletypeid)
                    {
                    case 2:
                        vehicleid = 1;
                        break;

                    case 3:
                        if (cmb_Vehicles.SelectedValue == null)
                        {
                            MessageBox.Show("Please select vehicle from the list", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            vehicleid = commonFunctions.ToInt(cmb_Vehicles.SelectedValue.ToString());
                        }
                        break;

                    default:
                        vehicleid = 1;
                        break;
                    }

                    int x = CustomeRepository.InsertCollectionBreakdown(
                        num_amount.Value,
                        commonFunctions.ToInt(cmb_days.SelectedValue.ToString()),
                        commonFunctions.ToInt(cmb_pumperForcashcol.SelectedValue.ToString()), 0,
                        vehicleid,
                        commonFunctions.ToInt(lbl_salesID.Text.ToString()),
                        txt_creditcardNo.Text,
                        txt_voucherNo.Text.Trim(),
                        commonFunctions.ToInt(cmb_bank.SelectedValue.ToString()),
                        1,
                        0, commonFunctions.ToInt(cmb_sessions.SelectedValue.ToString())
                        );


                    GetTotalForPumperForGivenDay(commonFunctions.ToInt(lbl_salesID.Text.ToString()));

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