public static void SetSecurityAccess() { var dbLoanEntities = new dbLoanEntities(); var result = dbLoanEntities.tblSecurityAccess.FirstOrDefault(x => x.Id == 1); if (result == null) { var tblSecurityAccess = new tblSecurityAccess { Id = 1, Time = PersianDateTime.Now.AddMinutes(-10).ToString(), Counter = "0" }; dbLoanEntities.tblSecurityAccess.Add(tblSecurityAccess); dbLoanEntities.SaveChanges(); } else if (result.Time == null) { var tblSecurityAccess = new tblSecurityAccess { Id = 1, Time = PersianDateTime.Now.AddMinutes(-10).ToString() }; using (dbLoanEntities) { dbLoanEntities.tblSecurityAccess.Attach(tblSecurityAccess); dbLoanEntities.Entry(tblSecurityAccess).Property(x => x.Time).IsModified = true; dbLoanEntities.SaveChanges(); } } }
public Task <int> Add() { tblInfo tblInfo = new tblInfo { InfoFirstName = DInfoFirstName, InfoLastName = DInfoLastName, InfoFatherName = DInfoFatherName, InfoNationalCode = DInfoNationalCode, InfoCode = DInfoCode, InfoGender = DInfoGender, InfoBirthDay = DInfoBirthDay, InfoBirthPlace = DInfoBirthPlace, InfoMarried = DInfoMarried, InfoTell = DInfoTell, InfoMobile = DInfoMobile, InfoEmail = DInfoEmail, InfoPostalCode = DInfoPostalCode, InfoAddress = DInfoAddress, InfoJobName = DInfoJobName, InfoJobPlaceName = DInfoJobPlaceName, InfoJobTell = DInfoJobTell, InfoJobFax = DInfoJobFax, InfoJobAddress = DInfoJobAddress, InfoImage = DInfoImage, InfoDescription = DInfoDescription }; _dbLoanEntities.tblInfo.Add(tblInfo); _dbLoanEntities.SaveChanges(); return (Task.Run(() => tblInfo.Id)); }
public void AddAdmin() { var tblUser = new tblUser { User_PostType_Id = DPostTypeId, User_SecurityQuestion_Id = DSecurityQuestionId, UserFirstName = DFirstName, UserLastName = DLastName, UserName = DUserName, UserPassword = BCrypt.Net.BCrypt.HashPassword(DPassword), UserMobileNumber = DMobile, UserEmail = DEmail, UserAnswer = BCrypt.Net.BCrypt.HashPassword(DAnswer), UserRegistrationDate = DRegistrationDate, UserImage = DImage, UserDescription = DDescription }; _dbLoanEntities.tblUser.Add(tblUser); _dbLoanEntities.SaveChanges(); var tblSundry = new tblSundry { Id = 1, RegisteredAdminPassword = true }; _dbLoanEntities.tblSundry.Add(tblSundry); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblLicense = new tblLicense { Id = 1, AppLicense = DAppLicense, AppVersion = DAppVersion }; _dbLoanEntities.tblLicense.Add(tblLicense); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblPerAccType = new tblPerAccType { PerAccType_Personnel_Id = DPersonnelId, PerAccType_AccountType_Id = DAccountTypeId, PerAccTypeAccountNumber = DAccountNumber }; _dbLoanEntities.tblPerAccType.Add(tblPerAccType); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblChMoPay = new tblChMoPay { ChMoPay_ChargeMonthly_Id = DChargeMonthlyId, ChMoPay_Account_Id = DAccountId, ChMoPayDueAmount = DDueAmount, ChMoPayDueDate = DDueDate, ChMoPayDelayMonth = DDelayMonth }; _dbLoanEntities.tblChMoPay.Add(tblChMoPay); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblChargeMonthly = new tblChargeMonthly { ChargeMonthly_Personnel_Id = DPersonnelId, ChargeMonthlyStartDate = DChargeMonthlyStartDate, ChargeMonthlyEndDate = DChargeMonthlyEndDate, ChargeMonthlyCharge = DChargeMonthlyCharge, ChargeMonthlyDescription = DChargeMonthlyDescription }; _dbLoanEntities.tblChargeMonthly.Add(tblChargeMonthly); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblIntroducer = new tblIntroducer { Introducer_Loan_Id = DLoanId, Introducer_IntroducerType_Id = DIntroducerTypeId, Introducer_Info_Id = DInfoId, Introducer_Institution_Id = DInstitutionId, IntroducerDescription = DDescription }; _dbLoanEntities.tblIntroducer.Add(tblIntroducer); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblWage = new tblWage { Wage_Loan_Id = DLoanId, Wage_WageType_Id = DWageTypeId, Wage_WageCalculationType_Id = DWageCalculationTypeId, WagePercent = DPercent, WageAmount = DAmount, WageDescription = DDescription }; _dbLoanEntities.tblWage.Add(tblWage); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblFeeIncome = new tblFeeIncome { FeeIncome_FeeIncomeType_Id = DFeeIncomeTypeId, FeeIncome_PaymentType_Id = DPaymentTypeId, FeeIncomeDate = DDate, FeeIncomeAmount = DAmount, FeeIncomeReceiptNumber = DReceiptNumber, FeeIncomeDescription = DDescription }; _dbLoanEntities.tblFeeIncome.Add(tblFeeIncome); _dbLoanEntities.SaveChanges(); }
public void Add() { var tblBankAccount = new tblBankAccount() { BankAccountBankName = DBankName, BankAccountBranchName = DBranchName, BankAccountNum = DAccountNum, BankAccountCardNum = DCardNum, BankAccountInitialBalance = DInitialBalance, BankAccountDescription = DDescription }; _dbLoanEntities.tblBankAccount.Add(tblBankAccount); _dbLoanEntities.SaveChanges(); }
public void AddPayment() { var tblInstallment = new tblInstallment { Id = DId, Installment_PaymentType_Id = DPaymentTypeId, InstallmentAmount = DAmount, InstallmentReceiptNumber = DReceiptNumber, InstallmentTotalPaid = DTotalPaid, InstallmentRemaining = DRemaining, InstallmentPaymentDate = DPaymentDate, InstallmentDelayDay = DDelayDay, InstallmentDescription = DDescription }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblInstallment.Attach(tblInstallment); dbLoanEntities.Entry(tblInstallment).Property(x => x.Installment_PaymentType_Id).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentAmount).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentReceiptNumber).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentTotalPaid).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentRemaining).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentPaymentDate).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentDelayDay).IsModified = true; dbLoanEntities.Entry(tblInstallment).Property(x => x.InstallmentDescription).IsModified = true; dbLoanEntities.SaveChanges(); } }
public void Add() { var tblGuarantor = new tblGuarantor { Guarantor_Loan_Id = DLoanId, Guarantor_Info_Id = DInfoId, Guarantor_GuaranteeType_Id = DGuaranteeTypeId, Guarantor_BlockType_Id = DBlockTypeId, GuarantorReceiptNumber = DReceiptNumber, GuarantorAmount = DAmount, GuarantorBlockAmount = DBlockAmount, GuarantorBlock = DBlock, GuarantorDescription = DDescription }; _dbLoanEntities.tblGuarantor.Add(tblGuarantor); _dbLoanEntities.SaveChanges(); }
public Task <int> Add() { var tblPersonnel = new tblPersonnel { Personnel_Info_Id = DInfoId, PersonnelId = DPersonnelId, PersonnelMembership = DPersonnelMembership, PersonnelMembershipDate = DPersonnelMembershipDate, PersonnelBARCode = DPersonnelBarCode, PersonnelQRCode = DPersonnelQrCode, PersonnelSignature = DPersonnelSignature }; _dbLoanEntities.tblPersonnel.Add(tblPersonnel); _dbLoanEntities.SaveChanges(); return (Task.Run(() => tblPersonnel.Id)); }
public void Add() { tblInstallment tblInstallment = new tblInstallment { Installment_Loan_Id = DLoanId, Installment_PaymentType_Id = DPaymentTypeId, InstallmentDueAmount = DDueAmount, InstallmentAmount = DAmount, InstallmentReceiptNumber = DReceiptNumber, InstallmentTotalPaid = DTotalPaid, InstallmentRemaining = DRemaining, InstallmentPaymentDate = DPaymentDate, InstallmentDueDate = DDueDate, InstallmentDelayDay = DDelayDay, InstallmentDescription = DDescription }; _dbLoanEntities.tblInstallment.Add(tblInstallment); _dbLoanEntities.SaveChanges(); }
public Task <int> Add() { var tblLoan = new tblLoan { Loan_Personnel_Id = DPersonnelId, Loan_LoanType_Id = DLoanTypeId, Loan_Account_Id = DAccountId, LoanAmount = DAmount, LoanDate = DDate, LoanInstallmentNum = DInstallmentNum, LoanInstallmentFirstPayDate = DInstallmentFirstPayDate, LoanInstallmentInterspace = DInstallmentInterspace, LoanPayOff = DPayOff, LoanDescription = DDescription }; _dbLoanEntities.tblLoan.Add(tblLoan); _dbLoanEntities.SaveChanges(); return(Task.Run(() => tblLoan.Id)); }
public void Add() { var tblLoanFund = new tblLoanFund { LoanFundName = DName, LoanFundTell1 = DTell1, LoanFundTell2 = DTell2, LoanFundFax = DFax, LoanFundEmail = DEmail, LoanFundPostalCode = DPostalCode, LoanFundAddress = DAddress, LoanFundInitialBalance = DInitialBalance, LoanFundPenalty = DPenalty, LoanFundWagePercent = DWagePercent, LoanFundLogo = DLogo }; _dbLoanEntities.tblLoanFund.Add(tblLoanFund); _dbLoanEntities.SaveChanges(); }
public Task <int> Add() { var tblInstitution = new tblInstitution { Institution = DInstName }; _dbLoanEntities.tblInstitution.Add(tblInstitution); _dbLoanEntities.SaveChanges(); return(Task.Run(() => tblInstitution.id)); }
public Task <int> Add() { var tblAccount = new tblAccount { Account_Personnel_Id = DPersonnelId, Account_PaymentType_Id = DPaymentTypeId, Account_TransactionType_Id = DTransactionTypeId, AccountAmount = DAmount, AccountReceiptNumber = DReceiptNumber, AccountCurrentBalance = DCurrentBalance, AccountPaymentDate = DPaymentDate, AccountDescription = DDescription }; _dbLoanEntities.tblAccount.Add(tblAccount); _dbLoanEntities.SaveChanges(); var id = Task.Run(() => tblAccount.Id); _dbLoanEntities.spSortAccount(DPersonnelId); return(id); }
public void EditPayOff() { var tblLoan = new tblLoan { Id = DId, LoanPayOff = DPayOff }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblLoan.Attach(tblLoan); dbLoanEntities.Entry(tblLoan).Property(x => x.LoanPayOff).IsModified = true; dbLoanEntities.SaveChanges(); } }
public void StartSecurityTimeAccess()//taeen zaman vorod eshtebah { var tblSecurityAccess = new tblSecurityAccess { Id = 1, Time = PersianDateTime.Now.ToString() }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblSecurityAccess.Attach(tblSecurityAccess); dbLoanEntities.Entry(tblSecurityAccess).Property(x => x.Time).IsModified = true; dbLoanEntities.SaveChanges(); } }
public static void SaveCounter(int num)//zakhire tedad mavared vorod eshtebah { var tblSecurityAccess = new tblSecurityAccess { Id = 1, Counter = num.ToString() }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblSecurityAccess.Attach(tblSecurityAccess); dbLoanEntities.Entry(tblSecurityAccess).Property(x => x.Counter).IsModified = true; dbLoanEntities.SaveChanges(); } }
public void EditGuarantorBlock() { var tblGuarantor = new tblGuarantor { id = DId, GuarantorBlock = DBlock }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblGuarantor.Attach(tblGuarantor); dbLoanEntities.Entry(tblGuarantor).Property(x => x.GuarantorBlock).IsModified = true; dbLoanEntities.SaveChanges(); } }
public void ChangePassword() { var tblUser = new tblUser { UserName = DUserName, UserPassword = BCrypt.Net.BCrypt.HashPassword(DPassword) }; using (var dbLoanEntities = new dbLoanEntities()) { dbLoanEntities.tblUser.Attach(tblUser); dbLoanEntities.Entry(tblUser).Property(x => x.UserPassword).IsModified = true; dbLoanEntities.SaveChanges(); } }