Beispiel #1
0
    protected void extddlDoctor_extendDropDown_SelectedIndexChanged(object sender, EventArgs e)
    {
        Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();

        if (_bill_Sys_Calender.CheckReferralExists(extddlDoctor.Text, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID))
        {
            //RowProcedureCode.Visible = true;
            GetProcedureCode(extddlDoctor.Text);
        }
        else
        {
            lstProcedureCode.Items.Clear();
            //RowProcedureCode.Visible = false;
        }
    }
Beispiel #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        try
        {
            Boolean _valid = true;
            if (ddlStatus.SelectedValue == "1")
            {
                if (txtReScheduleDate.Text == "" && ddlReSchHours.SelectedValue == "00")
                {
                    lblMessage.Text = "Please enter Res-Schedule Date and Time";
                    _valid          = false;
                }
            }
            else if (ddlStatus.SelectedValue == "2")
            {
                if (ddlTestNames.GetSelectedIndices().Length == 0)
                {
                    lblMessage.Text = "Please select procedure";
                    _valid          = false;
                }

                DateTime dtPassDate;
                dtPassDate = Convert.ToDateTime(lblDate.Text);
                if (dtPassDate > DateTime.Now)
                {
                    lblMessage.Text = "Cannot complete visit at future date.";
                    _valid          = false;
                }
            }
            else if (ddlStatus.SelectedValue == "3")
            {
                DateTime dtPassDate;
                dtPassDate = Convert.ToDateTime(lblDate.Text);
                if (dtPassDate > DateTime.Now)
                {
                    lblMessage.Text = "Cannot no show visit at future date.";
                    _valid          = false;
                }
            }
            if (_valid == true)
            {
                string            eventID            = Request.QueryString["id"].ToString();
                Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                ArrayList         objAdd;
                if (ddlStatus.SelectedValue == "2")
                {
                    foreach (ListItem lst in ddlTestNames.Items)
                    {
                        if (lst.Selected == true)
                        {
                            objAdd = new ArrayList();
                            objAdd.Add(lst.Value);
                            objAdd.Add(eventID);
                            objAdd.Add(ddlStatus.SelectedValue);
                            _bill_Sys_Calender.Update_Event_RefferPrcedure(objAdd);

                            Bill_Sys_ReferalEvent _bill_Sys_ReferalEvent = new Bill_Sys_ReferalEvent();
                            ArrayList             arrOBJ = new ArrayList();
                            arrOBJ.Add(lblDoctorID.Text);
                            arrOBJ.Add(lst.Value);
                            arrOBJ.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                            arrOBJ.Add(lst.Value);
                            _bill_Sys_ReferalEvent.AddDoctorAmount(arrOBJ);

                            _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lst.Value, true, "");
                        }
                        else
                        {
                            _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lst.Value, false, eventID);
                        }
                    }
                }
                else if (ddlStatus.SelectedValue == "1")
                {
                    objAdd = new ArrayList();
                    objAdd.Add(txtCaseID.Text);
                    objAdd.Add(txtReScheduleDate.Text);
                    objAdd.Add(ddlReSchHours.SelectedValue.ToString() + "." + ddlReSchMinutes.SelectedValue.ToString());
                    objAdd.Add(txtNotes.Text);
                    objAdd.Add(lblDoctorID.Text);
                    objAdd.Add(lblTypeCode.Text);
                    objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    objAdd.Add(ddlReSchTime.SelectedValue);
                    ////////////////
                    int    endMin  = Convert.ToInt32(ddlReSchMinutes.SelectedValue) + Convert.ToInt32("30");
                    int    endHr   = Convert.ToInt32(ddlReSchHours.SelectedValue);
                    string endTime = ddlReSchTime.SelectedValue;
                    if (endMin >= 60)
                    {
                        endMin = endMin - 60;
                        endHr  = endHr + 1;
                        if (endHr > 12)
                        {
                            endHr = endHr - 12;
                            if (ddlReSchHours.SelectedValue != "12")
                            {
                                if (endTime == "AM")
                                {
                                    endTime = "PM";
                                }
                                else if (endTime == "PM")
                                {
                                    endTime = "AM";
                                }
                            }
                        }
                        else if (endHr == 12)
                        {
                            if (ddlReSchHours.SelectedValue != "12")
                            {
                                if (endTime == "AM")
                                {
                                    endTime = "PM";
                                }
                                else if (endTime == "PM")
                                {
                                    endTime = "AM";
                                }
                            }
                        }
                    }

                    //ddlEndHours.SelectedValue = endHr.ToString().PadLeft(2, '0');
                    //ddlEndMinutes.SelectedValue = endMin.ToString().PadLeft(2, '0');
                    //ddlEndTime.SelectedValue = endTime.ToString();
                    /////////////////
                    objAdd.Add(endHr.ToString().PadLeft(2, '0').ToString() + "." + endMin.ToString().PadLeft(2, '0').ToString());
                    objAdd.Add(endTime.ToString());
                    _bill_Sys_Calender.SaveEvent(objAdd, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID.ToString());
                    objAdd = new ArrayList();
                    objAdd.Add(txtCaseID.Text);
                    objAdd.Add(lblDoctorID.Text);
                    objAdd.Add(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
                    int reScheventID = _bill_Sys_Calender.GetEventID(objAdd);
                    if (_bill_Sys_Calender.CheckReferralExists(lblDoctorID.Text, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID) == true)
                    {
                        foreach (ListItem lstItem in ddlTestNames.Items)
                        {
                            if (lstItem.Selected == true)
                            {
                                objAdd = new ArrayList();
                                objAdd.Add(lstItem.Value);
                                objAdd.Add(reScheventID);
                                objAdd.Add(0);
                                _bill_Sys_Calender.Update_Event_RefferPrcedure(objAdd, eventID);
                                //              _bill_Sys_Calender.Save_Event_RefferPrcedure(objAdd);


                                _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lstItem.Value, true, "");
                            }
                            else
                            {
                                _bill_Sys_Calender.UpdateProcedure(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, lblDoctorID.Text, lstItem.Value, false, reScheventID.ToString());
                            }
                        }
                    }
                }

                _bill_Sys_Calender = new Bill_Sys_Calender();
                objAdd             = new ArrayList();
                objAdd.Add(eventID);
                objAdd.Add(false);
                objAdd.Add(ddlStatus.SelectedValue);
                _bill_Sys_Calender.UPDATE_Event_Status(objAdd);
                // Start : Save appointment Notes.

                _DAO_NOTES_EO = new DAO_NOTES_EO();
                _DAO_NOTES_EO.SZ_MESSAGE_TITLE = "APPOINTMENT_UPDATED";
                //  _DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Date : " + lblDate.Text;

                _DAO_NOTES_EO.SZ_ACTIVITY_DESC = "Date : " + lblDate.Text.Substring(0, lblDate.Text.IndexOf(" ")) + " " + lblHours.Text + ":" + lblMinutes.Text + " " + lblTime.Text;

                _DAO_NOTES_BO               = new DAO_NOTES_BO();
                _DAO_NOTES_EO.SZ_USER_ID    = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
                _DAO_NOTES_EO.SZ_CASE_ID    = txtCaseID.Text;
                _DAO_NOTES_EO.SZ_COMPANY_ID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
                _DAO_NOTES_BO.SaveActivityNotes(_DAO_NOTES_EO);


                // End
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ss", "<script language='javascript'>  parent.document.getElementById('divid').style.visibility = 'hidden';window.parent.document.location.href=window.parent.document.location.href;window.self.close();window.parent.document.location.reload(); parent.document.getElementById('lblMsg').value='Event added successfully.';</script>");
            }
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        btnSave.Attributes.Add("onclick", "return formValidator('form1','ddlStatus');");
        btnDelete.Attributes.Add("onclick", "return ConfirmDelete();");
        if (!IsPostBack)
        {
            BindTimeControl();
            string id = Request.QueryString["id"].ToString();
            txtEventID.Text = id;
            Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
            DataTable         dt = new DataTable();
            dt = _bill_Sys_Calender.GET_EVENT_DETAIL(id);
            if (dt.Rows.Count > 0)
            {
                for (int drRow = 0; drRow <= dt.Rows.Count - 1; drRow++)
                {
                    lblDoctorName.Text = dt.Rows[drRow].ItemArray.GetValue(0).ToString();
                    lblType.Text       = dt.Rows[drRow].ItemArray.GetValue(1).ToString();

                    lblHours.Text           = dt.Rows[drRow].ItemArray.GetValue(3).ToString();
                    lblMinutes.Text         = dt.Rows[drRow].ItemArray.GetValue(4).ToString();
                    lblTime.Text            = dt.Rows[drRow].ItemArray.GetValue(5).ToString();
                    lblEndHours.Text        = dt.Rows[drRow].ItemArray.GetValue(6).ToString();
                    lblEndMinutes.Text      = dt.Rows[drRow].ItemArray.GetValue(7).ToString();
                    lblEndTime.Text         = dt.Rows[drRow].ItemArray.GetValue(8).ToString();
                    txtNotes.Text           = dt.Rows[drRow].ItemArray.GetValue(9).ToString();
                    lblDoctorID.Text        = dt.Rows[drRow].ItemArray.GetValue(10).ToString();
                    lblTypeCode.Text        = dt.Rows[drRow].ItemArray.GetValue(11).ToString();
                    lblPatientID.Text       = dt.Rows[drRow].ItemArray.GetValue(12).ToString();
                    lblDate.Text            = dt.Rows[drRow].ItemArray.GetValue(13).ToString();
                    ddlStatus.SelectedValue = dt.Rows[drRow].ItemArray.GetValue(15).ToString();
                    txtCaseID.Text          = dt.Rows[drRow].ItemArray.GetValue(16).ToString();

                    if (_bill_Sys_Calender.CheckReferralExists(lblDoctorID.Text, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID) == true)
                    {
                        if (ddlStatus.SelectedValue == "2")
                        {
                            ddlTestNames.DataSource = _bill_Sys_Calender.GetAssociatedProcCodeList(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, dt.Rows[drRow].ItemArray.GetValue(10).ToString(), "GETCOMPLETEVISITCODE", txtCaseID.Text, id);
                        }
                        else
                        {
                            ddlTestNames.DataSource = _bill_Sys_Calender.GetAssociatedProcCodeList(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, dt.Rows[drRow].ItemArray.GetValue(10).ToString(), "GETALLCODE", txtCaseID.Text, id);
                        }
                        ddlTestNames.DataTextField  = "DESCRIPTION";
                        ddlTestNames.DataValueField = "CODE";
                        ddlTestNames.DataBind();
                    }
                    else
                    {
                        ddlTestNames.DataSource     = _bill_Sys_Calender.GetReferringProcCodeList(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, dt.Rows[drRow].ItemArray.GetValue(10).ToString());
                        ddlTestNames.DataTextField  = "DESCRIPTION";
                        ddlTestNames.DataValueField = "CODE";
                        ddlTestNames.DataBind();
                    }

                    // if (dt.Rows[drRow].ItemArray.GetValue(14).ToString() == "True" || ddlStatus.SelectedValue=="2" )
                    // {
                    //btnUpdate.Visible = true;
                    ds            = new DataSet();
                    _patient_TVBO = new Patient_TVBO();
                    ds            = _patient_TVBO.GetAppointProcCode(Convert.ToInt32(id));
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        foreach (ListItem lst in ddlTestNames.Items)
                        {
                            if (lst.Value == dr.ItemArray.GetValue(0).ToString())
                            {
                                lst.Selected = true;
                            }
                        }
                    }
                    //}
                    if (ddlStatus.SelectedValue != "0")
                    {
                        lblMessage.Visible = true;
                        lblMessage.Text    = ddlStatus.SelectedItem.Text;
                        btnSave.Visible    = false;
                    }
                    if (dt.Rows[drRow]["BT_STATUS"].ToString().ToLower() == "false")
                    {
                        btnDelete.Visible = true;
                    }
                    else
                    {
                        btnDelete.Visible = false;
                    }
                }
            }



            GETAppointPatientDetail(Convert.ToInt32(id));
            //}
        }
        #region "check version readonly or not"
        string app_status = ((Bill_Sys_BillingCompanyObject)Session["APPSTATUS"]).SZ_READ_ONLY.ToString();
        if (app_status.Equals("True"))
        {
            Bill_Sys_ChangeVersion cv = new Bill_Sys_ChangeVersion(this.Page);
            cv.MakeReadOnlyPage("ViwScheduled.aspx");
        }
        #endregion
    }
