public ActionResult PrintSummary(AccountingModel model) { var list = PatientServices.GetPatientsSummary(model.date, model.BranchId); var branch = BranchServices.GetById(model.BranchId); GenerateSummaryReport(list, model.date, branch.BranchName); return(Json("Cash Summary Generated", JsonRequestBehavior.AllowGet)); }
public IActionResult Update(int Id) { var isLogin = HttpContext.Session.GetString("isUserLogin"); if (isLogin == "true") { var branch = _branchService.GetById(Id); return(View(branch)); } return(RedirectToAction("Login", "Home")); }
// GET: Branches/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var branch = Service.GetById(id.GetValueOrDefault()); if (branch == null) { return(HttpNotFound()); } return(View(branch)); }
public IActionResult Update(Delivery delivery) { var product = _productService.GetById(delivery.ProductId); var branch = _branchService.GetById(delivery.BranchId); delivery.Product = product; delivery.Branch = branch; if (product.Stock > delivery.Piece) { var deliveryDB = _deliveryService.GetById(delivery.Id); if (delivery.Piece - deliveryDB.Piece < 0) { product.Stock += (deliveryDB.Piece - delivery.Piece); } else { product.Stock -= (delivery.Piece - deliveryDB.Piece); } _productService.Update(product); deliveryDB.Piece = delivery.Piece; _deliveryService.Update(deliveryDB); return View("Index", _deliveryService.GetStockList()); } return View("Error"); }
public ActionResult Recipt(int Id) { var patient = PatientServices.GetByPatientId(Id); var gender = GenderServices.GetById(patient.GenderId); var branch = BranchServices.GetById(patient.BranchId); var branchContact = BranchServices.GetBranchContact(patient.BranchId); var refer = ReferDoctorsServices.GetPatientReferById(patient.Id); var SubTestList = PatientTestService.GetSubCategoryByPatientId(patient.Id); var payment = PaymentServices.GetPaymentByPatientId(patient.Id); var model = new PatientModel { Id = patient.Id, Name = patient.PatientName, Date = patient.DateTime, Age = patient.Age, Email = patient.Email, Discount = payment.Discount, PaidAmount = payment.PaidAmount, PhoneNumber = patient.PatientNumber }; GeneratePatientRecipt(model, gender, SubTestList, branch, branchContact); return(Json("Success", JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(int id) { BranchService objBranch = new BranchService(); BranchItem objBItem = new BranchItem(); objBItem = objBranch.GetById(id); //Session["Empid"] = objPassItem.EmpId; List<BranchItem> lstBranch = new List<BranchItem>(); objBItem.ListBranch = new List<BranchItem>(); objBItem.ListBranch.AddRange(lstBranch); ViewBag.Menuid = Request.QueryString["menuId"]; #region Bind DropDown Country List<clsMasterData> lstMasters = new List<clsMasterData>(); lstMasters = objBranch.getCountry(); objBItem.ListCon = new List<clsMasterData>(); objBItem.ListCon.AddRange(lstMasters); #endregion #region Bind DropDown Comp List<CompanyItem> lstComp = new List<CompanyItem>(); lstComp = objBranch.GetAllComp(); objBItem.ListComp = new List<CompanyItem>(); objBItem.ListComp.AddRange(lstComp); #endregion return View(objBItem); }
public ActionResult Details(long?id) { var bill = billService.GetById(id ?? 0) ?? new Bill(); var viewModel = new BillDetailViewModel { Bill = bill, Currency = currencyService.GetById(bill.CurrencyId ?? 0) ?? new Currency(), Vendor = vendorService.GetById(bill.VendorId ?? 0) ?? new Vendor(), Branch = branchService.GetById(LogedInUser.BranchId ?? 0) }; return(View(viewModel)); }
public ActionResult Details(long?id) { var invoice = invoiceService.GetById(id ?? 0) ?? new Invoice(); var viewModel = new InvoiceDetailViewModel { Invoice = invoice, Currency = currencyService.GetById(invoice.CurrencyId ?? 0) ?? new Currency(), Customer = customerService.GetById(invoice.CustomerId ?? 0) ?? new Customer(), Branch = branchService.GetById(LogedInUser.BranchId ?? 0) }; return(View(viewModel)); }
public ActionResult Recipt(int Id) { var patient = PatientServices.GetByPatientId(Id); var gender = GenderServices.GetById(patient.GenderId); var branch = BranchServices.GetById(patient.BranchId); var branchContact = BranchServices.GetBranchContact(patient.BranchId); var refer = ReferDoctorsServices.GetPatientReferById(patient.Id); var SubTestList = PatientTestService.GetSubCategoryByPatientId(patient.Id); var payment = PaymentServices.GetPaymentByPatientId(patient.Id); var testList = new List <TestSubCategoryModel>(); foreach (var item in SubTestList) { testList.Add(new TestSubCategoryModel { TestSubcategoryName = item.TestSubcategoryName, Unit = item.Unit, Rate = item.Rate }); } var branchModel = new BranchModel() { Name = branch.BranchName, Address = branch.BranchAddress, Contact = branchContact.BranchContactNo }; var model = new PatientModel { Id = patient.Id, Name = patient.PatientName, Date = patient.DateTime, Age = patient.Age, Email = patient.Email, Discount = payment.Discount, PaidAmount = payment.PaidAmount, PhoneNumber = patient.PatientNumber, GenderDesc = gender.GenderDescription }; ReciptModel recipt = new ReciptModel(); recipt.PatientDetails = model; recipt.Branch = branchModel; recipt.PatientTests = testList; recipt.LogedInUser = Session["loginusername"].ToString(); //var pdfDocModel = GeneratePatientRecipt(model, gender, SubTestList, branch, branchContact); return(Json(recipt, JsonRequestBehavior.AllowGet)); }
public void GetById_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new BranchRepository(context); var service = new BranchService(repository); int id = 1; // Act BranchModel result = service.GetById(id); // Assert Assert.IsNotNull(result); Assert.AreEqual(id, result.Id); }
// GET: Leve/Details/5 public async Task <ActionResult> Details(int id) { var branch = await _branchService.GetById(id); return(View(branch)); }
public ActionResult GetById(int branchId) { var batch = _branchService.GetById(branchId); return(Json(batch, JsonRequestBehavior.AllowGet)); }
// GET: Admin/Branch/Details/5 public ActionResult Details(int id) { return(View(branchService.GetById(id))); }