public int SaveDischargeBill(DischargeBillNICU aDischargeBill)
        {
            Query = "INSERT INTO [dbo].[tbl_DischargeBillNICU]([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);
        }
Example #2
0
        public DischargeBillNICU GetDischargeBillNICU(DischargeBillNICU aNicuDischargeBill)
        {
            DataTable dt = new NICUBillGateway().GetDischargeBillNICUByPatient(aNicuDischargeBill.OPID);

            aNicuDischargeBill.OPID        = dt.Rows[0]["OPID"].ToString();
            aNicuDischargeBill.PatientName = dt.Rows[0]["MotherName"].ToString();
            aNicuDischargeBill.DiscTime    = dt.Rows[0]["DischargeTime"].ToString();
            aNicuDischargeBill.NoOfDay     = dt.Rows[0]["NoOfDay"].ToString();
            //aNicuDischargeBill.DeisDate = Convert.ToDateTime(dt.Rows[0]["DischargeOn"]).Date;
            aNicuDischargeBill.RegNo       = dt.Rows[0]["RegNo"].ToString();
            aNicuDischargeBill.PatientBill = dt;
            //aNicuDischargeBill.OTMedicine = Convert.ToDouble(dt.Rows[0]["OT_Med_Total"]);
            //aNicuDischargeBill.HospitalCharge = Convert.ToDouble(dt.Rows[0]["Hsptl_Total"]);
            //aNicuDischargeBill.OTservice = Convert.ToDouble(dt.Rows[0]["OT_Total"]);
            //aNicuDischargeBill.PharmacyBill = Convert.ToDouble(dt.Rows[0]["Phar_Total"]);
            //aNicuDischargeBill.Age = dt.Rows[0]["Age"].ToString();
            //aNicuDischargeBill.BloodGroup = dt.Rows[0]["BloodGroup"].ToString();
            ////  opidDischargeBill.OT_TOtalBill = dt.Rows[0]["OT_TOtalBill"].ToString();
            //aNicuDischargeBill.PBill = Convert.ToDouble(dt.Rows[0]["Path_Total"].ToString());
            //aNicuDischargeBill.NoOfDay = dt.Rows[0]["NoOfDay"].ToString();
            //aNicuDischargeBill.TotalBedCharge = dt.Rows[0]["cabin_Total"].ToString();
            //aNicuDischargeBill.TConsultBill = dt.Rows[0]["Con_Total"].ToString();
            //aNicuDischargeBill.TotalBill = Convert.ToDouble(dt.Rows[0]["TotalBill"]);
            aNicuDischargeBill.AdvancedPayble = Convert.ToDouble(dt.Rows[0]["Advance"]);
            return(aNicuDischargeBill);
        }
Example #3
0
        public MessageModel SaveDischargeBill(DischargeBillNICU aDischargeBill, List <DischargeBillNICU> aDischargeBillNicus)
        {
            MessageModel message = new MessageModel();
            int          count   = new NICUBillGateway().SaveDischargeBill(aDischargeBill);

            if (count > 0)
            {
                count = new NICUBillGateway().SaveParticular(aDischargeBillNicus);
            }
            if (count > 0)
            {
                message.MessageBody  = "Save Discharge Bill Successfully";
                message.MessageTitle = "NICU Discharge";
            }
            return(message);
        }
Example #4
0
        public static DischargeBillNICU VateCalcule(DischargeBillNICU dischargeBill)
        {
            try
            {
                double totalBill     = dischargeBill.TotalBill;
                double serviceCharge = (totalBill * dischargeBill.servicePercent) / 100;
                double taxAmount     = ((totalBill + serviceCharge) * dischargeBill.Tax) / 100;

                dischargeBill.ServiceCharge = serviceCharge;
                dischargeBill.Tax           = taxAmount;
                dischargeBill.SubTotal      = taxAmount + dischargeBill.TotalBill + serviceCharge;
                dischargeBill.discount      = dischargeBill.discount;
                double afterDiscount = Convert.ToDouble(dischargeBill.SubTotal - dischargeBill.discount - dischargeBill.AdvancedPayble);
                dischargeBill.NetPayble = afterDiscount;
                // dischargeBill.TotalBill = totalBill;
                return(dischargeBill);
            }
            catch (Exception)
            {
            }
            return(dischargeBill);
        }