Beispiel #4
0
    public string SaveEvent(ArrayList arrEventInfo)
    {
        string szResult = "";

        conn = new SqlConnection(strConn);
        conn.Open();
        SqlTransaction transaction;

        transaction = conn.BeginTransaction();

        try
        {
            for (int icount = 0; icount < arrEventInfo.Count; icount++)
            {
                Bill_Sys_Event_DAO objEvent = new Bill_Sys_Event_DAO();

                objEvent = (Bill_Sys_Event_DAO)arrEventInfo[icount];

                comm = new SqlCommand();
                comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString());
                comm.CommandText    = "SP_TXN_CALENDAR_EVENT";
                comm.CommandType    = CommandType.StoredProcedure;
                comm.Connection     = conn;
                comm.Transaction    = transaction;
                comm.Parameters.AddWithValue("@SZ_CASE_ID ", objEvent.SZ_CASE_ID);
                comm.Parameters.AddWithValue("@DT_EVENT_DATE", objEvent.DT_EVENT_DATE);
                comm.Parameters.AddWithValue("@DT_EVENT_TIME", objEvent.DT_EVENT_TIME);
                comm.Parameters.AddWithValue("@SZ_EVENT_NOTES", objEvent.SZ_EVENT_NOTES);
                comm.Parameters.AddWithValue("@SZ_DOCTOR_ID", objEvent.SZ_DOCTOR_ID);
                comm.Parameters.AddWithValue("@SZ_TYPE_CODE_ID", objEvent.SZ_TYPE_CODE_ID);
                comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID);
                comm.Parameters.AddWithValue("@DT_EVENT_TIME_TYPE", objEvent.DT_EVENT_TIME_TYPE);
                comm.Parameters.AddWithValue("@DT_EVENT_END_TIME", objEvent.DT_EVENT_END_TIME);
                comm.Parameters.AddWithValue("@DT_EVENT_END_TIME_TYPE", objEvent.DT_EVENT_END_TIME_TYPE);
                comm.Parameters.AddWithValue("@FLAG", "ADD");
                comm.Parameters.AddWithValue("@I_STATUS", "0");
                comm.Parameters.AddWithValue("@SZ_USER_ID", objEvent.SZ_USER_ID);
                comm.Parameters.AddWithValue("@SZ_VISIT_TYPE", objEvent.SZ_VISIT_TYPE);
                comm.ExecuteNonQuery();
                int eventID = 0;
                comm = new SqlCommand();
                comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString());
                comm.CommandText    = "GET_EVENT_ID";
                comm.CommandType    = CommandType.StoredProcedure;
                comm.Connection     = conn;
                comm.Transaction    = transaction;
                comm.Parameters.AddWithValue("@SZ_CASE_ID ", objEvent.SZ_CASE_ID);
                comm.Parameters.AddWithValue("@SZ_DOCTOR_ID", objEvent.SZ_DOCTOR_ID);
                comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID);
                SqlDataReader dr = comm.ExecuteReader();

                while (dr.Read())
                {
                    if (dr[0] != DBNull.Value)
                    {
                        eventID = (int)dr[0];
                    }
                }
                dr.Close();
                Bill_Sys_Calender _bill_Sys_Calender = new Bill_Sys_Calender();
                if (_bill_Sys_Calender.CheckReferralExists(objEvent.SZ_DOCTOR_ID, objEvent.SZ_COMPANY_ID) == true)
                {
                    comm = new SqlCommand();
                    comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString());
                    comm.CommandText    = "UPDATE_EVENT_STATUS";
                    comm.CommandType    = CommandType.StoredProcedure;
                    comm.Connection     = conn;
                    comm.Transaction    = transaction;
                    comm.Parameters.AddWithValue("@I_EVENT_ID ", eventID.ToString());
                    comm.Parameters.AddWithValue("@BT_STATUS", "false");

                    comm.Parameters.AddWithValue("@I_STATUS", "0");
                    comm.ExecuteNonQuery();
                }

                string      szActiveDesc = "Date : " + objEvent.DT_EVENT_DATE + objEvent.DT_EVENT_TIME + objEvent.DT_EVENT_TIME_TYPE;
                XmlDocument doc          = new XmlDocument();
                doc.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "XML/ActivityNotesXML.xml");
                XmlNodeList nl         = doc.SelectNodes("NOTES/" + "APPOINTMENT_ADDED" + "/MESSAGE");
                string      strMessage = szActiveDesc + " " + nl.Item(0).InnerText;
                comm = new SqlCommand();
                comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString());
                comm.CommandText    = "SP_TXN_NOTES";
                comm.CommandType    = CommandType.StoredProcedure;
                comm.Connection     = conn;
                comm.Transaction    = transaction;

                comm.Parameters.AddWithValue("@SZ_NOTE_CODE", "NOT1004");
                comm.Parameters.AddWithValue("@SZ_CASE_ID", objEvent.SZ_CASE_ID);
                comm.Parameters.AddWithValue("@SZ_USER_ID", objEvent.SZ_USER_ID);
                comm.Parameters.AddWithValue("@SZ_NOTE_TYPE", "NTY0001");
                comm.Parameters.AddWithValue("@SZ_NOTE_DESCRIPTION", strMessage);
                comm.Parameters.AddWithValue("@IS_DENIED", objEvent.IS_DENIED);
                comm.Parameters.AddWithValue("@SZ_COMPANY_ID", objEvent.SZ_COMPANY_ID);
                comm.Parameters.AddWithValue("@FLAG", "ADD");
                comm.ExecuteNonQuery();
            }
            transaction.Commit();
            szResult = "success";
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            transaction.Rollback();
        }
        finally
        {
            conn.Close();
        }
        return(szResult);
    }