Пример #1
0
 /// <summary>
 /// This method is used to get AWC records from DB based on search criteria
 /// </summary>
 /// <param name="filter">search criteria</param>
 /// <param name="RecCount">total record count</param>
 /// <returns></returns>
 public List <SpGetEPGMBenes_Result> Get(SearchFilter search, out int RecCount, string stateCode, string distCode, string projCode, string secCode, string awcCode, string whoType, string month = "", string year = "", string CenterType = "")
 {
     using (DBEntities db = new DBEntities())
     {
         int i = 1; RecCount = 0;
         RecCount = db.SpGetEPGMBenes(stateCode, distCode, projCode, secCode, awcCode, whoType, month, year, "1", Convert.ToInt16(CenterType)).Count();
         var list = new List <SpGetEPGMBenes_Result>();
         //whoType = whoType == "Total" ? "All" : Helper.GetGradeCode(whoType);
         whoType = "All";
         var data = db.SpGetEPGMBenes(stateCode, distCode, projCode, secCode, awcCode, whoType, month, year, "1", Convert.ToInt16(CenterType)).ToList();
         foreach (var n in data)
         {
             var dist = new SpGetEPGMBenes_Result();
             dist.Sno          = Convert.ToString(i);
             dist.BeneCode     = n.BeneCode;
             dist.BeneName     = n.BeneName;
             dist.BeneSurname  = n.BeneSurname;
             dist.Gender       = n.Gender;
             dist.DOB          = n.DOB;
             dist.MobileNumber = n.MobileNumber;
             dist.LatestWeight = n.LatestWeight;
             dist.LatestHeight = n.LatestHeight;
             dist.LatestBMI    = n.LatestBMI;
             dist.GradeName    = n.GradeName;
             dist.WeightToAdd  = n.WeightToAdd;
             list.Add(dist);
             i++;
         }
         return(list);
     }
 }
Пример #2
0
        public List <SpGetEPGMBenes_Result> GetMasterData(SearchFilter search, out int RecCount, string stateCode, string distCode, string projCode, string secCode, string awcCode, string whoType, string month, string year, string BeneType, string CenterType)
        {
            using (DBEntities db = new DBEntities())
            {
                int i    = 1; RecCount = 0;
                var list = new List <SpGetEPGMBenes_Result>();
                var data = db.SpGetEPGMBenes(stateCode, distCode, projCode, secCode, awcCode, whoType, month, year, BeneType, Convert.ToInt16(CenterType)).ToList();
                foreach (var n in data)
                {
                    var dist = new SpGetEPGMBenes_Result();
                    dist.Sno                 = Convert.ToString(i);
                    dist.BeneCode            = n.BeneCode;
                    dist.BeneName            = n.BeneName;
                    dist.BeneSurname         = n.BeneSurname;
                    dist.DOB                 = n.DOB;
                    dist.MobileNumber        = n.MobileNumber;
                    dist.LatestWeight        = n.LatestWeight;
                    dist.LatestHeight        = n.LatestHeight;
                    dist.AgeIntYears         = n.AgeIntYears;
                    dist.LatestBMI           = n.LatestBMI;
                    dist.LastWeighedDate     = n.LastWeighedDate == null ? "" : n.LastWeighedDate;
                    dist.GradeName           = n.GradeName == "" ? "" : n.GradeName;
                    dist.WeightToAdd         = n.WeightToAdd;
                    dist.EnrolledStatus      = n.EnrolledStatus;
                    dist.AttendanceStatus    = n.AttendanceStatus;
                    dist.AttendanceTimeStamp = n.AttendanceTimeStamp == null ? "" : n.AttendanceTimeStamp;
                    dist.AttendanceImageURL  = n.AttendanceImageURL;
                    dist.Address             = n.Address == null ? "" : n.Address;
                    //dist.WHImageURL = n.WHImageURL == null ? "" : n.WHImageURL;
                    dist.WHTimeStamp = n.WHTimeStamp == null ? "" : n.WHTimeStamp;
                    dist.WHAddress   = n.WHAddress == null ? "" : n.WHAddress;
                    dist.IsRegisteredAtAttendance = n.IsRegisteredAtAttendance;
                    dist.IsEnrolledAtAttendance   = n.IsEnrolledAtAttendance;
                    dist.HBReading      = n.HBReading;
                    dist.HBGrade        = n.HBGrade;
                    dist.MUReading      = n.MUReading;
                    dist.MUGrade        = n.MUGrade;
                    dist.OXPulseReading = n.OXPulseReading;

                    if (n.DOB != "" && n.DOB != null)
                    {
                        n.DOB            = n.DOB.Replace("-", "/");
                        dist.DateofBirth = n.DOB.ToString(System.Globalization.CultureInfo.GetCultureInfo("en-IN")).ToString();
                    }
                    else
                    {
                        dist.DateofBirth = "";
                    }

                    if (n.WHImageURL != null && n.WHImageURL.Contains(ConfigurationManager.AppSettings["BeneURLDirectory"]))
                    {
                        var ImageData = n.WHImageURL.Split('/');
                        dist.WHImageURL = ConfigurationManager.AppSettings["BeneURL"] + ImageData[3] + "/" + ImageData[4];
                    }
                    else
                    {
                        dist.WHImageURL = n.WHImageURL == null ? "" : n.WHImageURL;
                    }
                    dist.Gender = Common.GenderName(n.Gender == null ? "" : n.Gender);

                    if (n.ActiveStatus == "1")
                    {
                        dist.ActiveStatus = "Active";
                    }
                    else
                    {
                        dist.ActiveStatus = "InActive";
                    }

                    list.Add(dist);
                    i++;
                }
                return(list);
            }
        }