Exemplo n.º 1
0
 public static List <string> PINameList(string prefix, string type)
 {
     using (WFADSEntities pat = new WFADSEntities())
     {
         if (type == "Faculty")
         {
             var query = pat.Faculty_Details.Where(m => m.EmployeeName.Contains(prefix)).Select(m => m.EmployeeName).ToList();
             return(query);
         }
         else if (type == "Institute Staff")
         {
             var query = pat.Staff_Details.Where(m => m.EmployeeName.Contains(prefix)).Select(m => m.EmployeeName).ToList();
             return(query);
         }
         else if (type == "Student")
         {
             var query = pat.Student_Details.Where(m => m.StudentName.Contains(prefix)).Select(m => m.StudentName).ToList();
             return(query);
         }
         else
         {
             return(null);
         }
     }
 }
Exemplo n.º 2
0
 public static object GetPIData(string type, string name)
 {
     using (WFADSEntities pat = new WFADSEntities())
     {
         if (type == "Faculty")
         {
             var query = pat.Faculty_Details.Where(m => m.EmployeeName == name).Select(m => new { Dept = m.DepartmentCode.Trim(), Id = m.EmployeeId, Ph = m.ContactNumber, Mail = m.Email }).FirstOrDefault();
             return(query);
         }
         else if (type == "Institute Staff")
         {
             var query = pat.Staff_Details.Where(m => m.EmployeeName == name).Select(m => new { Dept = m.DepartmentCode.Trim(), Id = m.EmployeeId, Ph = m.ContactNumber, Mail = m.Email }).FirstOrDefault();
             return(query);
         }
         else if (type == "Student")
         {
             var query = pat.Student_Details.Where(m => m.StudentName == name).Select(m => new { Dept = m.DepartmentCode.Trim(), Id = m.RollNumber, Ph = m.ContactNumber, Mail = m.EmailID }).FirstOrDefault();
             return(query);
         }
         else
         {
             return(null);
         }
     }
 }
Exemplo n.º 3
0
 public static List <string> DepartmentList()
 {
     using (WFADSEntities pat = new  WFADSEntities())
     {
         var query = pat.DepartmentMaster.Select(m => m.DepartmentCode).ToList();
         return(query);
     }
 }