protected void Page_Load(object sender, EventArgs e)
    {
        string functionName = string.Empty;

        functionName = Request.QueryString["FunctionName"].ToString();
        switch (functionName)
        {
        case "CalculateIncome":
            string  Income       = Request.Form["Income"].ToString();
            string  Type         = Request.Form["Type"].ToString();
            DataSet dsIncome     = new DataSet();
            string  ResultIncome = "";
            if (Income.IndexOf('$') >= 0)
            {
                Income = Income.Remove(Income.IndexOf('$'), 1);
            }
            using (SHS.UserBusinessServices.DetailPages objectPlan = new SHS.UserBusinessServices.DetailPages())
            {
                dsIncome = CalculateIncome(Convert.ToDecimal(Income), Type);
                if (dsIncome != null && dsIncome.Tables["Result"].Rows.Count > 0)
                {
                    Income = dsIncome.Tables["Result"].Rows[0]["Income"].ToString();
                }
            }
            Response.Clear();
            Response.Write(Income);
            Response.End();
            break;

        case "GetReferralSubtypeByGlobalCode":
            GetReferralSubtypeByGlobalCodeClientInfo();
            break;
        }
    }
Exemple #2
0
        /// <summary>
        /// Update the dataset object by fetching from the database.
        /// </summary>
        /// <returns>Dataset object.</returns>
        public override DataSet GetData()
        {
            int CustomVocationalJobPlacementId = -1;

            using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
            {
                if (base.GetRequestParameterValue("CustomVocationalJobPlacementId").Length > 0)
                {
                    int.TryParse(base.GetRequestParameterValue("CustomVocationalJobPlacementId"), out CustomVocationalJobPlacementId);
                }
                else // Get AuthorizationcodeId after save
                {
                    if (BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet != null)
                    {
                        if (BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomVocationalJobPlacements"].Rows[0]["CustomVocationalJobPlacementId"] != null)
                        {
                            int.TryParse(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomVocationalJobPlacements"].Rows[0]["CustomVocationalJobPlacementId"].ToString(), out CustomVocationalJobPlacementId);
                        }
                    }
                }
                System.Data.DataSet dataSetCustomVocationalJobPlacement = new System.Data.DataSet();
                dataSetCustomVocationalJobPlacement = (SHS.BaseLayer.BaseCommonFunctions.GetPageDataSet(PageDataSetName));

                DataSet dataSetObject = null;
                if (CustomVocationalJobPlacementId >= 0)
                {
                    dataSetObject = objectCpt.GetJobPlacementDetails(CustomVocationalJobPlacementId);
                    HiddenField_CustomVocationalJobPlacements_CustomVocationalJobPlacementId.Value = dataSetObject.Tables["CustomVocationalJobPlacements"].Rows[0]["CustomVocationalJobPlacementId"].ToString();

                    //if (dataSetObject.Tables["ClientPrograms"].Rows[0]["PrimaryAssignment"].ToString() == "Y")
                    //    CheckBox_ClientPrograms_PrimaryAssignment.Checked = true;
                    //else
                    //    CheckBox_ClientPrograms_PrimaryAssignment.Checked = false;
                }


                if (dataSetObject != null)
                {
                    if (!dataSetObject.IsRowExists("CustomVocationalJobPlacements"))
                    {
                        dataSetObject = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet = base.DocumentInitializeDocument();
                    }

                    try
                    {
                        dataSetCustomVocationalJobPlacement.Merge(dataSetObject);
                    }
                    catch
                    {
                        dataSetCustomVocationalJobPlacement.Merge(dataSetObject);
                    }
                }

                SHS.BaseLayer.BaseCommonFunctions.UnsavedProcessDetailPage(this.ParentDetailPageObject.UnSavedChangeId, 0, this.ParentDetailPageObject.ScreenId, SHS.BaseLayer.SharedTables.StaffSharedTables.UnsavedChanges, this.ParentDetailPageObject, dataSetObject, dataSetCustomVocationalJobPlacement, PageDataSetName);
                return(dataSetCustomVocationalJobPlacement);
            }
        }
Exemple #3
0
        //private void Bind_Filter_Others()
        //{
        //    string OtherFilter = string.Empty;
        //    int Count = 0;
        //    DataView dataViewOthers = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
        //    dataViewOthers.Sort = "SortOrder,CodeName";
        //    DropDownList_Referredby.DataTableGlobalCodes = SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes;
        //    DropDownList_Referredby.FillDropDownDropSubGlobalCodes();
        //    OtherFilter = DropDownList_Referredby.SelectedItem.Text.ToString();
        //    Count = DropDownList_Referredby.Items.Count;

        //}

        private void Bind_Control_Expires()
        {
            if (SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes != null)
            {
                //DataView dataViewExpires = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                //dataViewExpires.RowFilter = "Category like 'XVOCREFEREDBY' and Active='Y' and ISNULL(RecordDeleted,'N')<>'Y'";
                //dataViewExpires.Sort = "SortOrder ";
                //DropDownList_GlobalCodes_CodeName.DataTextField = "CodeName";
                //DropDownList_GlobalCodes_CodeName.DataValueField = "GlobalCodeId";
                //DropDownList_GlobalCodes_CodeName.DataSource = dataViewExpires;
                //DropDownList_GlobalCodes_CodeName.DataBind();


                DataView dataViewExpires = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataViewExpires.RowFilter = "Category like 'XVOCREFEREDBY' and Active='Y' and ISNULL(RecordDeleted,'N')<>'Y'";
                dataViewExpires.Sort      = "CodeName";
                //DropDownList_CustomVocationalJobPlacements_ReferredBy.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomVocationalJobPlacements_ReferredBy.DataTextField  = "CodeName";
                DropDownList_CustomVocationalJobPlacements_ReferredBy.DataValueField = "GlobalCodeId";
                DropDownList_CustomVocationalJobPlacements_ReferredBy.DataSource     = dataViewExpires;
                DropDownList_CustomVocationalJobPlacements_ReferredBy.DataBind();



                dataViewExpires.RowFilter = "Category like 'XVOCPLACEMENTSHIFT' and Active='Y' and ISNULL(RecordDeleted,'N')<>'Y'";
                dataViewExpires.Sort      = "CodeName";
                //DropDownList_CustomVocationalJobPlacements_JobShift.Items.Add(new ListItem("", "-1"));
                // DropDownList_CustomVocationalJobPlacements_JobShift.Items.Add(new ListItem("Select", ""));
                DropDownList_CustomVocationalJobPlacements_JobShift.DataTextField  = "CodeName";
                DropDownList_CustomVocationalJobPlacements_JobShift.DataValueField = "GlobalCodeId";
                DropDownList_CustomVocationalJobPlacements_JobShift.DataSource     = dataViewExpires;
                DropDownList_CustomVocationalJobPlacements_JobShift.DataBind();



                dataViewExpires.RowFilter = "Category like 'XVOCJOBLOSSREASON' and Active='Y' and ISNULL(RecordDeleted,'N')<>'Y'";
                dataViewExpires.Sort      = "CodeName";
                //DropDownList_CustomVocationalJobPlacements_JobShift.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomVocationalJobPlacements_JobLossReason.DataTextField  = "CodeName";
                DropDownList_CustomVocationalJobPlacements_JobLossReason.DataValueField = "GlobalCodeId";
                DropDownList_CustomVocationalJobPlacements_JobLossReason.DataSource     = dataViewExpires;
                DropDownList_CustomVocationalJobPlacements_JobLossReason.DataBind();
                DataTable dataTableStaff = new DataTable("Table");
                dataTableStaff.Columns.Add("StaffID", System.Type.GetType("System.Int32"));
                dataTableStaff.Columns.Add("StaffName", System.Type.GetType("System.String"));
                //dataTableStaff.Columns.Add("StaffCode", System.Type.GetType("System.String"));


                DataRow[] dataViewExpiresStaff = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff.Select("Clinician = 'Y'  and ISNULL(RecordDeleted,'N')<>'Y' ");
                //dataViewExpiresStaff.RowFilter = "Clinician = 'Y'  and ISNULL(RecordDeleted,'N')<>'Y' ";
                DataRow dataRowObject = dataTableStaff.NewRow();
                string  signerName    = string.Empty;
                for (int counter1 = 0; counter1 < dataViewExpiresStaff.Length; counter1++)
                {
                    dataRowObject            = dataTableStaff.NewRow();
                    dataRowObject["StaffID"] = dataViewExpiresStaff[counter1]["StaffId"];
                    signerName = Convert.ToString(dataViewExpiresStaff[counter1]["LastName"]).Trim() + ", " + Convert.ToString(dataViewExpiresStaff[counter1]["FirstName"]).Trim();
                    dataRowObject["StaffName"] = signerName;
                    dataTableStaff.Rows.Add(dataRowObject);
                }
                DataView dataViewStaff = new DataView(dataTableStaff);
                dataViewStaff.Sort = "StaffName";
                //Clinician = 'Y'  and
                // dataViewExpiresStaff.Sort = "FirstName DESC ";
                //Commented by Veena on 13/01/2012
                //DropDownList_CustomVocationalJobPlacements_PlacedBy.DataTextField = "StaffName";
                //DropDownList_CustomVocationalJobPlacements_PlacedBy.DataValueField = "StaffId";
                //DropDownList_CustomVocationalJobPlacements_PlacedBy.DataSource = dataViewStaff;
                //DropDownList_CustomVocationalJobPlacements_PlacedBy.DataBind();


                using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                {
                    DataSet dstGetVocationalPlacedByList = new DataSet();

                    dstGetVocationalPlacedByList = objectCpt.GetVocationalPlacedByList();
                    //DropDownList_CustomVocationalJobPlacements_PlacedBy

                    DropDownList_CustomVocationalJobPlacements_PlacedBy.DataSource = dstGetVocationalPlacedByList.Tables["VocationalPlacedByList"];

                    DropDownList_CustomVocationalJobPlacements_PlacedBy.DataTextField  = "FirstName";
                    DropDownList_CustomVocationalJobPlacements_PlacedBy.DataValueField = "StaffId";
                    DropDownList_CustomVocationalJobPlacements_PlacedBy.DataBind();
                    // DropDownList_CustomVocationalJobPlacements_PlacedBy.Items.Add(new ListItem("", "-1"));
                }
            }
        }
        public void Bind_Control_Expires()
        {
            if (SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes != null)
            {
                //DropDownList_CustomDocumentTransfers_LevelofCare binding
                DataView dataLevelofCare = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataLevelofCare.RowFilter = "Category='XLEVELOFCARE' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataLevelofCare.Sort      = "CodeName";
                //DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomDocumentTransfers_LevelofCare.DataTextField  = "CodeName";
                DropDownList_CustomDocumentTransfers_LevelofCare.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentTransfers_LevelofCare.DataSource     = dataLevelofCare;
                DropDownList_CustomDocumentTransfers_LevelofCare.DataBind();

                //Referring status
                DataView dataRefStatus = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRefStatus.RowFilter = "Category='REFERRALSTATUS' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataRefStatus.Sort      = "CodeName";
                //DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomDocumentTransfers_TransferStatus.DataTextField  = "CodeName";
                DropDownList_CustomDocumentTransfers_TransferStatus.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentTransfers_TransferStatus.DataSource     = dataRefStatus;
                DropDownList_CustomDocumentTransfers_TransferStatus.DataBind();
                if (SetIndex == true)
                {
                    DropDownList_CustomDocumentTransfers_TransferStatus.SelectedIndex = 1;
                }
                //Referral staff
                ///Staff
                DataRow[] DataRowStaff   = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff.Select("Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'");
                DataTable dataTableStaff = new DataTable("Table");
                dataTableStaff.Columns.Add("StaffID", System.Type.GetType("System.Int32"));
                dataTableStaff.Columns.Add("StaffName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("StaffCode", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("clinician", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("adminstaff", System.Type.GetType("System.String"));
                DataRow dataRowObject = dataTableStaff.NewRow();
                string  signerName    = string.Empty;

                //For All Staff User
                for (int counter1 = 0; counter1 < DataRowStaff.Length; counter1++)
                {
                    dataRowObject            = dataTableStaff.NewRow();
                    dataRowObject["StaffID"] = DataRowStaff[counter1]["StaffId"];
                    signerName = Convert.ToString(DataRowStaff[counter1]["LastName"]).Trim() + ", " + Convert.ToString(DataRowStaff[counter1]["FirstName"]).Trim();
                    if (signerName.Length > 27)
                    {
                        dataRowObject["StaffName"] = signerName.Substring(0, 27) + "...";
                    }
                    else
                    {
                        dataRowObject["StaffName"] = signerName;
                    }
                    dataRowObject["StaffCode"]  = DataRowStaff[counter1]["UserCode"];
                    dataRowObject["clinician"]  = DataRowStaff[counter1]["clinician"];
                    dataRowObject["adminstaff"] = DataRowStaff[counter1]["adminstaff"];
                    dataTableStaff.Rows.Add(dataRowObject);
                }

                DataView dataViewStaff = new DataView(dataTableStaff);
                //dataViewStaff.Sort = "StaffNameID,StaffName";
                dataViewStaff.Sort = "StaffName";
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataValueField = "StaffID";
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataSource     = dataViewStaff;
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataBind();

                if (initilization == true)
                {
                    DropDownList_CustomDocumentTransfers_TransferringStaff.ClearSelection();
                    DropDownList_CustomDocumentTransfers_TransferringStaff.Items.FindByValue(BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserId.ToString()).Selected = true;
                    initilization = false;
                }

                //Receiving staff
                DataView dvReceivingStaff = new DataView(dataTableStaff);
                dvReceivingStaff.RowFilter = "clinician='Y' OR adminstaff='Y' ";
                dvReceivingStaff.Sort      = "StaffName";
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataValueField = "StaffID";
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataSource     = dvReceivingStaff;
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataBind();


                //Receiving program
                //DataView dataStaffProgram = new DataView(SHS.BaseLayer.SharedTables.StaffSharedTables.StaffProgram);
                ////DataView dataRecProgram = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                ////dataRecProgram.RowFilter = "Category='RECEIVINGPROGRAM' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                //dataStaffProgram.Sort = "CodeName";
                ////DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataTextField = "CodeName";
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataValueField = "GlobalCodeId";
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataSource = dataStaffProgram;
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataBind();

                //Service

                //DataView dataServices = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.AuthorizationCodes);
                //dataServices.RowFilter = "Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                //dataServices.Sort = "AuthorizationCodeName";
                ////DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataTextField = "AuthorizationCodeName";
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataSource = dataServices;
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataBind();
                using (SHS.UserBusinessServices.ReferralService objectReferralService = new SHS.UserBusinessServices.ReferralService())
                {
                    int      DocumentCodeId          = Convert.ToInt32(BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "Documents") ? BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0]["DocumentCodeId"] : 0);
                    DataSet  datasetReferralService  = objectReferralService.GetReferralService(DocumentCodeId, Convert.ToInt32(BaseCommonFunctions.ApplicationInfo.Client.ClientId));
                    DataView dataViewReferralService = new DataView(datasetReferralService.Tables["AuthorizationCodes"]);
                    dataViewReferralService.Sort = "DisplayAs";
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataTextField  = "DisplayAs";
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataSource     = dataViewReferralService;
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataBind();
                }

                //Receiving action
                DataView dataRecAction = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRecAction.RowFilter = "Category='RECEIVINGACTION' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataRecAction.Sort      = "CodeName";
                //DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataTextField  = "CodeName";
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataSource     = dataRecAction;
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataBind();

                //using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                //{
                //    DataSet dstGetStaffProgeram = new DataSet();
                //   // dstGetStaffProgeram = objectCpt.GetStaffProgeram();
                //    int counter = dstGetStaffProgeram.Tables[0].Rows.Count;
                //    StringBuilder strhidden = new StringBuilder();
                //    for(int i=0;i<counter;i++)
                //    {
                //        strhidden.Append(dstGetStaffProgeram.Tables[0].Rows[i]["Program"]);
                //        strhidden.Append(",");
                //        strhidden.Append(dstGetStaffProgeram.Tables[0].Rows[i]["StaffProgramId"]);
                //        strhidden.Append("||");
                //    }


                //    hiddenProgramList.Value = strhidden.ToString();

                //    // cs.RegisterClientScriptBlock(GetType(), "BodyLoadUnloadScript", "<SCRIPT LANGUAGE='JavaScript'> alert('HAPPY CODING')</script>");


                //    //Page.ClientScript.RegisterClientScriptBlock(GetType(), "MyScript", "<script> alert('HAPPY CODING')</script>");


                //}
                using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                {
                    DataSet dstGetcustomconfigurationsURL = new DataSet();
                    dstGetcustomconfigurationsURL = objectCpt.GetcustomconfigurationsURL();
                    if (dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows.Count > 0)
                    {
                        HyperLink_help.NavigateUrl = Convert.ToString(dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows[0][0]);
                    }
                }
            }
        }
        private void BindControlGeneral()
        {
            if (SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes != null)
            {
                DataRow[] DataRowStaff   = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff.Select("Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'");
                DataTable dataTableStaff = new DataTable("Table");
                dataTableStaff.Columns.Add("StaffID", System.Type.GetType("System.Int32"));
                dataTableStaff.Columns.Add("FirstName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("LastName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("StaffName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("StaffCode", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("clinician", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("adminstaff", System.Type.GetType("System.String"));

                DataRow dataRowObject = dataTableStaff.NewRow();
                string  signerName    = string.Empty;

                //For All Staff User
                for (int counter1 = 0; counter1 < DataRowStaff.Length; counter1++)
                {
                    dataRowObject            = dataTableStaff.NewRow();
                    dataRowObject["StaffID"] = DataRowStaff[counter1]["StaffId"];
                    signerName = Convert.ToString(DataRowStaff[counter1]["LastName"]).Trim() + ", " + Convert.ToString(DataRowStaff[counter1]["FirstName"]).Trim();
                    if (signerName.Length > 27)
                    {
                        dataRowObject["StaffName"] = signerName.Substring(0, 27) + "...";
                    }
                    else
                    {
                        dataRowObject["StaffName"] = signerName;
                    }
                    dataRowObject["FirstName"]  = DataRowStaff[counter1]["FirstName"];
                    dataRowObject["LastName"]   = DataRowStaff[counter1]["LastName"];
                    dataRowObject["StaffCode"]  = DataRowStaff[counter1]["UserCode"];
                    dataRowObject["clinician"]  = DataRowStaff[counter1]["clinician"];
                    dataRowObject["adminstaff"] = DataRowStaff[counter1]["adminstaff"];

                    dataTableStaff.Rows.Add(dataRowObject);
                }

                DataView dataViewStaff = new DataView(dataTableStaff);
                //dataViewStaff.Sort = "StaffNameID,StaffName";
                dataViewStaff.Sort = "StaffName";

                //Referring status
                DataView dataRefStatus = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRefStatus.RowFilter = "Category='REFERRALSTATUS' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataRefStatus.Sort      = "SortOrder";
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataTextField  = "CodeName";
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataSource     = dataRefStatus;
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataBind();
                if (SetIndex == true)
                {
                    DropDownList_CustomDocumentReferrals_ReferralStatus.SelectedIndex = 1;
                }
                //Referral DocumentReferrals


                DropDownList_CustomDocumentReferrals_ReferringStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentReferrals_ReferringStaff.DataValueField = "StaffId";
                DropDownList_CustomDocumentReferrals_ReferringStaff.DataSource     = dataViewStaff;
                DropDownList_CustomDocumentReferrals_ReferringStaff.DataBind();
                if (initilization == true)
                {
                    DropDownList_CustomDocumentReferrals_ReferringStaff.ClearSelection();
                    DropDownList_CustomDocumentReferrals_ReferringStaff.Items.FindByValue(BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserId.ToString()).Selected = true;
                    initilization = false;
                }
                //Receiving DocumentReferrals

                DataView dvReceivingStaff = new DataView(dataTableStaff);
                dvReceivingStaff.RowFilter = "clinician='Y' OR adminstaff='Y' ";
                dvReceivingStaff.Sort      = "StaffName";
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataValueField = "StaffId";
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataSource     = dvReceivingStaff;
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataBind();

                //Receiving program
                //DataView dataRecProgram = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.Programs);
                //dataRecProgram.RowFilter = "Active='Y' AND ISNULL(RecordDeleted,'N')='N'";
                //dataRecProgram.Sort = "ProgramName";
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataTextField = "ProgramName";
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataValueField = "ProgramId";
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataSource = dataRecProgram;
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataBind();

                //DataView dataServices = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.AuthorizationCodes);
                //dataServices.RowFilter = "Active='Y' AND ISNULL(RecordDeleted,'N')='N'";
                //dataServices.Sort = "AuthorizationCodeName";
                ////DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataTextField = "AuthorizationCodeName";
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataSource = dataServices;
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataBind();

                //Service
                //Modify by :RohitK,on 06-19-2012,1796,#81 Services Drop-Downs,Harbor Go Live Issues
                //This stored procedure is designed to restrict the authorization codes available based on DocumentCodeId and ClientId
                using (SHS.UserBusinessServices.ReferralService objectReferralService = new SHS.UserBusinessServices.ReferralService())
                {
                    int      DocumentCodeId          = Convert.ToInt32(BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "Documents") ? BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0]["DocumentCodeId"] : 0);
                    DataSet  datasetReferralService  = objectReferralService.GetReferralService(DocumentCodeId, Convert.ToInt32(BaseCommonFunctions.ApplicationInfo.Client.ClientId));
                    DataView dataViewReferralService = new DataView(datasetReferralService.Tables["AuthorizationCodes"]);
                    dataViewReferralService.Sort = "DisplayAs";
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataTextField  = "DisplayAs";
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataSource     = dataViewReferralService;
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataBind();
                }

                //Receiving action
                DataView dataRecAction = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRecAction.RowFilter = "Category='RECEIVINGACTION' AND Active='Y' AND ISNULL(RecordDeleted,'N')='N'";
                dataRecAction.Sort      = "SortOrder";
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataTextField  = "CodeName";
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataSource     = dataRecAction;
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataBind();


                using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                {
                    DataSet dstGetcustomconfigurationsURL = new DataSet();
                    dstGetcustomconfigurationsURL = objectCpt.GetcustomconfigurationsURL();
                    if (dstGetcustomconfigurationsURL != null)
                    {
                        if (dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows.Count > 0)
                        {
                            HyperLink_help.NavigateUrl = Convert.ToString(dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows[0][0]);
                        }
                    }
                }
            }
            CustomGrid.Bind(ParentDetailPageObject.ScreenId);
        }