public void SaveBookingCancelDetails(TblBookingCancelMaster master)
        {
            var entity = this.ktConContext.TblBookingMaster.FirstOrDefault(item => item.CustomerId == master.CustomerId && item.PlanId == master.PlanId);

            if (entity != null)
            {
                entity.NoOfPlanCancel = master.CancelNoOfPlan;
                ktConContext.TblBookingMaster.Update(entity);
                ktConContext.SaveChanges();
            }
        }
        public void SaveLoginDetails(TblEmployeeMaster master)
        {
            if (master.EmployeeId > 0)
            {
                var entity = this.ktConContext.TblUserInfo.FirstOrDefault(item => item.Username == master.UserId.ToString() && item.Userpassword == master.Password);

                if (entity != null)
                {
                    entity.Userpassword = master.Password;
                    entity.Username     = master.UserId;
                    // entity.UserType = master.EmployeeId.ToString();
                    ktConContext.TblUserInfo.Update(entity);
                    ktConContext.SaveChanges();
                }
            }
            else
            {
                TblUserInfo custransList = new TblUserInfo()
                {
                    Userpassword = master.Password,
                    // UserType = master.EmployeeId.ToString(),
                    Username = master.UserId
                };
                this.RepositoryContext.Set <TblUserInfo>().Add(custransList);
                this.RepositoryContext.SaveChanges();
            }
        }
Beispiel #3
0
        public void SaveSupplierTransaction(TblPurchasepayment master)
        {
            if (master.PkId > 0)
            {
                var entity = this.ktConContext.TblSupplierTransaction.FirstOrDefault(item => item.PaymentVocherNo == master.RecordNo.ToString() && item.TransactionType == "Purchase Payment");

                if (entity != null)
                {
                    entity.PurchasePaidAmt = master.AmountPaid;
                    ktConContext.TblSupplierTransaction.Update(entity);
                    ktConContext.SaveChanges();
                }
            }
            else
            {
                TblSupplierTransaction suppransList = new TblSupplierTransaction()
                {
                    SupplierId      = master.SupplierId,
                    TransactionDate = master.Date,
                    TransactionType = "Purchase Payment",
                    BillId          = "0",
                    PurchaseAmount  = 0,
                    PurchasePaidAmt = master.AmountPaid,
                    PaymentType     = master.PaymentType,
                    Narration       = master.Narration,
                    PaymentVocherNo = master.RecordNo.ToString(),
                };

                this.RepositoryContext.Set <TblSupplierTransaction>().Add(suppransList);
                this.RepositoryContext.SaveChanges();
            }
        }
Beispiel #4
0
        public void SaveCustomerTransaction(TblSalesReceipt master)
        {
            decimal?bookReceiptAmt = 0;
            decimal?billPaidAmt    = 0;

            if (master.PaymentType == "Against Booking")
            {
                bookReceiptAmt = master.CashAmount;
                billPaidAmt    = 0;
            }
            else
            {
                bookReceiptAmt = 0;
                billPaidAmt    = master.CashAmount;
            }

            if (master.PkId > 0)
            {
                var entity = this.ktConContext.TblCustomerTransactions.FirstOrDefault(item => item.ReceiptNo == master.ReceiptNo.ToString() && item.TransactionType == typeof(TblSalesReceipt).ToString());

                if (entity != null)
                {
                    entity.BookingReceivedAmt = bookReceiptAmt;
                    entity.BillPaidAmt        = billPaidAmt;
                    entity.CancelBookingAmt   = 0;
                    ktConContext.TblCustomerTransactions.Update(entity);
                    ktConContext.SaveChanges();
                }
            }
            else
            {
                TblCustomerTransaction custransList = new TblCustomerTransaction()
                {
                    CustomerId         = master.CustomerId,
                    TransactionDate    = master.Date,
                    TransactionType    = typeof(TblSalesReceipt).ToString(),
                    BookingId          = "0",
                    BookingAmount      = 0,
                    CancelBookingAmt   = 0,
                    BookingReceivedAmt = bookReceiptAmt,
                    BillId             = "0",
                    BillAmount         = 0,
                    BillPaidAmt        = billPaidAmt,
                    PaymentType        = master.PaymentType,
                    Narration          = master.Narration,
                    ReceiptNo          = master.ReceiptNo.ToString(),
                };

                this.RepositoryContext.Set <TblCustomerTransaction>().Add(custransList);
                this.RepositoryContext.SaveChanges();
            }
        }
        public void SaveBookinginCustomerTransaction(TblBookingMaster master)
        {
            if (master.PkId > 0)
            {
                var entity = this.ktConContext.TblCustomerTransaction.FirstOrDefault(item => item.CustomerId == master.CustomerId && item.BookingId == master.RecordNo.ToString() && item.TransactionType == typeof(TblBookingMaster).ToString());

                if (entity != null)
                {
                    entity.BookingAmount      = master.Amount;
                    entity.BookingReceivedAmt = master.PaidAmount;
                    entity.CancelBookingAmt   = 0;
                    ktConContext.TblCustomerTransaction.Update(entity);
                    ktConContext.SaveChanges();
                }
            }
            else
            {
                TblCustomerTransaction custransList = new TblCustomerTransaction()
                {
                    CustomerId         = master.CustomerId,
                    TransactionDate    = master.BookingDate,
                    TransactionType    = typeof(TblBookingMaster).ToString(),
                    BookingId          = master.RecordNo.ToString(),
                    BookingAmount      = master.Amount,
                    CancelBookingAmt   = 0,
                    BookingReceivedAmt = master.PaidAmount,
                    BillId             = "0",
                    BillAmount         = 0,
                    BillPaidAmt        = 0,
                    PaymentType        = master.PaymentMethod,
                    Narration          = master.Narration,
                    ReceiptNo          = "0"
                };
                this.RepositoryContext.Set <TblCustomerTransaction>().Add(custransList);
                this.RepositoryContext.SaveChanges();
            }
        }