public bool InsertBankWithdrawalForPettyCash(BankWithdrawalChequeVoucher model)
        {
            try
            {
                int status = 0;
                using (SqlConnection connection = DataAccess.CreateConnection())
                {
                    SqlCommand command = DataAccess.CreateCommand(connection);

                    DataAccess.CreateStoredprocedure(command, "InsertBankWithdrawalForPettyCash_SP");
                    DataAccess.AddInParameter(command, "@Amount", SqlDbType.Float, model.Amount);
                    DataAccess.AddInParameter(command, "@Notes", SqlDbType.VarChar, model.Notes);
                    DataAccess.AddInParameter(command, "@UserId", SqlDbType.VarChar, model.UserID);
                    DataAccess.AddInParameter(command, "@BankAccountId", SqlDbType.Int, model.BankAccountId);
                    DataAccess.AddInParameter(command, "@BankLedgerHeadId", SqlDbType.Int, model.BankLedgerHeadId);
                    DataAccess.AddInParameter(command, "@LedgerDate", SqlDbType.VarChar, model.LedgerDate);
                    status = DataAccess.ExecuteNonQuery(command);
                    return(status < 0 ? false : true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        public ActionResult PettyCashWithdrawal(BankWithdrawalViewModel model)
        {
            bool status = false;

            if (!ModelState.IsValid)
            {
                return(RedirectToAction("PettyCashWithdrawal", "Banks"));
            }
            if (model == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            else
            {
                BankWithdrawalChequeVoucher Obj = new BankWithdrawalChequeVoucher();
                Obj.Amount           = model.Amount;
                Obj.Notes            = model.Notes;
                Obj.BankAccountId    = model.BankAccountId;
                Obj.UserID           = User.Identity.GetUserId();
                Obj.BankAccountId    = model.BankAccountId;
                Obj.BankLedgerHeadId = model.BankAccountLedgerHeadId;
                Obj.BankId           = (int)model.BankNames;
                Obj.LedgerDate       = model.LedgerDate;
                status = new BankDA().InsertBankWithdrawalForPettyCash(Obj);
            }
            return(RedirectToAction("PettyCashWithdrawal", "Banks"));
        }