public ActionResult Loan_transfer_entry(int id)
        {
            try
            {
                var loan = dbcontext.LoanRequest.FirstOrDefault(m => m.ID == id);
                ViewBag.emp       = dbcontext.Employee_Profile.Where(m => m.Active == true).ToList().Select(m => new { Code = m.Code + "--[" + m.Name + ']', ID = m.ID });
                ViewBag.loan_type = dbcontext.LoanInAdvanceSetup.ToList().Select(m => new { Code = m.LoanTypeCode + "--[" + m.LoanTypeDesc + ']', ID = m.ID });
                //////////////////////////////////
                var new_trans    = new LoanTransfer();
                var stru         = dbcontext.StructureModels.FirstOrDefault(m => m.All_Models == ChModels.Payroll).Structure_Code;
                var All_requests = dbcontext.LoanRequest.ToList();
                if (All_requests.Count() == 0)
                {
                    new_trans.NewLoanRequestNumber = stru + "1";
                }
                else
                {
                    new_trans.NewLoanRequestNumber = stru + (All_requests.LastOrDefault().ID + 1).ToString();
                }
                new_trans.LoanRequestNumber            = loan.LoanRequestNumber;
                new_trans.LoanTypeCode                 = loan.LoanTypeCode;
                new_trans.StartDate                    = loan.StartDate;
                new_trans.EndDate                      = loan.EndDate;
                new_trans.NumberOfDeductedInstallments = loan.NumberOfDeductedInstallments;
                new_trans.TransferTransactionNumber    = loan.TransferTransactionNumber;
                new_trans.NumberOfInstallment          = loan.NumberOfInstallment;
                new_trans.LoanAmount                   = loan.LoanAmount;
                var All_trans = dbcontext.LoanTransfer.ToList();
                if (All_trans.Count() == 0)
                {
                    new_trans.TransferTransactionNumber = stru + "1";
                }
                else
                {
                    new_trans.TransferTransactionNumber = stru + (All_trans.LastOrDefault().ID + 1).ToString();
                }
                //////////////////////////////////

                var transfer = new transferVM
                {
                    LoanRequest  = loan,
                    LoanTransfer = new_trans
                };
                return(View(transfer));
            }
            catch (Exception)
            {
                return(RedirectToAction("index"));
            }
        }
Beispiel #2
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Blockchain.Length != 0)
        {
            hash ^= Blockchain.GetHashCode();
        }
        if (SrcAddress.Length != 0)
        {
            hash ^= SrcAddress.GetHashCode();
        }
        if (DstAddress.Length != 0)
        {
            hash ^= DstAddress.GetHashCode();
        }
        if (Amount.Length != 0)
        {
            hash ^= Amount.GetHashCode();
        }
        if (Interest.Length != 0)
        {
            hash ^= Interest.GetHashCode();
        }
        if (Maturity.Length != 0)
        {
            hash ^= Maturity.GetHashCode();
        }
        if (Fee.Length != 0)
        {
            hash ^= Fee.GetHashCode();
        }
        if (Expiration != 0UL)
        {
            hash ^= Expiration.GetHashCode();
        }
        if (Block.Length != 0)
        {
            hash ^= Block.GetHashCode();
        }
        if (LoanTransfer.Length != 0)
        {
            hash ^= LoanTransfer.GetHashCode();
        }
        if (RepaymentTransfer.Length != 0)
        {
            hash ^= RepaymentTransfer.GetHashCode();
        }
        if (Lock.Length != 0)
        {
            hash ^= Lock.GetHashCode();
        }
        if (Sighash.Length != 0)
        {
            hash ^= Sighash.GetHashCode();
        }
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }