public ActionResult CreateMemberReceipt(FormCollection form)
        {
            var groupReceiptdto = ReadFormData(form);
            var resultDto       = new ResultDto();

            //var receiptDto = GetAccountHeadClosingBalnces();
            //ViewBag.CashInHandDetails = receiptDto;


            AccountHeadDto objAccountHead = _accountheadService.GetCashInHandAccount(false);
            int            ahId           = objAccountHead.AHID;

            //AccountHeadDto closeingBalance = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, false, groupId);

            // objAccountHead.ClosingBalance = closeingBalance.ClosingBalance;
            ViewBag.CashInHandDetails = objAccountHead;

            LoadDropDowns();
            if (groupReceiptdto.AccountMasterID == 0)
            {
                //resultDto = _memberReceiptService.Insert(groupReceiptdto);
                resultDto = _memberReceiptService.Insert(groupReceiptdto);
            }
            else
            {
                resultDto = _memberReceiptService.Update(groupReceiptdto);
            }
            ViewBag.Result = resultDto;
            return(View(groupReceiptdto));
        }
Esempio n. 2
0
        public List <AccountHeadDto> GetGroupAccountTree(int groupId)
        {
            List <AccountHeadDto> accountHeadlist = new List <AccountHeadDto>();
            AdoHelper             obj             = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[1];

            parms[0]           = new SqlParameter("@GroupID", groupId);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;

            SqlDataReader Dr = obj.ExecDataReaderProc("uspGetGroupAccountTree", parms);

            while (Dr.Read())
            {
                AccountHeadDto ahdto = new AccountHeadDto();
                ahdto.AHCode             = Dr["AHCode"] == DBNull.Value ? string.Empty : Convert.ToString(Dr["AHCode"]);
                ahdto.AHID               = Convert.ToInt32(Dr["AHID"]);
                ahdto.AHLevel            = Convert.ToInt32(Dr["AHLevel"]);
                ahdto.AHName             = Dr["AHName"] == DBNull.Value ? string.Empty : Convert.ToString(Dr["AHName"]);
                ahdto.AHType             = Dr["AHType"] == DBNull.Value ? 0: Convert.ToInt32(Dr["AHType"]);
                ahdto.OpeningBalanceType = Dr["OpeningBalanceType"] == DBNull.Value ? string.Empty : Convert.ToString(Dr["OpeningBalanceType"]);
                ahdto.ParentAHID         = Dr["ParentAHID"] == DBNull.Value ? 0 : Convert.ToInt32(Dr["ParentAHID"]);
                accountHeadlist.Add(ahdto);
            }
            return(accountHeadlist);
        }
Esempio n. 3
0
        public AccountHeadDto ViewBalance(int ahid, bool isFedaration)
        {
            AccountHeadDto viewBalance = new AccountHeadDto();
            AdoHelper      obj         = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[2];

            parms[0]           = new SqlParameter("@Ahid", ahid);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;
            parms[1]           = new SqlParameter("@IsFedaration", isFedaration);
            parms[1].SqlDbType = System.Data.SqlDbType.Bit;

            SqlDataReader Dr = obj.ExecDataReaderProc("uspAccountHeadViewBalance", parms);

            if (Dr.Read())
            {
                viewBalance.OpeningBalance       = Convert.ToDecimal(Dr["OpeningBalance"].ToString());
                viewBalance.ClosingBalance       = Convert.ToDecimal(Dr["ClosingBalance"].ToString());
                viewBalance.CurrentYearBalance   = Convert.ToDecimal(Dr["CurrentYearBalance"].ToString());
                viewBalance.CurrentYearBalanceDr = Convert.ToDecimal(Dr["CurrentYearBalanceDr"].ToString());
                viewBalance.CurrentYearBalanceCr = Convert.ToDecimal(Dr["CurrentYearBalanceCr"].ToString());
                viewBalance.OpeningBalanceType   = Dr["BalanceType"].ToString();
            }
            return(viewBalance);
        }
