private ResultDto FederationInsertUpdateContraEntryWithDrawl(ContraEntryWithDrawlDto contraEntryWithDrawlDto)
        {
            ResultDto resultDto  = new ResultDto();
            string    objectName = "ContraEntryWithDrawl";

            try
            {
                string contraEntryTransactionsxml = CommonMethods.SerializeListDto <List <ContraEntryWithDrawlTransactionsDto> >(contraEntryWithDrawlDto.contraEntryWithDrawlTransactions);

                ObjectParameter paramaccounmasterID = new ObjectParameter("AccountMasterID", contraEntryWithDrawlDto.AccountMasterID);
                ObjectParameter paramreCEWCode;
                if (contraEntryWithDrawlDto.VoucherNumber == "")
                {
                    paramreCEWCode = new ObjectParameter("VoucherNumber", string.Empty);
                }
                else
                {
                    paramreCEWCode = new ObjectParameter("VoucherNumber", contraEntryWithDrawlDto.VoucherNumber);
                }

                _dbContext.uspFederationContraEntryWithDrawlInsertUpdate(paramaccounmasterID, contraEntryWithDrawlDto.TransactionDate, paramreCEWCode, contraEntryWithDrawlDto.VoucherRefNumber, contraEntryWithDrawlDto.CodeSno, contraEntryWithDrawlDto.PartyName, contraEntryWithDrawlDto.EmployeeID,
                                                                         contraEntryWithDrawlDto.AHID, contraEntryWithDrawlDto.SubHeadID, contraEntryWithDrawlDto.TransactionType, contraEntryWithDrawlDto.Amount, contraEntryWithDrawlDto.TransactionMode,
                                                                         contraEntryWithDrawlDto.ChequeNumber, contraEntryWithDrawlDto.ChequeDate, contraEntryWithDrawlDto.BankAccount, contraEntryWithDrawlDto.Narration, contraEntryTransactionsxml, contraEntryWithDrawlDto.IsGroup, contraEntryWithDrawlDto.UserID);

                resultDto.ObjectId   = Convert.ToInt32(paramaccounmasterID.Value);     //(int) contraEntryWithDrawlDto.AccountMasterID;
                resultDto.ObjectCode = string.IsNullOrEmpty((string)paramreCEWCode.Value) ? contraEntryWithDrawlDto.VoucherNumber : (string)paramreCEWCode.Value;

                if (resultDto.ObjectId > 0)
                {
                    resultDto.Message = string.Format("{0} details saved successfully with code : {1}", objectName, resultDto.ObjectCode);
                }
                else if (resultDto.ObjectId == -1)
                {
                    resultDto.Message = string.Format("Error occured while generating {0} code", objectName);
                }
                else
                {
                    resultDto.Message = string.Format("Error occured while saving {0} details", objectName);
                }
            }
            catch (Exception)
            {
                resultDto.Message  = string.Format("Service layer error occured while saving the {0} details", objectName);
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }
Beispiel #2
0
        private ContraEntryWithDrawlDto ReadFormDataWithDrawl(FormCollection form)
        {
            ContraEntryWithDrawlDto contraEntryWithDrawlDto = new ContraEntryWithDrawlDto();

            contraEntryWithDrawlDto.AccountMasterID = Convert.ToInt32(form["hdnAccountMasterID"]);
            contraEntryWithDrawlDto.EmployeeID      = UserInfo.UserID;
            DateTime transactionDate = form["TransactionDate"].ConvertToDateTime();
            DateTime chequeDate      = form["ChequeDate"].ConvertToDateTime();

            contraEntryWithDrawlDto.TransactionDate  = transactionDate;
            contraEntryWithDrawlDto.VoucherNumber    = Convert.ToString(form["hdnVoucherNumber"]);
            contraEntryWithDrawlDto.VoucherRefNumber = Convert.ToString(form["VoucherRefNumber"]);
            contraEntryWithDrawlDto.PartyName        = Convert.ToString(form["PartyName"]);
            contraEntryWithDrawlDto.TransactionMode  = "C";
            contraEntryWithDrawlDto.AHID             = Convert.ToInt32(form["hdnCashInHandAHID"]);
            contraEntryWithDrawlDto.EmployeeID       = UserInfo.UserID;
            contraEntryWithDrawlDto.TransactionType  = Convert.ToInt32(form["TransactionType"]);
            contraEntryWithDrawlDto.Amount           = Convert.ToInt32(form["TotalAmmount"]);
            contraEntryWithDrawlDto.ChequeNumber     = Convert.ToString(form["ChequeNumber"]);
            contraEntryWithDrawlDto.ChequeDate       = chequeDate;
            contraEntryWithDrawlDto.Narration        = Convert.ToString(form["Narration"]);
            contraEntryWithDrawlDto.UserID           = UserInfo.UserID;
            contraEntryWithDrawlDto.GroupID          = GroupInfo.GroupID;

            int maxIndex = Convert.ToInt32(form["hdnMaxRateIndex"]);

            contraEntryWithDrawlDto.contraEntryWithDrawlTransactions = new List <ContraEntryWithDrawlTransactionsDto>();
            ContraEntryWithDrawlTransactionsDto contraEntrywithdrawltransactions = null;

            for (int i = 1; i <= maxIndex; i++)
            {
                contraEntrywithdrawltransactions          = new ContraEntryWithDrawlTransactionsDto();
                contraEntrywithdrawltransactions.AHID     = Convert.ToInt32(form["hdnAHID_" + i]);;
                contraEntrywithdrawltransactions.CrAmount = Convert.ToDecimal(form["hdnDrAmount_" + i]);
                contraEntrywithdrawltransactions.DrAmount = Convert.ToDecimal(form["hdnCrAmount_" + i]);
                contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Add(contraEntrywithdrawltransactions);
            }

            contraEntrywithdrawltransactions          = new ContraEntryWithDrawlTransactionsDto();
            contraEntrywithdrawltransactions.AHID     = Convert.ToInt32(form["hdnCashInHandAHID"]);       //Convert.ToInt32(form["AHID"]);
            contraEntrywithdrawltransactions.CrAmount = 0;
            contraEntrywithdrawltransactions.DrAmount = contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Sum(s => s.CrAmount);
            contraEntrywithdrawltransactions.IsMaster = true;
            contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Add(contraEntrywithdrawltransactions);
            return(contraEntryWithDrawlDto);
        }
Beispiel #3
0
        public ActionResult CreateContraEntryCashWithdrawl(string id)
        {
            long AccountMasterID = string.IsNullOrEmpty(id.DecryptString()) ? default(long) : Convert.ToInt32(id.DecryptString());
            ContraEntryWithDrawlDto contraEntryWithDrawlDto = new ContraEntryWithDrawlDto();

            if (AccountMasterID > 0)
            {
                contraEntryWithDrawlDto = _ContraEntryService.GroupContraEntryWithDrawlGetByAccountMasterId(AccountMasterID);
            }


            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;
            int EmployeeID = UserInfo.UserID;

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

            contraEntryWithDrawlDto.EmployeeName = obj.EmployeeName;
            contraEntryWithDrawlDto.EmployeeCode = obj.EmployeeCode;

            if (contraEntryWithDrawlDto.contraEntryWithDrawlTransactions != null && contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Count > 0)
            {
                var totalCrAmmount = contraEntryWithDrawlDto.contraEntryWithDrawlTransactions[contraEntryWithDrawlDto.contraEntryWithDrawlTransactions.Count() - 1].CrAmount;
                ViewBag.TotalCrAmmount = totalCrAmmount;
            }
            return(View(contraEntryWithDrawlDto));
        }
 public ResultDto FederationUpdateContraEntryWithDrawl(ContraEntryWithDrawlDto contraEntryWithDrawlDto)
 {
     return(FederationInsertUpdateContraEntryWithDrawl(contraEntryWithDrawlDto));
 }
 public ResultDto GroupUpdateContraEntryWithDrawl(ContraEntryWithDrawlDto contraEntryWithDrawlDto)
 {
     return(GroupInsertUpdateContraEntryWithDrawl(contraEntryWithDrawlDto));
 }