public void GetAnfTransactionalHeadsByCompanyId()
 {
     VoucherIdViewModel v = new VoucherIdViewModel();
     JsonResult json = controller.GetAnfTransactionalHeadsByCompanyId() as JsonResult;
     dynamic jsonCollection = json.Data;
     Assert.IsNotNull(json);
     Assert.IsInstanceOf(typeof(IEnumerable<PaymentVoucherAccountNameAndCode>), json.Data, "Wrong View Model");
     List<PaymentVoucherAccountNameAndCode> list = new List<PaymentVoucherAccountNameAndCode>();
     list = json.Data as List<PaymentVoucherAccountNameAndCode>;
     Assert.AreEqual(2883, list.Count);
 }
 public void GetVoucherDetailsbyVoucherId()
 {
     VoucherIdViewModel v = new VoucherIdViewModel();
     v.id = 3112231053;
     JsonResult json = controller.GetVoucherDetailsbyVoucherId(v) as JsonResult;
     dynamic jsonCollection = json.Data;
     Assert.IsNotNull(json);
     Assert.IsInstanceOf(typeof(IEnumerable<AnFVoucherDetail>), json.Data, "Wrong View Model");
     List<AnFVoucherDetail> list = new List<AnFVoucherDetail>();
     list = json.Data as List<AnFVoucherDetail>;
     Assert.AreEqual(1, list.Count);
 }
        public ActionResult GetVoucherDetailsbyVoucherId(VoucherIdViewModel v)
        {
            DataTable dt = _anfVoucherDetailsService.GetVoucherDetailsbyVoucherId(v.id);

            List<VoucherSearchResultById> list = dt.DataTableToList<VoucherSearchResultById>();

            return Json(list, JsonRequestBehavior.AllowGet);
        }