Esempio n. 1
0
 public static Boolean CheckSaMIProfileByUser(int UserID, int SaMIProfileID)
 {
     Boolean blnExists = false;
     DataView dv = new SaMIProfileDAO().Select("SaMIProfileID", "", "CreatedBy = " + UserID + " AND SaMIProfileID = " + SaMIProfileID);
     if (dv.Count > 0)
     {
         blnExists = true;
     }
     return blnExists;
 }
Esempio n. 2
0
        public static List<List<String>> GetCountRecord(String ethnicityName, String Gender, String date, int DistrictID)
        {
            List<String> lstRegion = new List<String>();
            String Region = "", countRecord = "";
            List<String> lstRecord = new List<String>();
            List<String> lstCountRecord = new List<String>();
            List<List<String>> lstCombined = new List<List<string>>();
            DataView dv = new SaMIProfileDAO().SelectValidRegions(ethnicityName);
            if (dv.Count > 0)
            {
                String validRegions = dv.Table.Rows[0]["validRegions"].ToString();
                int len = dv.Table.Rows[0]["validRegions"].ToString().Length;
                if (len > 0)
                {
                    for (int i = 0; i < len; i++)
                    {
                        lstRegion.Add(validRegions.Substring(i, 1));
                    }
                    foreach (String region in lstRegion)
                    {
                        if (region != ",")
                        {
                            DataView dvRecords = new SaMIProfileDAO().SelectRecords(ethnicityName, region, Gender, date, DistrictID);
                            if (dvRecords.Count > 0)
                            {
                                Region = dvRecords.Table.Rows[0]["Region"].ToString();
                                countRecord = dvRecords.Table.Rows[0]["countRecord"].ToString();

                                lstRecord.Add(Region);
                                lstCountRecord.Add(countRecord);

                            }
                        }
                    }
                }
                else
                {
                    DataView dvRecordsforOther = new SaMIProfileDAO().SelectRecords(ethnicityName, "", Gender, date, DistrictID);
                    if (dvRecordsforOther.Count > 0)
                    {
                        countRecord = dvRecordsforOther.Table.Rows[0]["countRecord"].ToString();

                        lstRecord.Add(Region);
                        lstCountRecord.Add(countRecord);

                    }
                }
            }
            lstCombined.Add(lstRecord);
            lstCombined.Add(lstCountRecord);
            return lstCombined;
        }
Esempio n. 3
0
 public static Boolean CheckSaMIProfileByDistrict(int DistrictID, int SaMIProfileID)
 {
     Boolean blnExists = false;
     DataView dv = new SaMIProfileDAO().Select("SaMIProfileID", "", "DistrictID = " + DistrictID + " AND SaMIProfileID = " + SaMIProfileID);
     if (dv.Count > 0)
     {
         blnExists = true;
     }
     return blnExists;
 }