public void CustomGrid_BeforeDataBound(object sender, CustomGridDataBindEventArgs args)
    {
        DataSet datasetProviders = new DataSet();

        datasetProviders = getPrimaryCarePhysician();
        DataSet DatasetParentScreen = new DataSet();

        DatasetParentScreen = SHS.BaseLayer.BaseCommonFunctions.GetScreenInfoDataSet();
        for (int i = 0; i < DatasetParentScreen.Tables["ExternalReferralProviders"].Rows.Count; i++)
        {
            int tempExternalProvideId = Convert.ToInt32(DatasetParentScreen.Tables["ExternalReferralProviders"].Rows[i]["ExternalProviderId"]);
            if (tempExternalProvideId > 0)
            {
                for (int j = 0; j < datasetProviders.Tables["ExternalReferralProviders"].Rows.Count; j++)
                {
                    DataRow[] dr = datasetProviders.Tables["ExternalReferralProviders"].Select("ExternalReferralProviderId=" + tempExternalProvideId);
                    if (dr.Length == 0)
                    {
                        DataTable DataTableExternalReferralProviders = DatasetParentScreen.Tables["ExternalReferralProviders"];
                        DataRow[] RowsWithProviderId = null;
                        RowsWithProviderId = DataTableExternalReferralProviders.Select("ExternalProviderId=" + tempExternalProvideId);
                        if (RowsWithProviderId.Length > 0)
                        {
                            DataTableExternalReferralProviders.Rows.Remove(RowsWithProviderId[0]);
                        }
                    }
                }
            }
        }
        for (int i = 0; i < DatasetParentScreen.Tables["ExternalReferralProviders"].Rows.Count; i++)
        {
            DatasetParentScreen.Tables["ExternalReferralProviders"].Rows[i]["TempExternalProviderId"] = DatasetParentScreen.Tables["ExternalReferralProviders"].Rows[i]["ExternalProviderId"];
        }
        DatasetParentScreen.Tables["ExternalReferralProviders"].Merge(DatasetParentScreen.Tables["ExternalReferralProviders"]);
    }
Ejemplo n.º 2
0
    public void CustomGrid_BeforeDataBound(object sender, CustomGridDataBindEventArgs args)
    {
        DataTable Clientcontactinfo = new DataTable();

        Clientcontactinfo = (DataTable)args.DataSource;
        int counter = 1;

        if (BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet != null &&
            BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.IsDataTableFound("CustomIncidentReportSeizures"))
        {
            for (int i = 0; i < Clientcontactinfo.Rows.Count; i++)
            {
                if (Clientcontactinfo.Rows[i]["RecordDeleted"].ToString() != "Y")
                {
                    Clientcontactinfo.Rows[i]["NoOfSeizure"] = counter++;
                }
                else
                {
                    Clientcontactinfo.Rows[i]["NoOfSeizure"] = counter - 1;
                }
            }
        }
    }