Example #1
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
    }