public ActionResult PatientMedicalBill(PatientMedicalBill obj, FormCollection fc) { try { //obj.MedicalBillID = Convert.ToInt32(fc["MedicalBillID"]); //obj.PatientRegNO = fc["PatientRegNO"].ToString(); //obj.PatientName = fc["PatientName"].ToString(); //obj.PatientType = fc["PatientType"].ToString(); //obj.DoctorPrintName = fc["DoctorPrintName"].ToString(); //obj.DoctorID = fc["DoctorID"].ToString(); //obj.Address = fc["address"].ToString(); obj.BillNo = fc["oldBillNumber"].ToString(); obj.BillNoDate = fc["billDate"].ToString(); //obj.message = fc["message"].ToString(); //obj.CustomerName = fc["CustomerName"].ToString(); //obj.CustomerID = fc["CustomerID"].ToString(); //obj.SalesPersonName = fc["SalesPersonName"].ToString(); //obj.SalesPersonID = fc["SalesPersonID"].ToString(); //obj.grossTotal = fc["grossTotal"].ToString(); //obj.totalAmount = fc["totalAmount"].ToString(); //obj.discountAmount = fc["discountAmount"].ToString(); //obj.discountPercentage = fc["discountPercentage"].ToString(); //obj.vatAmount = fc["vatAmount"].ToString(); obj.otheLess = fc["otheLess"].ToString(); //obj.salesReturn = fc["salesReturn"].ToString(); //obj.netAmount = fc["netAmount"].ToString(); //obj.paymentType = fc["paymentType"].ToString(); //obj.cashRecipt = fc["cashRecipt"].ToString(); //obj.scanBarcode = fc["scanBarcode"].ToString(); //obj.barcodeNumber = fc["barcodeNumber"].ToString(); //obj.Number = fc["Number"].ToString(); //obj.Name = fc["Name"].ToString(); //obj.paymentDate = fc["paymentDate"].ToString(); //obj.Remarks = fc["Remarks"].ToString(); //obj.ProductName = fc["ProductName"].ToString(); //obj.ProductID = fc["ProductID"].ToString(); //obj.PatientBillsDetailsMedicalID = Convert.ToInt32(fc["PatientBillsDetailsMedicalID"]); //obj.batchNumber = fc["batchNumber"].ToString(); //obj.ProductDetailsID = fc["ProductDetailsID"].ToString(); //obj.expiryDate = fc["expiryDate"].ToString(); //obj.mrp = fc["mrp"].ToString(); //obj.netRate = fc["netRate"].ToString(); //obj.Prod_discountPercentage = fc["Prod_discountPercentage"].ToString(); //obj.QtyU = fc["QtyU"].ToString(); //obj.QtyL = fc["QtyL"].ToString(); //obj.freeQuantity = fc["freeQuantity"].ToString(); obj.tblProductName = fc["tblProductName"].ToString(); obj.tblProductID = fc["tblProductID"].ToString(); obj.tblbatchNumber = fc["tblbatchNumber"].ToString(); obj.tblmrp = fc["tblmrp"].ToString(); obj.tblexpiryDate = fc["tblexpiryDate"].ToString(); obj.tblnetRate = fc["tblnetRate"].ToString(); obj.tblQtyU = fc["tblQtyU"].ToString(); obj.tblQtyL = fc["tblQtyL"].ToString(); obj.tblGST = fc["tblGST"].ToString(); obj.tbldiscountPercentage = fc["tbldiscountPercentage"].ToString(); obj.tbltotalAmount = fc["tbltotalAmount"].ToString(); obj.tblDiscountValue = fc["tblDiscountValue"].ToString(); obj.tblfreeQuantity = fc["tblfreeQuantity"].ToString(); int saleID = obj.MedicalBillID; if (BL_obj.Save(obj)) { if (saleID == 0) { ModelState.Clear(); TempData["msg"] = "Medical Bill Saved Successfully !"; Session["medID"] = obj.MedicalBillID; return(RedirectToAction("medicalBill", "PharmacyReport")); } else { ModelState.Clear(); TempData["msg"] = "Medical Bill Updated Successfully !"; Session["medID"] = obj.MedicalBillID; return(RedirectToAction("medicalBill", "PharmacyReport")); } } else { ModelState.Clear(); TempData["msg"] = "Medical Bill Not Saved !"; } } catch (Exception ex) { return(RedirectToAction("PatientMedicalBill", "PatientMedicalBill")); } return(RedirectToAction("PatientMedicalBill", "PatientMedicalBill")); }