public int SaveDischargeBill(OutDoorBill aDischargeBill) { Query = "INSERT INTO [dbo].[tbl_OutDoorBill]([BillNo],[Date],[OPID],[HospitalCharge],[NurseCharge],[DoctorCharge],[RoomBedCharge],[ServiceCharge]," + "[MedicalCharge],[PathologyBill],[TotalBill],[SubTotal],[Discount],[AdvancePaid],[NetPayble],[BillType],[Remarks],[InwardText],[OTService],[OTMedicin],[vat])" + "VALUES(@BillNo,@Date,@OPID,@HospitalCharge,@NurseCharge,@DoctorCharge,@RoomBedCharge,@ServiceCharge,@MedicalCharge," + "@PathologyBill,@TotalBill,@SubTotal,@Discount,@AdvancePaid,@NetPayble,@BillType,@Remarks,@InwardText,@OTService,@OTMedicin,@vat)"; Command = new SqlCommand(Query, Connection); Command.CommandType = CommandType.Text; Command.Parameters.AddWithValue(@"BillNo", aDischargeBill.BillNo); Command.Parameters.AddWithValue(@"Date", aDischargeBill.Date); Command.Parameters.AddWithValue(@"OPID", aDischargeBill.OPID); Command.Parameters.AddWithValue(@"HospitalCharge", aDischargeBill.HospitalCharge); Command.Parameters.AddWithValue(@"NurseCharge", aDischargeBill.NurseCharge); Command.Parameters.AddWithValue(@"DoctorCharge", aDischargeBill.DoctorCharge); Command.Parameters.AddWithValue(@"RoomBedCharge", aDischargeBill.RoomBedCharge); Command.Parameters.AddWithValue(@"ServiceCharge", aDischargeBill.ServiceCharge); Command.Parameters.AddWithValue(@"MedicalCharge", aDischargeBill.MedicalCharge); Command.Parameters.AddWithValue(@"PathologyBill", aDischargeBill.PathologyBill); Command.Parameters.AddWithValue(@"TotalBill", aDischargeBill.TotalBill); Command.Parameters.AddWithValue(@"SubTotal", aDischargeBill.SubTotal); Command.Parameters.AddWithValue(@"Discount", aDischargeBill.discount); Command.Parameters.AddWithValue(@"AdvancePaid", aDischargeBill.AdvancedPayble); Command.Parameters.AddWithValue(@"NetPayble", aDischargeBill.NetPayble); Command.Parameters.AddWithValue(@"BillType", aDischargeBill.BillType); Command.Parameters.AddWithValue(@"Remarks", aDischargeBill.Remarks ?? ""); Command.Parameters.AddWithValue(@"InwardText", aDischargeBill.InwardText); Command.Parameters.AddWithValue(@"OTService", aDischargeBill.OTService); Command.Parameters.AddWithValue(@"OTMedicin", aDischargeBill.OTMedicin); Command.Parameters.AddWithValue(@"vat", aDischargeBill.vat); int count = Command.ExecuteNonQuery(); return(count); }
public OutDoorBill GetDischargeBill(OutDoorBill outDoor) { DataTable dt = new OpdGateway().GetDischargeBillByPatientId(outDoor.OPID); if (dt != null && dt.Rows.Count > 0) { outDoor.OPID = dt.Rows[0]["OPID"].ToString(); outDoor.PatientName = dt.Rows[0]["PatientName"].ToString(); outDoor.DiscTime = ""; //outDoor.DeisDate = Convert.ToDateTime(dt.Rows[0]["DischargeOn"]).Date; //outDoor.RegNo = dt.Rows[0]["RegNo"].ToString(); outDoor.OTMedicine = Convert.ToDouble(dt.Rows[0]["OT_Med_Total"]); outDoor.HospitalCharge = Convert.ToDouble(dt.Rows[0]["Hsptl_Total"]); outDoor.OTservice = Convert.ToDouble(dt.Rows[0]["OT_Total"]); outDoor.PharmacyBill = Convert.ToDouble(dt.Rows[0]["Phar_Total"]); outDoor.Age = dt.Rows[0]["Age"].ToString(); outDoor.BloodGroup = dt.Rows[0]["BloodGroup"].ToString(); // opidDischargeBill.OT_TOtalBill = dt.Rows[0]["OT_TOtalBill"].ToString(); outDoor.PBill = Convert.ToDouble(dt.Rows[0]["Path_Total"].ToString()); outDoor.NoOfDay = dt.Rows[0]["NoOfDay"].ToString(); outDoor.TotalBedCharge = dt.Rows[0]["cabin_Total"].ToString(); outDoor.TConsultBill = dt.Rows[0]["Con_Total"].ToString(); outDoor.TotalBill = Convert.ToDouble(dt.Rows[0]["TotalBill"]); outDoor.AdvancedPayble = Convert.ToDouble(dt.Rows[0]["Advance"]); } return(outDoor); }
public MessageModel SaveDischargeBill(OutDoorBill aDischargeBill) { MessageModel message = new MessageModel(); int count = new OpdGateway().SaveDischargeBill(aDischargeBill); if (count > 0) { message.MessageBody = "OutDoor BILL Submited"; message.MessageTitle = "Message"; } return(message); }
public OutDoorBill VateCalculeOP(OutDoorBill outDoorBill) { try { double totalBill = outDoorBill.TotalBill; double serviceCharge = (totalBill * outDoorBill.servicePercent) / 100; double taxAmount = ((totalBill + serviceCharge) * outDoorBill.Tax) / 100; outDoorBill.ServiceCharge = serviceCharge; outDoorBill.Tax = taxAmount; outDoorBill.SubTotal = taxAmount + outDoorBill.TotalBill + serviceCharge; outDoorBill.discount = outDoorBill.discount; double afterDiscount = Convert.ToDouble(outDoorBill.SubTotal - outDoorBill.discount - outDoorBill.AdvancedPayble); outDoorBill.NetPayble = afterDiscount; // dischargeBill.TotalBill = totalBill; return(outDoorBill); } catch (Exception) { } return(outDoorBill); }