示例#1
0
 public Employee ManageProfile(string SessionKey, string SessionValue)
 {
     var employee = new Employee();
     if ((string.IsNullOrEmpty(SessionKey) && (string.IsNullOrEmpty(SessionValue)))) return employee;
     var sessionId = LeaveRegisterUtils.DecryptPassword(SessionKey);
     var sessionValue = LeaveRegisterUtils.DecryptPassword(SessionValue);
     var employeeId = DataBaseUtils.GetEmployeeId(ConnectionString, sessionId);
     if (!DataBaseUtils.IsEmployeeLoggedIn(ConnectionString, sessionId, sessionValue))
     {
         employee.StatusText = "Session out";
         return employee;
     }
     employee= DataBaseUtils.GetProfileinfo(ConnectionString,employeeId);
     employee.StatusText = "success";
     return employee;
 }
示例#2
0
 /// <summary>
 /// Get all profile informations
 /// </summary>
 public static Employee GetProfileinfo(string ConnectionString, string EmployeeId)
 {
     var employee = new Employee();
     var con = new SqlConnection(ConnectionString);
     try
     {
         using (var cmd = new SqlCommand(StoreProcedureGetProfileInfo, con))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.Add("@EmployeeId", SqlDbType.VarChar).Value = EmployeeId;
             con.Open();
             var dr = cmd.ExecuteReader();
             if (dr.Read())
             {
                 employee.FirstName = dr["FirstName"].ToString();
                 employee.LastName = dr["LastName"].ToString();
                 employee.DateOfJoining = dr["DateOfJoining"].ToString();
                 employee.DateofBirth = dr["DateOfBirth"].ToString();
                 employee.Designation = dr["Designation"].ToString();
                 employee.EmailId = dr["EmployeeEmailID"].ToString();
                 employee.EmployeeId = dr["EmployeeId"].ToString();
                 employee.Company = dr["Company"].ToString();
                 //employee.ProfileImage = dr["ProfilePicture"].ToString();
             }
             con.Close();
         }
         return employee;
     }
     catch (Exception)
     {
         return employee;
     }
 }