protected void btn_AppointmentSaveAppoint_Click(object sender, EventArgs e)
    {
        try
        {
            DataSet ds_AppoInfo;
            objPatient          = new Base_BLL_Patient();
            objPatient.FullName = txtPatient_Name.Text;

            if (rdo_new.Checked)
            {
                objPatient.IsNew = 1;
            }
            else
            {
                objPatient.IsNew = 0;
            }

            if (rdo_local.Checked)
            {
                objPatient.IsLocalite = 1;
            }
            else
            {
                objPatient.IsLocalite = 0;
            }



            DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
            dtfi.ShortDatePattern = "dd-MM-yyyy";
            dtfi.DateSeparator    = "-";
            DateTime objDate = Convert.ToDateTime(txt_appointmentDate.Text, dtfi);


            objPatient.AppointmentDate = objDate.ToString("MM-dd-yyyy");
            ds_AppoInfo = objPatient.InsertAndAppoint();
            if (ds_AppoInfo != null && ds_AppoInfo.Tables[0].Rows.Count > 0)
            {
                lbl_INFO_PatientId.Text   = ds_AppoInfo.Tables[0].Rows[0]["Patient_ID"].ToString();
                lbl_INFO_Patientname.Text = ds_AppoInfo.Tables[0].Rows[0]["FullName"].ToString();
                lbl_INFO_TockenNo.Text    = ds_AppoInfo.Tables[0].Rows[0]["Tocken_No"].ToString();
                lbl_INFO_appoDate.Text    = txt_appointmentDate.Text;
                lbl_INFO_appTime.Text     = ds_AppoInfo.Tables[0].Rows[0]["ApproxTime"].ToString();
                lbl_INFO_fees.Text        = ds_AppoInfo.Tables[0].Rows[0]["Fees"].ToString();

                uc_error.ErrorMessage = "Appointment Saved Succesffully";
                uc_error.IsError      = false;
            }
            ClearControl();

            ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "ClearValues();", true);
        }
        catch (Exception ex)
        {
            uc_error.ErrorMessage = "Error: " + ex.Message + " Please Contact System Administrator!";
            uc_error.IsError      = true;
        }
    }
 protected void FillData()
 {
     try
     {
         Base_BLL_Patient Obj_Patient = new Base_BLL_Patient();
         DataSet          Ds_Data     = Obj_Patient.GetPatientList();
         UC_ListGrid_New1.Data = Ds_Data;
     }
     catch (Exception ex)
     {
         uc_footer1.ShowMessage(MessageType.Error, ex.Message, false, MessagePosition.Top, false);
     }
 }
Example #3
0
    public void EditMode_FILLDATA(int id)
    {
        //rdo_new.Enabled = true;
        //rdo_old.Enabled = true;

        //rdo_local.Enabled = true;
        //rdo_outside.Enabled = true;

        objPatient = new Base_BLL_Patient();
        objPatient.GetPatient(id);

        txtPatient_ID.Text = Convert.ToString(id);

        txtPatient_Name.Text = objPatient.FullName;

        if (objPatient.IsNew == 1)
        {
            rdo_new.Checked = true;
            rdo_old.Checked = false;
        }
        else
        {
            rdo_new.Checked = false;
            rdo_old.Checked = true;
        }

        if (objPatient.IsLocalite == 1)
        {
            rdo_local.Checked   = true;
            rdo_outside.Checked = false;
        }
        else
        {
            rdo_local.Checked   = false;
            rdo_outside.Checked = true;
        }
        rdo_new.Enabled = false;
        rdo_old.Enabled = false;

        rdo_local.Enabled   = false;
        rdo_outside.Enabled = false;

        txt_appointmentDate.Text = objPatient.AppointmentDate;
        //Testing
    }
Example #4
0
    protected void btn_AppointmentSaveAppoint_Click(object sender, EventArgs e)
    {
        try
        {
            //========================================================================================
            //    ADD MODE
            //========================================================================================
            DataSet            ds_AppoInfo = new DataSet();
            DateTimeFormatInfo dtfi;

            objPatient = new Base_BLL_Patient();

            objPatient.PK_PatientID = txtPatient_ID.Text != "" ? Convert.ToInt32(txtPatient_ID.Text) : 0;
            objPatient.FullName     = txtPatient_Name.Text;

            if (rdo_new.Checked)
            {
                objPatient.IsNew = 1;
            }
            else
            {
                objPatient.IsNew = 0;
            }

            if (rdo_local.Checked)
            {
                objPatient.IsLocalite = 1;
            }
            else
            {
                objPatient.IsLocalite = 0;
            }


            dtfi = new DateTimeFormatInfo();
            dtfi.ShortDatePattern = "dd-MM-yyyy";
            dtfi.DateSeparator    = "-";
            DateTime objDate = Convert.ToDateTime(txt_appointmentDate.Text, dtfi);


            objPatient.AppointmentDate = objDate.ToString("MM-dd-yyyy");



            if (chk_demandTime.Checked)
            {
                objPatient.IsDemandTimeAppointment = 1;
                objPatient.AppointmentTime         = txt_appointmentTime.Text;
                String s = objPatient.Appointment_Validate();
                ds_AppoInfo = objPatient.InsertAndAppoint_DimandTimeAppo();
            }
            else if (!chk_demandTime.Checked)
            {
                objPatient.IsDemandTimeAppointment = 0;
                objPatient.AppointmentTime         = "";
                ds_AppoInfo = objPatient.InsertAndAppoint();
            }


            if (ds_AppoInfo != null && ds_AppoInfo.Tables[0].Rows.Count > 0)
            {
                lbl_INFO_PatientId.Text   = ds_AppoInfo.Tables[0].Rows[0]["Patient_ID"].ToString();
                lbl_INFO_Patientname.Text = ds_AppoInfo.Tables[0].Rows[0]["FullName"].ToString();
                lbl_INFO_TockenNo.Text    = ds_AppoInfo.Tables[0].Rows[0]["Tocken_No"].ToString();
                lbl_INFO_appoDate.Text    = txt_appointmentDate.Text;
                lbl_INFO_appTime.Text     = ds_AppoInfo.Tables[0].Rows[0]["ApproxTime"].ToString();
                lbl_INFO_fees.Text        = ds_AppoInfo.Tables[0].Rows[0]["Fees"].ToString();

                // .Text = ds_AppoInfo.Tables[0].Rows[0]["Fees"].ToString();

                uc_error.ErrorMessage = "Appointment Saved Succesffully";
                uc_error.IsError      = false;
            }

            ClearControl();

            ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "ClearValues();", true);
            //}
            //else
            //{
            //    //========================================================================================
            //    //    EDIT MODE
            //    //========================================================================================

            //    objPatient = new Base_BLL_Patient();
            //    objPatient.PK_PatientID = Convert.ToInt32(txtPatient_ID.Text);

            //    objPatient.FullName = txtPatient_Name.Text;

            //    if (rdo_new.Checked)
            //        objPatient.IsNew = 1;
            //    else
            //        objPatient.IsNew = 0;

            //    if (rdo_local.Checked)
            //        objPatient.IsLocalite = 1;
            //    else
            //        objPatient.IsLocalite = 0;
            //    FillAppointmentQueue();
            //    objPatient.Update();
            //    ScriptManager.RegisterStartupScript(this, this.GetType(), "CloseAA", "Fn_CLosePopUp();", true);

            //}
        }
        catch (Exception ex)
        {
            uc_error.ErrorMessage = "Error: " + ex.Message + " Please Contact System Administrator!";
            uc_error.IsError      = true;
        }
    }