Esempio n. 4
0
        public bool UpdateOB(int ahid, int groupid, decimal balance)
        {
            AccountHeadDto viewBalance = new AccountHeadDto();
            AdoHelper      obj         = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[3];

            parms[0]           = new SqlParameter("@Ahid", ahid);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;
            parms[1]           = new SqlParameter("@Balance", balance);
            parms[1].SqlDbType = System.Data.SqlDbType.Decimal;
            parms[2]           = new SqlParameter("@GroupID", groupid);
            parms[2].SqlDbType = System.Data.SqlDbType.Int;

            int rowCount = obj.ExecNonQueryProc("uspGroupOBUpdate", parms);

            if (rowCount > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 5
0
        //public List<SelectListDto> GetAccountHeadJVSelectList()
        //{
        //    List<SelectListDto> lstSelectJvDto = new List<SelectListDto>();
        //    List<uspGetAccountHeadsForJV_Result> lstuspAccountHeadGetAll_Result = _dbContext.uspGetAccountHeadsForJV().ToList();
        //    foreach (var objuspGetAccountHeadsForJV_Result in lstuspAccountHeadGetAll_Result)
        //    {
        //        SelectListDto objSelectListDto = new SelectListDto()
        //        {
        //            ID = uspGetAccountHeadsForJV_Result.A,
        //            Text = uspGetAccountHeadsForJV_Result.AHName
        //        };
        //        lstSelectJvDto.Add(objSelectListDto);
        //    }
        //    return lstSelectJvDto;
        //}
        public ResultDto MoveAccountHead(AccountHeadDto accountHeadDto)
        {
            ResultDto resultDto = new ResultDto();

            try
            {
                resultDto.ObjectId = accountHeadDto.ParentAHID;
                int effectedCount = _dbContext.uspAccountHeadMove(accountHeadDto.AHIDS, accountHeadDto.ParentAHID, accountHeadDto.AHLevel, accountHeadDto.AHType, accountHeadDto.UserID);

                if (effectedCount > 0)
                {
                    resultDto.Message = "AccountHead details moved success fully";
                }
                else if (effectedCount == -1)
                {
                    resultDto.Message  = "Error occured while moved AccountHead";
                    resultDto.ObjectId = -1;
                }
                else
                {
                    resultDto.Message  = "Error occured while moved AccountHead details";
                    resultDto.ObjectId = -1;
                }
            }
            catch (Exception ex)
            {
                resultDto.Message  = "Service layer error occured while moved the AccountHead details";
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }
        public ActionResult AddEditSubGroupAccountHead(AccountHeadModel accountHeadModel, FormCollection form)
        {
            ResultDto result = new ResultDto();

            //if (ModelState.IsValid)
            //{
            accountHeadModel.UserID       = 1;
            accountHeadModel.StatusID     = 1;
            accountHeadModel.IsFederation = false;
            accountHeadModel.AHID         = accountHeadModel.EditAHID > 0 ? accountHeadModel.EditAHID : accountHeadModel.AHID;
            accountHeadModel.AHCode       = !string.IsNullOrEmpty(accountHeadModel.SubGroupAHCode)
                ? accountHeadModel.SubGroupAHCode
                : accountHeadModel.AHCode;
            accountHeadModel.AHName = !string.IsNullOrEmpty(accountHeadModel.SubGroupAHName)
                ? accountHeadModel.SubGroupAHName
                : accountHeadModel.AHName;
            AccountHeadDto accountHeadDto = AutoMapperEntityConfiguration.Cast <AccountHeadDto>(accountHeadModel);

            if (accountHeadModel.AHID > 0)
            {
                result = _accountHeadService.Update(accountHeadDto);
            }
            else
            {
                result = _accountHeadService.Insert(accountHeadDto);
            }
            //}

            TempData["SuccessMsg"] = result;
            return(RedirectToAction("AccountTree"));
        }
Esempio n. 7
0
        public ActionResult ViewBalanceSummary(int ahId, bool isGroup)
        {
            int            groupId        = GroupInfo.GroupID;
            AccountHeadDto accountHeadDto = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, isGroup, groupId);

            return(Json(new { ClosingBalance = accountHeadDto.ClosingBalance, BalanceType = accountHeadDto.BalanceType }));
        }
Esempio n. 8
0
        public string Insert(AccountHeadDto dto)
        {
            if (!menu.WriteAccess)
            {
                return(null);
            }

            return(_accountHeadService.Insert(dto));
        }
Esempio n. 9
0
        public JsonResult GetAHID(string Id)
        {
            string isfed        = Request.Form["isfederation"];
            bool   isFederation = Convert.ToBoolean(isfed);

            AccountHeadDto objAccountHead = _accountheadService.GetCashInHandAccount(isFederation);

            return(Json(new { AccountName = objAccountHead.AHName, AHID = objAccountHead.AHID, AHCode = objAccountHead.AHCode }));
        }
Esempio n. 10
0
        public async Task <string> Update(AccountHeadDto dto)
        {
            if (!menu.ModifyAccess)
            {
                return(null);
            }

            return(await _accountHeadService.Update(dto));
        }
Esempio n. 11
0
        //public ActionResult BindDropDowns(int parentAhid, int accountHeadLevel, string Id,bool isFederation)
        //{
        //    StringBuilder sbDropdownOptions = new StringBuilder();
        //    #region ddlEditSubGroup

        //    if (Id == "SubGroup")
        //    {
        //        StringBuilder sbAccountHeadOptions = new StringBuilder();
        //        StringBuilder sbSubGroupOptions = new StringBuilder();


        //        if (accountHeadLevel == 4)
        //        {
        //            var dropDownAccountHeadOptions = (from item in AccountHeadDtos
        //                                              where item.ParentAHID == parentAhid && item.IsFederation && item.AHLevel == 4
        //                                              select new { AHCode = item.AHID + "_" + item.AHCode, AhName = item.AHName }
        //                                );
        //            foreach (var dropDownOption in dropDownAccountHeadOptions)
        //            {
        //                sbSubGroupOptions.Append("<option value='" + dropDownOption.AHCode + "'>" + dropDownOption.AhName + "</option>");
        //            }
        //        }
        //        else
        //        {
        //            var dropDownSubGroupOptions = (from item in AccountHeadDtos
        //                                           where item.ParentAHID == parentAhid && item.IsFederation && item.AHLevel == 4
        //                                           select new { ParentAhid = item.AHID, AhName = item.AHName }
        //                                                );
        //            foreach (var dropDownOption in dropDownSubGroupOptions)
        //            {
        //                sbSubGroupOptions.Append("<option value='" + dropDownOption.ParentAhid + "'>" + dropDownOption.AhName + "</option>");
        //            }
        //        }


        //        if (accountHeadLevel == 5)
        //        {
        //            var dropDownAccountHeadOptions = (from item in AccountHeadDtos
        //                                              where item.ParentAHID == parentAhid && item.IsFederation && item.AHLevel == 5
        //                                              select new { AHCode = item.AHID + "_" + item.AHCode, AhName = item.AHName }
        //                                );
        //            foreach (var dropDownOption in dropDownAccountHeadOptions)
        //            {
        //                sbAccountHeadOptions.Append("<option value='" + dropDownOption.AHCode + "'>" + dropDownOption.AhName + "</option>");
        //            }
        //        }

        //        return Json(new { AccountHeadOptions = sbAccountHeadOptions != null ? sbAccountHeadOptions.ToString() : "", SubGroupOptions = sbSubGroupOptions != null ? sbSubGroupOptions.ToString() : "" });

        //    }
        //    #endregion ddlEditSubGroup
        //    else if (Id == "SearchAccountHead")
        //    {

        //        var dropDownAccountHeadOptions = (from item in AccountHeadDtos
        //                                          where item.ParentAHID == parentAhid && item.IsFederation && item.AHLevel == 5
        //                                          select new { AHCode = item.AHID + "_" + item.AHCode, AhName = item.AHName }
        //                                   );
        //        foreach (var dropDownOption in dropDownAccountHeadOptions)
        //        {
        //            sbDropdownOptions.Append("<option value='" + dropDownOption.AHCode + "'>" + dropDownOption.AhName + "</option>");
        //        }

        //        return Json(new { DropDownOptions = sbDropdownOptions.ToString() });

        //    }
        //    else if (Id == "MoveSubGroupAccountHead")
        //    {
        //        var subGroupFields = (from item in AccountHeadDtos
        //                              where item.ParentAHID == parentAhid && item.IsFederation && item.AHLevel == 4
        //                              select new { ParentAhid = item.AHID, AhName = item.AHName }
        //                            );

        //        var accountHeadFields = (from item in AccountHeadDtos
        //                                 where item.ParentAHID == parentAhid && item.IsFederation && item.AHLevel == 5
        //                                 select new { ParentAhid = item.AHID, AhName = item.AHName }
        //                            );

        //        return Json(new { SubGroupFields = subGroupFields, AccountHeadFields = accountHeadFields });

        //    }
        //    else if (Id == "ViewBalanceAccountHead")
        //    {
        //        var dropDownOptions = (from item in AccountHeadDtos
        //                               where item.IsFederation && item.AHLevel == accountHeadLevel
        //                               select new { ParentAhid = item.AHID, AhName = item.AHName }
        //                            );

        //        foreach (var dropDownOption in dropDownOptions)
        //        {
        //            sbDropdownOptions.Append("<option value='" + dropDownOption.ParentAhid + "'>" + dropDownOption.AhName + "</option>");
        //        }

        //        return Json(new { DropDownOptions = sbDropdownOptions.ToString() });
        //    }
        //    else
        //    {
        //        var dropDownOptions = (from item in AccountHeadDtos
        //                               where item.ParentAHID == parentAhid && item.IsFederation
        //                               select new { ParentAhid = item.AHID, AhName = item.AHName }
        //                            );
        //        foreach (var dropDownOption in dropDownOptions)
        //        {
        //            sbDropdownOptions.Append("<option value='" + dropDownOption.ParentAhid + "'>" + dropDownOption.AhName + "</option>");
        //        }

        //        return Json(new { DropDownOptions = sbDropdownOptions.ToString() });

        //    }

        //}

        public ActionResult MoveSubGroupOrAccountHead(AccountHeadModel accountHeadModel)
        {
            accountHeadModel.UserID     = 1;
            accountHeadModel.StatusID   = 1;
            accountHeadModel.ParentAHID = accountHeadModel.ParentMoveAHID;
            AccountHeadDto accountHeadDto = AutoMapperEntityConfiguration.Cast <AccountHeadDto>(accountHeadModel);

            _accountHeadService.MoveAccountHead(accountHeadDto);
            return(RedirectToAction("GroupAccountTree"));
        }
Esempio n. 12
0
        public ActionResult AddAccountHead()
        {
            if (!menu.WriteAccess)
            {
                return(RedirectToAction("Logout", "Account"));
            }

            var obj = new AccountHeadDto();

            return(View("AddModifyAccountHead", obj));
        }
Esempio n. 13
0
        public JsonResult GetSLAAccountHead(int id)
        {
            AccountHeadDto AccountDto = _accountHeadService.GetByID(id);

            return(Json(new
            {
                AccountHead = AccountDto.AHCode,
                AHID = AccountDto.AHID,
                AccountName = AccountDto.AHName
            }));
        }
Esempio n. 14
0
        public List <AccountHeadDto> GetAll(bool isFederation)
        {
            var lstAccountHeadDto = new List <AccountHeadDto>();
            var lstuspAccountHeadGetAll_Result = _dbContext.uspAccountHeadGetAll().ToList().FindAll(f => f.IsFederation == isFederation || f.AHLevel < 4);

            foreach (var AH in lstuspAccountHeadGetAll_Result)
            {
                AccountHeadDto accountHeadDto = Mapper.Map <uspAccountHeadGetAll_Result, AccountHeadDto>(AH);
                lstAccountHeadDto.Add(accountHeadDto);
            }
            return(lstAccountHeadDto);
        }
Esempio n. 15
0
        public JsonResult GetAccountName(int id)
        {
            StringBuilder        sbOptions      = new StringBuilder();
            AccountHeadDto       accountheaddto = _accountHeadService.GetByID(id);
            List <SelectListDto> lstslaccounts  = _accountHeadService.GetSlAccountsGetByParentAhID(id, GroupInfo.GroupID);

            foreach (var item in lstslaccounts)
            {
                sbOptions.Append("<option value=" + item.ID + ">" + item.Text + "</option>");
            }

            return(Json(new { AccountName = accountheaddto.AHName, SLAccounts = sbOptions.ToString() }));
        }
        public ActionResult MoveSubGroupOrAccountHead(AccountHeadModel accountHeadModel)
        {
            ResultDto result = new ResultDto();

            accountHeadModel.UserID     = 1;
            accountHeadModel.StatusID   = 1;
            accountHeadModel.ParentAHID = accountHeadModel.ParentMoveAHID;
            AccountHeadDto accountHeadDto = AutoMapperEntityConfiguration.Cast <AccountHeadDto>(accountHeadModel);

            result = _accountHeadService.MoveAccountHead(accountHeadDto);
            TempData["SuccessMsg"] = result;
            return(RedirectToAction("AccountTree"));
        }
Esempio n. 17
0
        public string Insert(AccountHeadDto dto)
        {
            string message = "";

            try
            {
                int result = _accountHeadRepository.Insert(dto.ToEntity());
                message = _messageClass.ShowSuccessMessage(result);
            }
            catch (SqlException ex)
            {
                message = _messageClass.ShowErrorMessage(string.Format("{0} ~ {1}", ex.Number.ToString(), ex.Message));
            }
            return(message);
        }
Esempio n. 18
0
        public List <AccountHeadDto> GetallAccountHeads()
        {
            List <AccountHeadDto> lstAccountHeadDto = new List <AccountHeadDto>();
            List <uspAccountHeadGetAll_Result> lstuspAccountHeadGetAll_Result = _dbContext.uspAccountHeadGetAll().ToList();

            foreach (var accountheads in lstuspAccountHeadGetAll_Result)
            {
                AccountHeadDto objaccounthead = new AccountHeadDto();
                objaccounthead.AHID         = accountheads.AHID;
                objaccounthead.AHName       = accountheads.AHName;
                objaccounthead.AHLevel      = accountheads.AHLevel;
                objaccounthead.IsFederation = accountheads.IsFederation;
                lstAccountHeadDto.Add(objaccounthead);
            }
            return(lstAccountHeadDto);
        }
Esempio n. 19
0
        public ResultDto AccountHeadInsertUpdate(AccountHeadDto accountHead)
        {
            ResultDto resultDto = new ResultDto();

            try
            {
                string         ahCode          = string.Empty;
                AccountHeadDll iAccountHeadDll = new AccountHeadDll();
                int            accountHeadId   = iAccountHeadDll.InsertUpdateAccountHead(accountHead, "ACCOUNT_TREE", accountHead.AHID, out ahCode);

                resultDto.ObjectId   = accountHeadId;
                resultDto.ObjectCode = ahCode;

                /*ObjectParameter paramAccountHeadId = new ObjectParameter("AHID", accountHead.AHID);
                 * ObjectParameter paramaccountHeadCode = new ObjectParameter("AHCode", accountHead.AHCode);
                 * _dbContext.uspAccountHeadInsertUpdate(paramAccountHeadId, paramaccountHeadCode, accountHead.AHName,
                 *  accountHead.TE_AHName, accountHead.AHType, accountHead.ParentAHID, accountHead.IsMemberTransaction,
                 *  accountHead.IsSLAccount, accountHead.OpeningBalance, accountHead.OpeningBalanceType,
                 *  accountHead.AHLevel, accountHead.IsFederation, accountHead.UserID);
                 *
                 * resultDto.ObjectId = (int)paramAccountHeadId.Value;
                 * resultDto.ObjectCode = (string)paramaccountHeadCode.Value;
                 *
                 * int accountHeadId = (int)paramAccountHeadId.Value;*/

                if (accountHeadId > 0)
                {
                    resultDto.Message = "AccountHead details saved success fully";
                }
                else if (accountHeadId == -1)
                {
                    resultDto.Message  = "Error occured while saving AccountHead details";
                    resultDto.ObjectId = -1;
                }
                else
                {
                    resultDto.Message  = "Error occured while saving AccountHead details";
                    resultDto.ObjectId = -1;
                }
            }
            catch (Exception ex)
            {
                resultDto.Message  = "Service layer error occured while saving the bank details";
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }
Esempio n. 20
0
        public static AccountHead ToEntity(this AccountHeadDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            return(new AccountHead
            {
                AccountHeadId = dto.AccountHeadId,
                AccountHeadName = dto.AccountHeadName,
                AccountHolderName = dto.AccountHolderName,
                AccountNumber = dto.AccountNumber,
                Address = dto.Address,
                Status = dto.Status,
            });
        }
Esempio n. 21
0
        public ActionResult AddEditSubGroupAccountHead(AccountHeadModel accountHeadModel, FormCollection form)
        {
            ResultDto result = new ResultDto();
            //if (ModelState.IsValid)
            //{
            bool isFederation = string.IsNullOrEmpty(form.Get("isFederation")) ? true : Convert.ToBoolean(form.Get("isFederation"));

            accountHeadModel.UserID       = 1;
            accountHeadModel.StatusID     = 1;
            accountHeadModel.IsFederation = isFederation;
            accountHeadModel.AHID         = accountHeadModel.EditAHID > 0 ? accountHeadModel.EditAHID : accountHeadModel.AHID;
            accountHeadModel.AHCode       = !string.IsNullOrEmpty(accountHeadModel.SubGroupAHCode)
                ? accountHeadModel.SubGroupAHCode
                : accountHeadModel.AHCode;
            accountHeadModel.AHName = !string.IsNullOrEmpty(accountHeadModel.SubGroupAHName)
                ? accountHeadModel.SubGroupAHName
                : accountHeadModel.AHName;
            accountHeadModel.TE_AHName = !string.IsNullOrEmpty(accountHeadModel.SubGroupTEAHName)
                ? accountHeadModel.SubGroupTEAHName
                : accountHeadModel.TE_AHName;
            AccountHeadDto accountHeadDto = AutoMapperEntityConfiguration.Cast <AccountHeadDto>(accountHeadModel);

            if (accountHeadModel.AHID > 0)
            {
                result = _accountHeadService.Update(accountHeadDto);
            }
            else
            {
                result = _accountHeadService.Insert(accountHeadDto);
            }
            //}
            ViewBag.IsFederation   = isFederation;
            TempData["SuccessMsg"] = result;
            if (isFederation)
            {
                return(RedirectToAction("AccountTree"));
            }
            else
            {
                return(RedirectToAction("GroupAccountTree"));
            }
        }
Esempio n. 22
0
        public ActionResult CreateContraEntryCashWithdrawl(FormCollection form)
        {
            var contraEntryWithDrawlDto = ReadFormDataWithDrawl(form);
            var resultDto = new ResultDto();

            if (contraEntryWithDrawlDto.AccountMasterID == 0)
            {
                resultDto = _ContraEntryService.GroupInsertContraEntryWithDrawl(contraEntryWithDrawlDto);
            }
            else
            {
                resultDto = _ContraEntryService.GroupUpdateContraEntryWithDrawl(contraEntryWithDrawlDto);
            }

            if (resultDto.ObjectId > 0)
            {
                resultDto.ObjectCode = contraEntryWithDrawlDto.VoucherNumber;
            }
            ViewBag.Result = resultDto;

            int groupId = GroupInfo.GroupID;
            BankMasterViewDto        objBank     = new BankMasterViewDto();
            List <BankMasterViewDto> lstAllBanks = _ContraEntryService.GetAllGroupBanksByGroupId(groupId);
            SelectList lstgroupBanks             = new SelectList(lstAllBanks, "AHID", "AccountNumber", objBank.BankEntryID);

            ViewBag.GroupBanks = lstgroupBanks;

            AccountHeadDto objAccountHead  = _accountheadService.GetCashInHandAccount(false);
            int            ahId            = objAccountHead.AHID;
            AccountHeadDto closeingBalance = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, false, groupId);

            objAccountHead.ClosingBalance = closeingBalance.ClosingBalance;
            ViewBag.CashInHandDetails     = objAccountHead;

            contraEntryWithDrawlDto = _ContraEntryService.GroupContraEntryWithDrawlGetByAccountMasterId(resultDto.ObjectId);

            var totalCrAmmount = contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Count() < 1 ? 0 : contraEntryWithDrawlDto.contraEntryWithDrawlTransactions[contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Count() - 1].CrAmount;

            ViewBag.TotalCrAmmount = totalCrAmmount;

            return(View(contraEntryWithDrawlDto));
        }
        public ActionResult ViewGeneralPayments(string Id)
        {
            long AccountMasterId      = string.IsNullOrEmpty(Id.DecryptString()) ? default(int) : Convert.ToInt64(Id.DecryptString());
            GeneralPaymentsDto objDto = new GeneralPaymentsDto();

            if (AccountMasterId > 0)
            {
                objDto = _generalpaymentsService.GetByViewID(AccountMasterId);
                if (objDto.Addamount.Count > 0)
                {
                    List <AddAmountDto> lstAccounts = new List <AddAmountDto>();

                    var list = objDto.Addamount;
                    foreach (var i in list)
                    {
                        AddAmountDto   Addamountdto   = new AddAmountDto();
                        int            ahId           = i.AHID;
                        bool           isFederation   = true;
                        AccountHeadDto accountHeadDto = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, isFederation);
                        if (accountHeadDto.ClosingBalance != 0)
                        {
                            Decimal ClosingBalance = accountHeadDto.ClosingBalance - i.DrAmount;
                            Addamountdto.Balance = ClosingBalance;
                        }
                        Addamountdto.AHID     = i.AHID;
                        Addamountdto.AHCode   = i.AHCode;
                        Addamountdto.AHName   = i.AHName;
                        Addamountdto.CrAmount = i.CrAmount;
                        Addamountdto.DrAmount = i.DrAmount;
                        lstAccounts.Add(Addamountdto);
                    }
                    objDto.Addamount = lstAccounts;
                }
            }
            int         EmployeeID  = UserInfo.UserID;
            EmployeeDto ObjEmployee = _employeeService.GetByID(EmployeeID);

            objDto.EmployeeCode = ObjEmployee.EmployeeCode;
            objDto.EmployeeName = ObjEmployee.EmployeeName;
            return(View(objDto));
            //return View();
        }
Esempio n. 24
0
        public ActionResult CreateContraEntryDeposited(string id)
        {
            long AccountMasterID = string.IsNullOrEmpty(id.DecryptString()) ? default(long) : Convert.ToInt32(id.DecryptString());
            ContraEntryDepositedDto contraEntryDepositedDto = new ContraEntryDepositedDto();

            if (AccountMasterID > 0)
            {
                contraEntryDepositedDto = _ContraEntryService.FederationContraEntryDepositedGetByAccountMasterId(AccountMasterID);
            }

            BankMasterViewDto objBank = new BankMasterViewDto();

            List <BankMasterViewDto> lstAllBanks = _ContraEntryService.GetAllOrganizationBanks();
            SelectList lstBanks = new SelectList(lstAllBanks, "AHID", "AccountNumber", objBank.BankEntryID);

            ViewBag.AllBanks = lstBanks;


            AccountHeadDto objAccountHead  = _accountheadService.GetCashInHandAccount(true);
            int            ahId            = objAccountHead.AHID;
            AccountHeadDto closeingBalance = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, true);

            objAccountHead.ClosingBalance = closeingBalance.ClosingBalance;
            ViewBag.CashInHandDetails     = objAccountHead;

            int EmployeeID = UserInfo.UserID;

            contraEntryDepositedDto.UserID = UserInfo.UserID;
            EmployeeDto obj = _employeeService.GetByID(EmployeeID);

            contraEntryDepositedDto.EmployeeName = obj.EmployeeName;
            contraEntryDepositedDto.EmployeeCode = obj.EmployeeCode;

            if (contraEntryDepositedDto.contraEntryDepositedTransactions != null && contraEntryDepositedDto.contraEntryDepositedTransactions.Count > 0)
            {
                var totalCrAmmount = contraEntryDepositedDto.contraEntryDepositedTransactions[contraEntryDepositedDto.contraEntryDepositedTransactions.Count() - 1].CrAmount;
                ViewBag.TotalCrAmmount = totalCrAmmount;
            }

            return(View(contraEntryDepositedDto));
        }
