Esempio n. 1
0
        public static int AddTombStonesPayment(TombStonesPaymentModel model)
        {
            decimal amountPaid = model.AmountPaid.ToString().Contains(",") == true?Convert.ToDecimal((model.AmountPaid / 100).ToString().Replace(",", ".")) : model.AmountPaid;

            DbParameter[] ObjParam = new DbParameter[9];
            ObjParam[0] = new DbParameter("@InvoiceID", DbParameter.DbType.Int, 0, model.InvoiceID);     //pIntFnrlID
            ObjParam[1] = new DbParameter("@TombstoneID", DbParameter.DbType.Int, 0, model.TombstoneID); //pIntFnrlID
            // ObjParam[2] = new DbParameter("@DatePaid", DbParameter.DbType.DateTime, 0, model.DatePaid);//pIntFnrlID
            ObjParam[2] = new DbParameter("@AmountPaid", DbParameter.DbType.Decimal, 0, amountPaid);
            ObjParam[3] = new DbParameter("@RecievedBy", DbParameter.DbType.VarChar, 0, model.RecievedBy);
            ObjParam[4] = new DbParameter("@PaidBy", DbParameter.DbType.VarChar, 0, model.PaidBy);
            ObjParam[5] = new DbParameter("@Notes", DbParameter.DbType.VarChar, 0, model.Notes);
            ObjParam[6] = new DbParameter("@parlourid", DbParameter.DbType.UniqueIdentifier, 0, model.parlourid);
            ObjParam[7] = new DbParameter("@ModifiedUser", DbParameter.DbType.VarChar, 0, model.ModifiedUser);
            ObjParam[8] = new DbParameter("@MemberBranch", DbParameter.DbType.VarChar, 0, model.MemberBranch);


            return(Convert.ToInt32(DbConnection.GetScalarValue(CommandType.StoredProcedure, "TombStonesPaymentSave", ObjParam)));
        }
Esempio n. 2
0
 public static int AddInvoice(TombStonesPaymentModel model)
 {
     return(TombStonesPaymentDAL.AddTombStonesPayment(model));
 }
Esempio n. 3
0
 public int TombStonesPaymentSave(TombStonesPaymentModel model)
 {
     return(TombStonesPaymentBAL.AddInvoice(model));
 }
Esempio n. 4
0
        protected void btnPay_Click(object sender, EventArgs e)
        {
            try
            {
                Int32  intMethod = 0;
                string strMethod = "";
                //wsSMS.API SMS = new wsSMS.API();

                string strMsg = string.Empty;
                if (string.IsNullOrEmpty(txtAmount.Text))
                {
                    Common.WebMsgBox.Show("Enter positive amount value..");
                    txtAmount.Focus();
                    return;
                }

                if (string.IsNullOrEmpty(txtReceivedBy.Text))
                {
                    Common.WebMsgBox.Show("Must enter received by.");
                    txtReceivedBy.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(txtMohthPaid.Text))
                {
                    Common.WebMsgBox.Show("Must enter month paid.");
                    txtMohthPaid.Focus();
                    return;
                }
                if (btnPay.Text != "Add Reversal")
                {
                    txtMohthPaid.Text = ddlMethod.SelectedItem.Text + " - " + txtMohthPaid.Text;
                }

                intMethod = Strings.InStr(txtMohthPaid.Text, "Cash", CompareMethod.Text);
                strMethod = ddlMethod.SelectedItem.Text;


                if (btnPay.Text == "Add Payment")
                {
                    TombStonesPaymentModel tombstonePayment = new TombStonesPaymentModel();
                    //tombstonePayment.DatePaid = Convert.ToDateTime(txtNextPaymentDate.Text);
                    tombstonePayment.InvoiceID    = 0;
                    tombstonePayment.TombstoneID  = this.TombstoneId;
                    tombstonePayment.AmountPaid   = Convert.ToDecimal(txtAmount.Text.Replace("R ", ""));
                    tombstonePayment.RecievedBy   = txtReceivedBy.Text.ToString();
                    tombstonePayment.PaidBy       = txtReceivedBy.Text.ToString();
                    tombstonePayment.MemberBranch = string.Empty;
                    tombstonePayment.Notes        = txtMohthPaid.Text.ToString();
                    tombstonePayment.parlourid    = ParlourId;
                    tombstonePayment.ModifiedUser = HttpContext.Current.User.Identity.Name;
                    int FuneralID = client.TombStonesPaymentSave(tombstonePayment);
                    if (FuneralID != 0)
                    {
                        Common.WebMsgBox.Show("Payment added successfully.");
                        btnPrint.Enabled = true;
                    }
                    else
                    {
                        Common.WebMsgBox.Show("Payment failes to save.");
                    }
                }
                else
                {
                    //CheckUserAccess - Remain.
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "goToTab5", "confirm('You are about to make a REVERSAL PAYMENT. Continue?')", true);
                    if (Interaction.MsgBox("You are about to make a REVERSAL PAYMENT. Continue?", MsgBoxStyle.YesNo) == MsgBoxResult.Yes)
                    {
                        TombStonesPaymentModel objTomstonePayemnt = new TombStonesPaymentModel();
                        //tombstonePayment.DatePaid = Convert.ToDateTime(txtNextPaymentDate.Text);
                        objTomstonePayemnt.TombstoneID  = TombstoneId;
                        objTomstonePayemnt.AmountPaid   = Convert.ToDecimal(txtAmount.Text.Replace("R ", ""));
                        objTomstonePayemnt.RecievedBy   = txtReceivedBy.Text.ToString();
                        objTomstonePayemnt.Notes        = txtMohthPaid.Text.ToString();
                        objTomstonePayemnt.PaidBy       = txtReceivedBy.Text.ToString();
                        objTomstonePayemnt.MemberBranch = string.Empty;
                        objTomstonePayemnt.parlourid    = ParlourId;
                        objTomstonePayemnt.ModifiedUser = HttpContext.Current.User.Identity.Name;
                        int FuneralID = client.TombStonesPaymentSave(objTomstonePayemnt);
                    }
                    else
                    {
                        Interaction.MsgBox("Reversal not added successfully", MsgBoxStyle.Information);
                    }
                }

                bindInvoices();
                txtAmount.Text    = "";
                hdnAmount.Value   = "";
                txtMohthPaid.Text = "";

                ddlMethod.Enabled = true;
            }
            catch (Exception ex)
            {
                Common.WebMsgBox.Show(ex.Message);
            }
        }