public ActionResult UnExportPaymentVoucherCash() { var userId = User.Identity.GetUserId(); var UserInfo = _unitOfWork.User.GetMyInfo(userId); var CompanyTransactionKindObj = _unitOfWork.NativeSql.GetPaymentVoucherCashFromTransactionKind(UserInfo.fCompanyId); var Company = _unitOfWork.Company.GetMyCompany(UserInfo.fCompanyId); DateTime Today = DateTime.Now; DateTime FromDate = DateTime.Now; DateTime ToDate = DateTime.Now; int CurrentYear = Today.Year; if (CurrentYear == UserInfo.CurrYear) { FromDate = DateTime.Now; ToDate = DateTime.Now; } else if (CurrentYear < UserInfo.CurrYear || CurrentYear > UserInfo.CurrYear) { FromDate = new DateTime(UserInfo.CurrYear, 1, 1); ToDate = new DateTime(UserInfo.CurrYear, 1, 1); } var PaymentCashFilter = new PaymentCashFilterVM { FromDate = FromDate, ToDate = ToDate, CompanyTransactionKind = CompanyTransactionKindObj, Currency = _unitOfWork.Currency.GetAllCurrency(UserInfo.fCompanyId), TheDecimalPointForTheLocalCurrency = Company.TheDecimalPointForTheLocalCurrency, TheDecimalPointForTheForeignCurrency = Company.TheDecimalPointForTheForeignCurrency, CompanyYear = UserInfo.CurrYear }; return(View(PaymentCashFilter)); }
public JsonResult GetAllPaymentVoucherCash(PaymentCashFilterVM Obj) { try { var userId = User.Identity.GetUserId(); var UserInfo = _unitOfWork.User.GetMyInfo(userId); var AllPaymentCash = _unitOfWork.NativeSql.GetAllPaymentCashFromHeader(UserInfo.fCompanyId, Obj.FromDate, Obj.ToDate); if (AllPaymentCash == null) { return(Json(new List <PaymentCashFilterVM>(), JsonRequestBehavior.AllowGet)); } if (!String.IsNullOrEmpty(Obj.VoucherNumber)) { AllPaymentCash = AllPaymentCash.Where(m => m.VoucherNumber == Obj.VoucherNumber).ToList(); } if (Obj.CurrencyID != 0) { AllPaymentCash = AllPaymentCash.Where(m => m.CurrencyID == Obj.CurrencyID).ToList(); } if (Obj.CompanyTransactionKindNo != 0) { AllPaymentCash = AllPaymentCash.Where(m => m.CompanyTransactionKindNo == Obj.CompanyTransactionKindNo).ToList(); } if (!String.IsNullOrEmpty(Obj.PaidAccountNumber)) { AllPaymentCash = AllPaymentCash.Where(m => m.PaidAccountNumber == Obj.PaidAccountNumber).ToList(); } return(Json(AllPaymentCash, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ViewBag.Error = ex.Message.ToString(); return(Json(new List <PaymentCashFilterVM>(), JsonRequestBehavior.AllowGet)); } }