Esempio n. 25
0
        public AccountHeadDto GetOB(int ahid, int groupid)
        {
            AccountHeadDto viewBalance = new AccountHeadDto();
            AdoHelper      obj         = new AdoHelper();

            SqlParameter[] parms = new SqlParameter[2];

            parms[0]           = new SqlParameter("@Ahid", ahid);
            parms[0].SqlDbType = System.Data.SqlDbType.Int;
            parms[1]           = new SqlParameter("@GroupID", groupid);
            parms[1].SqlDbType = System.Data.SqlDbType.Int;

            SqlDataReader Dr = obj.ExecDataReaderProc("uspGroupOBGet", parms);

            if (Dr.Read())
            {
                viewBalance.OpeningBalance     = Convert.ToDecimal(Dr["OpeningBalance"].ToString());
                viewBalance.OpeningBalanceType = Dr["OpeningBalanceType"].ToString();
            }
            return(viewBalance);
        }
        public ActionResult GetReceiptTemplate(int memberid, string transactiondate)
        {
            ReceiptDll objDll = new ReceiptDll();
            List <ReceiptTranscationDto> lstreceiptsHeads = objDll.GetMemberReceiptAccountdetails(memberid, transactiondate);

            ReceiptMasterDto objreceipt = new ReceiptMasterDto();

            objreceipt.lstGroupReceiptTranscationDto = lstreceiptsHeads;
            if (memberid > 0)
            {
                List <RepaymentDto> list = new List <RepaymentDto>();
                list = _repaymentService.GetRepayment(memberid, transactiondate);
                objreceipt.lstRepeyment = list;
            }
            List <ReceiptTranscationDto> lstDto = new List <ReceiptTranscationDto>();

            AccountHeadDto objAccountHead = _accountheadService.GetCashInHandAccount(false);

            ViewBag.CashInHandDetails = objAccountHead;

            return(View("_ReceiptTemplate", objreceipt));
        }
