Esempio n. 1
0
 public static String GetEmployeePermissionsByUser(Employee emp)
 {
     Dictionary<String, String> permissions = new Dictionary<string, string>();
     if (emp.EPermissions == null)
         return String.Empty;
     foreach (var e in emp.EPermissions)
     {
         if (!permissions.ContainsKey(e.Link))
             permissions.Add(e.Link, e.PermissionName);
     }
     StringBuilder sbr = new StringBuilder();
     sbr.Append(@"<div style='border: 1px solid #000;'>");
     sbr.Append(@"<ul>");
     foreach (var p in permissions)
     {
         sbr.Append(@"<li>");
         sbr.Append(@"<a href='");
         sbr.Append(p.Key);
         sbr.Append(@"'>");
         sbr.Append(p.Value);
         sbr.Append(@"</a>");
         sbr.Append(@"</li>");
     }
     sbr.Append(@"</ul></div>");
     return sbr.ToString();
 }
Esempio n. 2
0
 public static Employee GetEmployee(DataTable dt)
 {
     if (dt.Rows.Count == 0)
         return null;
     Employee e = new Employee();
     e.EmpNo = (String)dt.Rows[0]["EmpNo"];
     e.EmpNameEn = (String)dt.Rows[0]["EmpName"];
     e.EmpNameHi = (String)dt.Rows[0]["EmpNameHi"] ?? String.Empty;
     e.Designation = (String)dt.Rows[0]["Designation"] ?? String.Empty;
     e.Grade = (String)dt.Rows[0]["Grade"] ?? String.Empty;
     e.Region = (String)dt.Rows[0]["Region"] ?? String.Empty;
     e.Location = (String)dt.Rows[0]["Location"] ?? String.Empty;
     e.IRegion = BllUtility.GetRegion(e.Region);
     e.Department = (String)dt.Rows[0]["Department"] ?? String.Empty;
     e.IsActive = (bool)dt.Rows[0]["Active"];
     e.Dob = (DateTime?)dt.Rows[0]["DOB"] ?? DateTime.MinValue;
     e.Gender = ((String)dt.Rows[0]["SEX"]).StartsWith("F") ? Gender.FEMALE : Gender.MALE;
     e.MaritalStatus = BllUtility.GetMaritalStatus((String)dt.Rows[0]["MARS"]);
     e.Religion = (String)dt.Rows[0]["RELIGION"];
     e.EmpState = (String)dt.Rows[0]["EMPSTATE"];
     e.BloodGroup = (String)dt.Rows[0]["BLOODGROUP"];
     e.Discipline = (String)dt.Rows[0]["DISCIPLINE"];
     e.PgEmail = (String)dt.Rows[0]["PGEMAIL"];
     e.ExtEmail = (String)dt.Rows[0]["EXTEMAIL"];
     e.CellNo = (String)dt.Rows[0]["CELLNO"];
     //e.OfficePhoneNo=(String)dt.Rows[0]["OFFICEPHONENO"]??String.Empty;
     e.OfficeRaxNo = (String)dt.Rows[0]["OFFICERAXNO"] ?? String.Empty;
     e.ResidenceAddress = (String)dt.Rows[0]["RESIDENCEADDRESS"] ?? String.Empty;
     e.Language = (int)dt.Rows[0]["DefaultLanguage"] == 1 ? Languages.English : Languages.Hindi;
     e.PasswordChangedAt = (DateTime?)dt.Rows[0]["PassChangedAt"] ?? DateTime.MinValue;
     e.ReportingOfficer = (String)dt.Rows[0]["REPORTINGOFFR"];
     e.ReviewingOfficer = (String)dt.Rows[0]["REVIEWINGOFFR"];
     e.ResidenceCity = (String)dt.Rows[0]["RESIDENCECITY"];
     e.OrganizationalUnit = (String)dt.Rows[0]["OU"];
     e.DOJ = (DateTime?)dt.Rows[0]["DOJ"] ?? DateTime.MinValue;
     e.OfficeSeat = (String)dt.Rows[0]["OFFICESEAT"];
     e.HomeTown = (String)dt.Rows[0]["HOMETOWN"];
     return e;
 }
Esempio n. 3
0
 public string ValidateUserAD(Employee emp)
 {
     //DALI.DALEmployee objDALEmployee = new DALI.DALEmployee();
        //return objDALEmployee.ValidateUserAD(objEmployeeInfo);
        return "";
 }