//public ActionResult BindBatchNoOfProduct(int ProductID) //{ // DataSet ds = BL_obj.GetMedicalBillForProductStock(ProductID); // List<PatientMedicalBill> obj1 = new List<Models.Pharmacy.PatientMedicalBill>(); // if (ds.Tables[0].Rows.Count > 0) // { // Connect(); // SqlCommand cmd = new SqlCommand("select ProductDetailsID ,BatchNo,ExpiryDate,SalesRate,CurrentStock ,CurrentStock1, PurchaseRate,MRP from ProductDetails left join Product on Product .ProductID = ProductDetails.ProductID where Product.HospitalID = " + HospitalID + " and Product.LocationID = " + LocationID + " and CurrentStock > 0 and Convert(varchar(10),ExpiryDate,120) > (GETDATE()) and ProductDetails.ProductID =" + ProductID + " and ProductDetails.RowStatus = 0 order by ExpiryDate asc", con); // con.Open(); // SqlDataAdapter da = new SqlDataAdapter(cmd); // da.Fill(ds); // con.Close(); // } // else // { // Connect(); // SqlCommand cmd = new SqlCommand("select ProductDetailsID ,BatchNo,ExpiryDate, SalesRate,CurrentStock ,CurrentStock1, PurchaseRate,MRP,SalesRate from ProductDetails left join Product on Product .ProductID = ProductDetails.ProductID where Product.HospitalID = " + HospitalID + " and Product.LocationID = " + LocationID + " and Convert(varchar(10),ExpiryDate,120) > (GETDATE()) and ProductDetails.ProductID =" + ProductID + " and ProductDetails.RowStatus = 0 order by ExpiryDate asc", con); // con.Open(); // SqlDataAdapter da = new SqlDataAdapter(cmd); // da.Fill(ds); // con.Close(); // } // foreach (DataRow dr in ds.Tables[0].Rows) // { // obj1.Add(new Models.Pharmacy.PatientMedicalBill // { // ProductDetailsID = dr["ProductDetailsID"].ToString(), // batchNumber = dr["BatchNo"].ToString() // }); // } // return new JsonResult { Data = obj1, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; //} public void FillData() { DataSet dsPatient = new DataSet(); dsPatient.Reset(); dsPatient = BL_obj.GetPatientMedicalBills(Convert.ToInt32(obj.PatientRegNO)); if (dsPatient.Tables[0].Rows.Count > 0) { if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "IPD") { obj.PatientRegNO = dsPatient.Tables[0].Rows[0]["PatientRegNO"].ToString(); // ucPatientMedicalBill1.txtPatientIPDNo.Text = dsPatient.Tables[0].Rows[0]["PatientIPDNO"].ToString(); obj.PatientName = dsPatient.Tables[0].Rows[0]["PatientName"].ToString(); obj.DoctorID = dsPatient.Tables[0].Rows[0]["DoctorID"].ToString(); //ucPatientMedicalBill1.txtSalesPersonName.Text = dsPatient.Tables[0].Rows[0]["GuardianName"].ToString(); //ucPatientMedicalBill1.atxtWardName.Text = dsPatient.Tables[0].Rows[0]["WardID"].ToString(); //ucPatientMedicalBill1.atxtRoomNo.Text = dsPatient.Tables[0].Rows[0]["RoomID"].ToString(); //ucPatientMedicalBill1.atxtBedNo.Text = dsPatient.Tables[0].Rows[0]["BedID"].ToString(); obj.PatientType = dsPatient.Tables[0].Rows[0]["PatientType"].ToString(); // ucPatientMedicalBill1.txtAge.Text = dsPatient.Tables[0].Rows[0]["Age"].ToString(); //ucPatientMedicalBill1.cmbAgeType.Text = dsPatient.Tables[0].Rows[0]["AgeType"].ToString(); //ucPatientMedicalBill1.txtMobileNo.Text = dsPatient.Tables[0].Rows[0]["MobileNo"].ToString(); obj.Address = dsPatient.Tables[0].Rows[0]["Address"].ToString(); } else if (dsPatient.Tables[0].Rows[0]["PatientType"].ToString() == "OPD") { obj.PatientRegNO = dsPatient.Tables[0].Rows[0]["PatientRegNO"].ToString(); // ucPatientMedicalBill1.txtPatientIPDNo.Text = dsPatient.Tables[0].Rows[0]["PatientOPDNO"].ToString(); obj.PatientName = dsPatient.Tables[0].Rows[0]["PatientName"].ToString(); obj.DoctorID = dsPatient.Tables[0].Rows[0]["DoctorID"].ToString(); //ucPatientMedicalBill1.txtSalesPersonName.Text = dsPatient.Tables[0].Rows[0]["GuardianName"].ToString(); obj.PatientType = dsPatient.Tables[0].Rows[0]["PatientType"].ToString(); // ucPatientMedicalBill1.txtAge.Text = dsPatient.Tables[0].Rows[0]["Age"].ToString(); // ucPatientMedicalBill1.cmbAgeType.Text = dsPatient.Tables[0].Rows[0]["AgeType"].ToString(); // ucPatientMedicalBill1.txtMobileNo.Text = dsPatient.Tables[0].Rows[0]["MobileNo"].ToString(); obj.Address = dsPatient.Tables[0].Rows[0]["Address"].ToString(); } if (dsPatient.Tables[1].Rows.Count > 0) { if (dsPatient.Tables[1].Rows[0]["PreBalance"].ToString() != null && dsPatient.Tables[1].Rows[0]["PreBalance"].ToString() != "") { string PreBalance = dsPatient.Tables[1].Rows[0]["PreBalance"].ToString(); string CurrentPreBalance = PreBalance; //ucPatientMedicalBill1.txtPreBalance.Text = dsPatient.Tables[1].Rows[0]["PreBalance"].ToString(); if (Convert.ToDecimal(PreBalance) < 0) //if (Convert.ToDecimal(ucPatientMedicalBill1.txtPreBalance.Text) < 0) { //ucPatientMedicalBill1.lblPreBalance.Enabled = true; ////PreBalance = PreBalance.Replace("-", ""); //ucPatientMedicalBill1.txtPreBalance.Text = PreBalance.Replace("-", ""); //ucPatientMedicalBill1.lblPreBalance.Text = "Deposit"; //ucPatientMedicalBill1.lblPreBalance.ForeColor = System.Drawing.Color.Blue; //ucPatientMedicalBill1.btnRefound.ButtonText = "Refound Amount"; //ucPatientMedicalBill1.btnRefound.Visible = true; } else { //ucPatientMedicalBill1.lblPreBalance.Enabled = true; //ucPatientMedicalBill1.txtPreBalance.Text = dsPatient.Tables[1].Rows[0]["PreBalance"].ToString(); //ucPatientMedicalBill1.lblPreBalance.Text = "Pre. Balance"; //ucPatientMedicalBill1.lblPreBalance.ForeColor = System.Drawing.Color.Red; } } else { // ucPatientMedicalBill1.txtPreBalance.Text = "0.00"; } } // ucPatientMedicalBill1.txtServiceTax.Text = dsPatient.Tables[2].Rows[0]["ServiceCharge"].ToString(); // BindOLDBillNo(); } }