Esempio n. 27
0
        public ActionResult MoveSubGroupOrAccountHead(AccountHeadModel accountHeadModel)
        {
            bool      isFederation = string.IsNullOrEmpty(Request.Form.Get("isFederation")) ? true : Convert.ToBoolean(Request.Form.Get("isFederation"));
            ResultDto result       = new ResultDto();

            accountHeadModel.UserID     = 1;
            accountHeadModel.StatusID   = 1;
            accountHeadModel.ParentAHID = accountHeadModel.ParentMoveAHID;
            AccountHeadDto accountHeadDto = AutoMapperEntityConfiguration.Cast <AccountHeadDto>(accountHeadModel);

            result = _accountHeadService.MoveAccountHead(accountHeadDto);
            ViewBag.IsFederation   = isFederation;
            TempData["SuccessMsg"] = result;
            if (isFederation)
            {
                return(RedirectToAction("AccountTree"));
            }
            else
            {
                return(RedirectToAction("GroupAccountTree"));
            }
        }
Esempio n. 28
0
        public async Task <string> Update(AccountHeadDto dto)
        {
            string message = "";

            try
            {
                var accountHead = await GetAccountHeadById(dto.AccountHeadId);

                if (accountHead is null)
                {
                    return(null);
                }

                int result = _accountHeadRepository.Update(dto.ToEntity());
                message = _messageClass.ShowSuccessMessage(result);
            }
            catch (SqlException ex)
            {
                message = _messageClass.ShowErrorMessage(string.Format("{0} ~ {1}", ex.Number.ToString(), ex.Message));
            }
            return(message);
        }
