Showing posts with label govt employee hospital charge calculations. Show all posts
Showing posts with label govt employee hospital charge calculations. Show all posts

Sunday, July 29, 2018

how to create hospital management system | sradha webcreations


hospital management system 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

public partial class IF_ELSE_AND_OR_HospitalChargesForEmployee : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void TextBoxEMPHospitalLeaveDate_TextChanged(object sender, EventArgs e)
    {
        string sEmployeeName = TextBoxEMPNAME.Text;
        string sEmployeeDesignation = TextBoxEMPDESIGNATION.Text;
        double dBasicSalary = Convert.ToDouble(TextBoxEMPSALARY.Text);

        string sEntryDate = TextBoxEMPHospitalEntryDate.Text;
        DateTime DE = Convert.ToDateTime(sEntryDate);

        string sLeaveDate = TextBoxEMPHospitalLeaveDate.Text;
        DateTime DL = Convert.ToDateTime(sLeaveDate);

        int iTotalDyInHospital;
        iTotalDyInHospital=((TimeSpan)(DL-DE)).Days;
        TextBoxDayInHospital.Text = Convert.ToString(iTotalDyInHospital);

        double dTotalCharge;

        string sAttandandt = DropDownListATTENDANDT.Text;

        if (dBasicSalary > 4000 && dBasicSalary < 2000)
        {
            if (sAttandandt == "YES")
            {
  dTotalCharge= (iTotalDyInHospital * 50) + (iTotalDyInHospital * 30);
            }
            else
            {
                dTotalCharge= (iTotalDyInHospital * 50);
            }
     TextBoxHOSPITALCHARGE.Text = Convert.ToString(dTotalCharge);
        }

else if(dBasicSalary>4000 && dBasicSalary<6000)
{
    if(sAttandandt=="YES")
    {
    dTotalCharge=(iTotalDyInHospital*100)+(iTotalDyInHospital*30);
    }
    else
    {
        dTotalCharge=(iTotalDyInHospital*100);
    }
    TextBoxHOSPITALCHARGE.Text = Convert.ToString(dTotalCharge);

}
        else if(dBasicSalary>6000 && dBasicSalary<8000)
        {
            if(sAttandandt=="YES")
            {
                dTotalCharge=(iTotalDyInHospital*150)+(iTotalDyInHospital*30);
            }
            else
            {
                dTotalCharge=(iTotalDyInHospital*150);
            }
    TextBoxHOSPITALCHARGE.Text = Convert.ToString(dTotalCharge);
        }

        else if(dBasicSalary>8000 && dBasicSalary<10000)
        {
            if(sAttandandt=="YES")
            {
                dTotalCharge=(iTotalDyInHospital*200)+(iTotalDyInHospital*30);
            }
            else
            {
                dTotalCharge=(iTotalDyInHospital*200);
            }
    TextBoxHOSPITALCHARGE.Text = Convert.ToString(dTotalCharge);
        }
           
        else if(dBasicSalary>1000)
        {
            if(sAttandandt=="YES")
            {
                dTotalCharge=(iTotalDyInHospital*250)+(iTotalDyInHospital*30);
            }
            else
            {
                dTotalCharge=iTotalDyInHospital*250;
            }

   TextBoxHOSPITALCHARGE.Text = Convert.ToString(dTotalCharge);
        }
        //TextBoxHOSPITALCHARGE.Text = Convert.ToString(dTotalCharge);
    }