Esempio n. 29
0
        public ActionResult CreateContraEntryDeposited(FormCollection form)
        {
            var contraEntryDepositedDto = ReadFormDataDeposited(form);
            var resultDto = new ResultDto();

            if (contraEntryDepositedDto.AccountMasterID == 0)
            {
                resultDto = _ContraEntryService.FederationInsertContraEntryDeposit(contraEntryDepositedDto);
            }
            else
            {
                resultDto = _ContraEntryService.FederationUpdateContraEntryDeposited(contraEntryDepositedDto);
            }

            if (resultDto.ObjectId > 0)
            {
                resultDto.ObjectCode = contraEntryDepositedDto.VoucherNumber;
            }
            ViewBag.Result = resultDto;
            BankMasterViewDto        objBank     = new BankMasterViewDto();
            List <BankMasterViewDto> lstAllBanks = _ContraEntryService.GetAllOrganizationBanks();
            SelectList lstBanks = new SelectList(lstAllBanks, "AHID", "AccountNumber", objBank.BankEntryID);

            ViewBag.AllBanks = lstBanks;

            AccountHeadDto objAccountHead  = _accountheadService.GetCashInHandAccount(true);
            int            ahId            = objAccountHead.AHID;
            AccountHeadDto closeingBalance = _accountheadService.GetAccountHeadViewBalanceSummary(ahId, true);

            objAccountHead.ClosingBalance = closeingBalance.ClosingBalance;
            ViewBag.CashInHandDetails     = objAccountHead;
            contraEntryDepositedDto       = _ContraEntryService.FederationContraEntryDepositedGetByAccountMasterId(resultDto.ObjectId);

            var totalCrAmmount = contraEntryDepositedDto.contraEntryDepositedTransactions[contraEntryDepositedDto.contraEntryDepositedTransactions.Count() - 1].CrAmount;

            ViewBag.TotalCrAmmount = totalCrAmmount;

            return(View(contraEntryDepositedDto));
        }
Esempio n. 30
0
        public List <AccountHeadDto> GetReceiptSavingAccountHeads(bool isFederation)
        {
            List <AccountHeadDto> lstSavingHeads = new List <AccountHeadDto>();
            List <AccountHead>    lstHeads       = new List <AccountHead>();
            RefMaster             rm             = _dbContext.RefMasters.ToList().Find(r => r.RefMasterCode.ToUpper() == "AHTYPE");
            RefValueMaster        rvm            = _dbContext.RefValueMasters.ToList().Find(f => f.RefMasterID == rm.RefMasterID && f.RefCode.ToUpper() == "LIABILITIES");
            var liabilities = _dbContext.AccountHeads.ToList().FindAll(f => f.AHType == rvm.RefID);
            var savings     = liabilities.Find(l => l.AHCode.ToUpper() == "DEPOSITS");
            var result      = from l2 in liabilities
                              from l3 in liabilities
                              from l4 in liabilities
                              where l2.AHID == l3.ParentAHID && l3.AHID == l4.ParentAHID &&
                              l4.AHLevel == 5
                              select l4;

            var result2 = from l2 in liabilities
                          from l3 in liabilities
                          from l4 in liabilities
                          from l5 in liabilities
                          where l2.AHID == l3.ParentAHID && l3.AHID == l4.ParentAHID && l4.AHID == l5.ParentAHID &&
                          l5.AHLevel == 5
                          select l5;

            lstHeads.AddRange(result);
            lstHeads.AddRange(result2);

            foreach (var item in lstHeads)
            {
                AccountHeadDto dto = new AccountHeadDto()
                {
                    AHID = item.AHID, AHCode = item.AHCode, AHName = item.AHName
                };
                lstSavingHeads.Add(dto);
            }

            return(lstSavingHeads);
        }