Beispiel #1
0
        public ActionResult Index(string type, string mode = "Manage")
        {
            var fields = new List <UIField>();

            switch (type)
            {
            case "Projects":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Status", "Status"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime)
                };
                break;

            case "Tickets":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("DueDate", "Due Date", UIFieldTypes.DateTime),
                    UIField.GetField("Status", "Status"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime)
                };
                break;

            case "TeamLeaves":
                fields = new List <UIField>
                {
                    UIField.GetField("CreatedByUser.Person.Name", "Employee"),
                    UIField.GetField("LeaveType.Title", "Leave Type"),
                    UIField.GetField("Duration"),
                    UIField.GetField("Start", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("Start", "End Date", UIFieldTypes.DateTime),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime),
                    UIField.GetField("Status", "Status")
                };
                break;

            case "leaves":
                fields = new List <UIField>
                {
                    UIField.GetField("Employee", "Employee"),
                    UIField.GetField("LeaveType", "Leave Type"),
                    UIField.GetField("Duration"),
                    UIField.GetField("Period", "Period"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.TimeAgo),
                    UIField.GetField("Status", "Status"),
                    UIField.GetField("Approver", "Approver"),
                };

                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_LeaveListTemplate", fields));

            case "locations":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Phone"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "Permissions":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("PermissionCode"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "roles":
                fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "technologies":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Icon"),
                    UIField.GetField("Category"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "awards":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "emailtemplates":
                fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "departments":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("MailAlias", "Mail Alias"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "designations":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Department", "Department"),
                    UIField.GetField("MailAlias", "Mail Alias"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "shifts":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("StartTime", "Start Time", UIFieldTypes.DateTime),
                    UIField.GetField("EndTime", "End Time", UIFieldTypes.DateTime),
                    UIField.GetField("NeedsCompensation", "Needs Compensation"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "skills":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "hobbies":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "certifications":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "JobOpenings":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Vacancies", "Vacancy Count"),
                    UIField.GetField("Status", "Status"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "CandidateDesignations":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Rounds":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Offers":
                fields = new List <UIField>
                {
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "vendor":
                fields = new List <UIField>
                {
                    UIField.GetField("Title", "Name"),
                    UIField.GetField("Email"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "holiday":
                if (PermissionChecker.CheckPermission(ViewBag.Permissions as List <int>, 215))
                {
                    ViewBag.IsManage = true;
                }
                fields = new List <UIField>
                {
                    UIField.GetField("Type", "Type"),
                    UIField.GetField("Title"),
                    UIField.GetField("Date", "Date", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_HolidayListTemplate", fields));

            case "leavetype":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("MaxInAStretch", "Max in Stretch"),
                    UIField.GetField("MaxInMonth", "Max in Month"),
                    UIField.GetField("CanCarryForward", "Can Carry Forward"),
                    UIField.GetField("MaxCarryForward", "Max Carry Forward")
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "leavetimeperiod":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Start", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("End", "End Date", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "Vendors":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Email"),
                    UIField.GetField("Phone"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "assets":
                fields = new List <UIField>
                {
                    UIField.GetField("Title", "Title"),
                    UIField.GetField("TagNumber", "Tag"),
                    UIField.GetField("ModelNumber", "Model"),
                    UIField.GetField("Department", "Department"),
                    UIField.GetField("AllocatedEmployee", "Allocated To"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_AssetListTemplate", fields));

            case "employeeassets":
                fields = new List <UIField>
                {
                    UIField.GetField("Title", "Title"),
                    UIField.GetField("TagNumber", "Tag"),
                    UIField.GetField("ModelNumber", "Model"),
                    UIField.GetField("Department", "Department"),
                    UIField.GetField("AssetCategory", "AssetCategory"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_LeaveEntitlementsListTemplate", fields));

            case "assetallocationhistory":
                fields = new List <UIField>
                {
                    UIField.GetField("AllocatedEmployee", "Allocated To"),
                    UIField.GetField("StateType", "State"),
                    UIField.GetField("AllocatedOn", "Allocated On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ProjectMembersListTemplate", fields));

            case "assetcategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "softwarecategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "softwares":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Version"),
                    UIField.GetField("StatusName", "Status"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "projectmemberroles":
                fields = new List <UIField>
                {
                    UIField.GetField("Title", "Name"),
                    UIField.GetField("Department", "Department"),
                    UIField.GetField("RoleType", "Role"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "CRMAccounts":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Industry"),
                    UIField.GetField("Email"),
                    UIField.GetField("PhoneNo"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "requirementcategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "Categories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("IsPublic"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "ticketcategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "ticketsubcategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "Users":
                fields = new List <UIField>
                {
                    UIField.GetField("EmployeeCode", "Code"),
                    UIField.GetField("EmployeeStatus", "Status"),
                    UIField.GetField("RequiresTimeSheet", "TimeSheet"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Articles":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Category.Title", "Category"),
                    UIField.GetField("IsPublic"),
                    UIField.GetField("IsFeatured"),
                    UIField.GetField("Hits"),
                    UIField.GetField("Rating"),
                    UIField.GetField("Version"),
                    UIField.GetField("State"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "employees":
                fields = new List <UIField>
                {
                    UIField.GetField("User", "Name"),
                    UIField.GetField("EmployeeCode", "Code"),
                    UIField.GetField("Department", "Department"),
                    UIField.GetField("Designation", "Designation"),
                };
                return(PartialView("_EmployeeListTemplate", fields));

            case "dependents":
                fields = new List <UIField>
                {
                    UIField.GetField("Dependent", "Dependent Type"),
                    UIField.GetField("Name"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "emergencycontacts":
                fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("RelationshipType", "Relationship")
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "entitlementhistorylists":
                fields = new List <UIField>
                {
                    UIField.GetField("LeaveTimePeriod", "Time Period"),
                    UIField.GetField("LeaveType", "Leave Type"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_EntitlementhistoryListTemplate", fields));

            case "leaveentitlements":
                fields = new List <UIField>
                {
                    UIField.GetField("Employee", "Employee"),
                    UIField.GetField("LeaveType", "Leave Type"),
                    UIField.GetField("LeaveTimePeriod", "Time Period"),
                    UIField.GetField("OperationType", "Operation"),
                    UIField.GetField("LeaveCount", "Leave Count"),
                    UIField.GetField("PreviousBalance", "Previous Balance"),
                    UIField.GetField("NewBalance", "New Balance"),
                    UIField.GetField("AllocatedBy", "Created By"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };

                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_LeaveEntitlementsHistoryListTemplate", fields));

            case "entitlements":
                fields = new List <UIField>
                {
                    UIField.GetField("LeaveTimePeriod", "Leave Cycle"),
                    UIField.GetField("LeaveType", "Leave Type"),
                    UIField.GetField("Allocation", "Leave Balance"),
                };
                return(PartialView("_LeaveEntitlementsListTemplate", fields));

            case "leavebalance":
                fields = new List <UIField>
                {
                    UIField.GetField("User", "Name"),
                    UIField.GetField("EmployeeCode", "Code"),
                    UIField.GetField("Department", "Department"),
                    UIField.GetField("Designation", "Designation"),
                };
                return(PartialView("_HolidayListTemplate", fields));

            case "projects":
                ViewBag.UserId = WebUser.IsAdmin;
                bool isMember;
                var  employee = _employeeRepository.GetBy(u => u.UserId == WebUser.Id, "User,User.Person");
                isMember     = _projectMemberRepository.Any(m => m.EmployeeId == employee.Id && m.ProjectMemberRole.Role == MemberRole.ProjectManager) || WebUser.IsAdmin;
                ViewBag.Role = isMember;
                fields       = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("StatusType", "Status"),
                    UIField.GetField("ProjecttypeType", "Type"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ProjectListTemplate", fields));

            case "projectmembers":
                ViewBag.UserId = WebUser.IsAdmin;
                bool isProjectLead;
                var  user = _employeeRepository.GetBy(u => u.UserId == WebUser.Id, "User,User.Person,Location,Department,Designation,Shift");
                isProjectLead = _projectMemberRepository.Any(m => m.EmployeeId == user.Id && m.ProjectMemberRole.Role == MemberRole.ProjectManager) || WebUser.IsAdmin;
                ViewBag.Role  = isProjectLead;
                fields        = new List <UIField>
                {
                    UIField.GetField("MemberEmployee", "Employee"),
                    UIField.GetField("ProjectMemberRole", "Role"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ProjectMembersListTemplate", fields));

            case "inactiveprojectmembers":
                ViewBag.UserId = WebUser.IsAdmin;
                bool isLead;
                var  userEmployee = _employeeRepository.GetBy(u => u.UserId == WebUser.Id, "User,User.Person,Location,Department,Designation,Shift");
                isLead       = _projectMemberRepository.Any(m => m.EmployeeId == userEmployee.Id && m.ProjectMemberRole.Role == MemberRole.ProjectManager) || WebUser.IsAdmin;
                ViewBag.Role = isLead;
                fields       = new List <UIField>
                {
                    UIField.GetField("MemberEmployee", "Employee"),
                    UIField.GetField("ProjectMemberRole", "Role"),
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_InactiveProjectMembersListTemplate", fields));

            case "tasks":
                ViewBag.UserId = WebUser.IsAdmin;
                bool isVisible;
                var  loginUser = _employeeRepository.GetBy(u => u.UserId == WebUser.Id, "User,User.Person");
                isVisible         = _projectMemberRepository.Any(m => m.EmployeeId == loginUser.Id && (m.ProjectMemberRole.Role == MemberRole.ProjectManager || m.ProjectMemberRole.Role == MemberRole.Lead)) || WebUser.IsAdmin;
                ViewBag.IsVisible = isVisible;
                fields            = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Project", "Project"),
                    UIField.GetField("Assignee", "Assignee")
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_TaskListTemplate", fields));

            case "leadsources":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "leadstatuses":
                fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "leadcategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "potentialcategories":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "salesstages":
                fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "crmaccounts":
                fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Industry", "Industry"),
                    UIField.GetField("Email", "Email"),
                    UIField.GetField("PhoneNo", "Phone No"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));

            case "crmcontacts":
                fields = new List <UIField>
                {
                    UIField.GetField("Name", "Name"),
                    UIField.GetField("ParentAccount", "Account"),
                    UIField.GetField("PhoneNo", "Phone No"),
                    UIField.GetField("Email", "Email"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
                return(PartialView("_ListTemplate", fields));
            }

            ViewBag.Mode = mode == "Manage" ? "Manage" : "ReadOnly";
            return(PartialView("_Table", fields));
        }
Beispiel #2
0
        public ActionResult FormContent(string type)
        {
            var fields = new List <UIField>();

            switch (type)
            {
            case "Employee":
                ViewBag.Name = "employee";
                fields       = new List <UIField>
                {
                    UIField.GetField("department", "Department", "department", "departmentId", "Select Department", UIFieldTypes.DropDown),
                    UIField.GetField("employeeCode", "Employee Code"),
                    UIField.GetField("username", "Username"),
                    UIField.GetField("password", "Password", UIFieldTypes.Password),
                    UIField.GetField("firstName", "First Name"),
                    UIField.GetField("middleName", "Middle Name"),
                    UIField.GetField("lastName", "Last Name"),
                    UIField.GetField("gender", "Gender", "genderType", "gender", "Select Gender", UIFieldTypes.DropDown),
                    UIField.GetField("email", "Email"),
                    UIField.GetField("secondaryEmail", "Secondary Email"),
                    UIField.GetField("phoneNo", "Phone No"),
                    UIField.GetField("address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("communicationAddress", "Communication Address", UIFieldTypes.TextArea),
                    UIField.GetField("passportNo", "Passport No"),
                    UIField.GetField("dateOfBirth", "Date Of Birth", UIFieldTypes.DateTime),
                    UIField.GetField("bloodgroup", "Blood Group", "bloodGroupType", "bloodGroup", "Select Blood Group", UIFieldTypes.DropDown),
                    UIField.GetField("maritalstatus", "Marital Status", "maritalStatusType", "maritalStatus", "Select Marital Status", UIFieldTypes.DropDown),
                    UIField.GetField("employeestatus", "Employee Status", "status", "employeeStatus", "Select Employee Status", UIFieldTypes.DropDown),
                    UIField.GetField("marriageAnniversary", "Marriage Anniversary", UIFieldTypes.DateTime),
                    UIField.GetField("designation", "Designation", "designation", "designationId", "Select Designation", UIFieldTypes.DropDown),
                    UIField.GetField("shift", "Shift", "shift", "shiftId", "Select Shift", UIFieldTypes.DropDown),
                    UIField.GetField("location", "Location", "location", "locationId", "Select Location", UIFieldTypes.DropDown),
                    UIField.GetField("employee", "Reporting Person", "reportingPerson", "reportingPersonId", "Select Employee", UIFieldTypes.DropDown),
                    UIField.GetField("employee", "Manager", "manager", "managerId", "Select Employee", UIFieldTypes.DropDown),
                    UIField.GetField("experience", "Experience"),
                    UIField.GetField("dateOfJoin", "Date Of Joining", UIFieldTypes.DateTime),
                    UIField.GetField("confirmationDate", "Date Of Confirmation", UIFieldTypes.DateTime),
                    UIField.GetField("dateOfResignation", "Date Of Resignation", UIFieldTypes.DateTime),
                    UIField.GetField("lastDate", "Last Date", UIFieldTypes.DateTime),
                    UIField.GetField("officialEmail", "Official Email"),
                    UIField.GetField("officialPhone", "Official Phone"),
                    UIField.GetField("officialMessengerId", "Slack"),
                    UIField.GetField("requiresTimeSheet", "Requires TimeSheet"),
                    UIField.GetField("salary", "Salary"),
                    UIField.GetField("bank", "Bank"),
                    UIField.GetField("bankAccountNumber", "Bank Account Number"),
                    UIField.GetField("panCard", "PAN Card"),
                    UIField.GetField("paymentmode", "Payment Mode", "paymentType", "paymentMode", "Select Payment Mode", UIFieldTypes.DropDown),
                    UIField.GetField("technology", "Technologies", "technologyNames", "technologyIds", "Select Technologies", UIFieldTypes.DropDown),
                    UIField.GetField("role", "Roles", "roleNames", "roleIds", "Select Roles", UIFieldTypes.DropDown),
                };
                return(PartialView("_EmployeesTemplate", fields));

            case "Vendor":
                ViewBag.Name = "vendor";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Name"),
                    UIField.GetField("email", "Email"),
                    UIField.GetField("phone", "Phone"),
                    UIField.GetField("webSite", "Website"),
                    UIField.GetField("address", "Address"),
                    UIField.GetField("contactPerson", "Contact Person Name"),
                    UIField.GetField("contactPersonEmail", "Contact Person Email"),
                    UIField.GetField("contactPersonPhone", "Contact Person Phone"),
                };
                break;

            case "Holiday":
                ViewBag.Name = "holiday";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("holidayType", "Holiday Type", "holidayType", "type", "Select Holiday Type", UIFieldTypes.DropDown),
                    UIField.GetField("date", "Date", UIFieldTypes.DateTime),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "LeavePeriod":
                ViewBag.Name = "leaveTimePeriod";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("start", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("end", "End Date", UIFieldTypes.DateTime),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "LeaveType":
                ViewBag.Name = "leavetype";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("maxInAStretch", " Max In A Stretch", UIFieldTypes.Text),
                    UIField.GetField("maxInMonth", "Max In Month", UIFieldTypes.Text),
                    UIField.GetField("canCarryForward", "Can Carry Forward", UIFieldTypes.CheckBox),
                    UIField.GetField("maxCarryForward", "Max Carry Forward", UIFieldTypes.Text)
                };
                break;

            case "Leave":
                ViewBag.Name = "leaves";
                return(PartialView("_LeavesTemplate"));

            case "Designation":
                ViewBag.Name = "designation";
                fields       = new List <UIField>
                {
                    UIField.GetField("department", "Department", "department", "departmentId", "Select Department", UIFieldTypes.DropDown),
                    UIField.GetField("title", "Title", UIFieldTypes.Text),
                    UIField.GetField("band", "Band", "bandName", "band", "Select Band", UIFieldTypes.DropDown),
                    UIField.GetField("mailAlias", "Mail Alias", UIFieldTypes.Text),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Department":
                ViewBag.Name = "department";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title", UIFieldTypes.Text),
                    UIField.GetField("department", "Parent Department", "parent", "parentId", "Select Department", UIFieldTypes.DropDown),
                    UIField.GetField("mailAlias", "Mail Alias", UIFieldTypes.Text),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Award":
                ViewBag.Name = "award";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title", UIFieldTypes.Text),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Role":
                ViewBag.Name = "role";
                var permissions = UIField.GetField("permissionIds", "Permissions", UIFieldTypes.MultiSelectDropDown, "rolePermissions");
                permissions.Binding = "options: $parent.permissions, selectedOptions: permissionIds, optionsText:'name',optionsValue:'id'";

                fields = new List <UIField>
                {
                    UIField.GetField("name", "Name"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                    permissions,
                };
                break;

            case "Technology":
                ViewBag.Name = "technologie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("category", "Category"),
                    UIField.GetField("icon", "Icon"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                };
                break;

            case "EmailTemplate":
                ViewBag.Name = "emailtemplate";
                fields       = new List <UIField>
                {
                    UIField.GetField("name", "Name"),
                    UIField.GetField("content", "Content", UIFieldTypes.HtmlEditor)
                };
                break;

            case "Skill":
                ViewBag.Name = "skill";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Hobby":
                ViewBag.Name = "hobbie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Shift":
                ViewBag.Name = "shift";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("startTime", "Start Time", UIFieldTypes.DateTime),
                    UIField.GetField("endTime", "End Time", UIFieldTypes.DateTime),
                    UIField.GetField("needsCompensation", "Needs Compensation", UIFieldTypes.CheckBox),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                };
                break;

            case "Certification":
                ViewBag.Name = "certification";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "AssetCategory":
                ViewBag.Name = "assetcategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Software":
                ViewBag.Name = "software";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("version", "Version"),
                    UIField.GetField("latestVersion", "Latest Version"),
                    UIField.GetField("recommendedVersion", "Recommended Version"),
                    UIField.GetField("softwarestatus", "Status", "statusType", "status", "Select Status", UIFieldTypes.DropDown),
                    UIField.GetField("licensetype", "License Type", "license", "licenseType", "Select License Type", UIFieldTypes.DropDown),
                    UIField.GetField("softwarecategory", "Software Category", "category", "softwareCategoryId", "Select Software Category", UIFieldTypes.DropDown),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                };
                break;

            case "ProjectMemberRole":
                ViewBag.Name = "projectmemberrole";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Name"),
                    UIField.GetField("department", "Department", "department", "departmentId", "Select Department", UIFieldTypes.DropDown),
                    UIField.GetField("memberrole", "Role", "roleType", "role", "Select Role", UIFieldTypes.DropDown),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                };
                break;

            case "SoftwareCategory":
                ViewBag.Name = "softwarecategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                };
                break;

            case "Location":
                ViewBag.Name = "location";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("phone", "Phone"),
                    UIField.GetField("address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "RequirementCategory":
                ViewBag.Name = "requirementcategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title")
                };
                break;

            case "TicketCategory":
                ViewBag.Name = "ticketcategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "TicketSubCategory":
                ViewBag.Name = "ticketsubcategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("ticketcategory", "Ticket Category", "ticketCategory", "ticketCategoryId", "Select Ticket Category", UIFieldTypes.DropDown),
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Asset":
                ViewBag.Name = "asset";
                fields       = new List <UIField>
                {
                    UIField.GetField("serialNumber", "Serial Number", UIFieldTypes.Text),
                    UIField.GetField("title", "Title", UIFieldTypes.Text),
                    UIField.GetField("cost", "Cost", UIFieldTypes.Text),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("specifications", "Specifications", UIFieldTypes.TextArea),
                    UIField.GetField("brand", "Brand", UIFieldTypes.Text),
                    UIField.GetField("modelNumber", "Model Number", UIFieldTypes.Text),
                    UIField.GetField("isBrandNew", "Is Brand New", UIFieldTypes.CheckBox),
                    UIField.GetField("assetstate", "State", "stateType", "state", "Select State", UIFieldTypes.DropDown),
                    UIField.GetField("purchaseDate", "Purchase Date", UIFieldTypes.DateTime),
                    UIField.GetField("warrantyExpiryDate", "Warranty Expiry Date", UIFieldTypes.DateTime),
                    UIField.GetField("assetcategory", "Asset Category", "assetCategory", "assetCategoryId", "Select Asset Category", UIFieldTypes.DropDown),
                    UIField.GetField("department", "Department", "department", "departmentId", "Select Department", UIFieldTypes.DropDown),
                    UIField.GetField("vendor", "Vendor", "vendor", "vendorId", "Select Vendor", UIFieldTypes.DropDown),
                    UIField.GetField("employee", "Allocated To", "allocatedEmployee", "allocatedEmployeeId", "Select Employee", UIFieldTypes.DropDown),
                };
                return(PartialView("_AssetTemplate", fields));

            case "Dependent":
                ViewBag.Name = "employeedependent";
                fields       = new List <UIField>
                {
                    UIField.GetField("dependenttype", "Dependent Type", "dependent", "dependentType", "Select Dependent", UIFieldTypes.DropDown),
                    UIField.GetField("name", "Name"),
                    UIField.GetField("birthday", "Date of Birth", UIFieldTypes.DateTime),
                    UIField.GetField("gender", "Gender", "genderType", "gender", "Select Gender", UIFieldTypes.DropDown),
                };
                break;

            case "EmergencyContact":
                ViewBag.Name = "emergencycontact";
                fields       = new List <UIField>
                {
                    UIField.GetField("relationship", "Relationship", "relationshipType", "relationship", "Select Relationship", UIFieldTypes.DropDown),
                    UIField.GetField("name", "Name", UIFieldTypes.Text),
                    UIField.GetField("mobile", "Mobile", UIFieldTypes.Text),
                    UIField.GetField("phone", "Phone", UIFieldTypes.Text),
                    UIField.GetField("workPhone", "WorkPhone", UIFieldTypes.Text),
                    UIField.GetField("email", "Email", UIFieldTypes.Text),
                    UIField.GetField("address", "Address", UIFieldTypes.TextArea),
                };
                break;

            case "LeaveEntitlement":
                ViewBag.Name = "leaveentitlement";
                fields       = new List <UIField>
                {
                    UIField.GetField("employee", "Employee", "employee", "employeeId", "Select Employee", UIFieldTypes.DropDown),
                    UIField.GetField("leavetype", "Leave Type", "leaveType", "leaveTypeId", "Select Leave Type", UIFieldTypes.DropDown),
                    UIField.GetField("leavetimeperiod", "Time period", "leaveTimePeriod", "leaveTimePeriodId", "Select Time Period", UIFieldTypes.DropDown),
                    UIField.GetField("leaveoperation", "Operation", "operationType", "operation", "Select Operation", UIFieldTypes.DropDown),
                    UIField.GetField("allocation", "Allocated Days", UIFieldTypes.Text),
                    UIField.GetField("comments", "Comments", UIFieldTypes.TextArea),
                };
                return(PartialView("_LeaveEntitlementsTemplate", fields));

            case "EntitlementHistory":
                ViewBag.Name = "entitlementhistorylist";
                fields       = new List <UIField>
                {
                    UIField.GetField("leavetype", "Leave Type", "leaveType", "leaveTypeId", "Select Leave Type", UIFieldTypes.DropDown),
                    UIField.GetField("leavetimeperiod", "Time period", "leaveTimePeriod", "leaveTimePeriodId", "Select Time Period", UIFieldTypes.DropDown),
                    UIField.GetField("leaveoperation", "Operation", "operationType", "operation", "Select Operation", UIFieldTypes.DropDown),
                    UIField.GetField("leaveCount", "Leave Count", UIFieldTypes.Text),
                    UIField.GetField("previousBalance", "Previous Balance", UIFieldTypes.Text),
                    UIField.GetField("newBalance", "New Balance", UIFieldTypes.Text),
                    UIField.GetField("comments", "Comments", UIFieldTypes.TextArea),
                };
                break;

            case "Project":
                ViewBag.Name = "project";
                return(PartialView("_ProjectTemplate"));

            case "ProjectMember":
                ViewBag.Name   = "projectmember";
                ViewBag.UserId = WebUser.Id;
                fields         = new List <UIField>
                {
                    UIField.GetField("employee", "Employee", "memberEmployee", "employeeId", "Select Employee", UIFieldTypes.DropDown),
                    UIField.GetField("projectmemberroles", "Role", "projectmemberrole", "projectmemberroleId", "Select Role", UIFieldTypes.DropDown),
                    UIField.GetField("billing", "Billing", "billingType", "billing", "Select Billing", UIFieldTypes.DropDown),
                    UIField.GetField("memberstatus", "Status", "memberStatusType", "memberStatus", "Select Status", UIFieldTypes.DropDown),
                    UIField.GetField("rate", "Rate", UIFieldTypes.Text),
                };
                return(PartialView("_ProjectMemberTemplate", fields));

            case "InActiveProjectMember":
                ViewBag.Name   = "inactiveprojectmember";
                ViewBag.UserId = WebUser.Id;
                fields         = new List <UIField>
                {
                    UIField.GetField("employee", "Employee", "memberEmployee", "employeeId", "Select Employee", UIFieldTypes.DropDown),
                    UIField.GetField("projectmemberroles", "Role", "projectmemberrole", "projectmemberroleId", "Select Role", UIFieldTypes.DropDown),
                    UIField.GetField("billing", "Billing", "billingType", "billing", "Select Billing", UIFieldTypes.DropDown),
                    UIField.GetField("memberstatus", "Status", "memberStatusType", "memberStatus", "Select Status", UIFieldTypes.DropDown),
                    UIField.GetField("rate", "Rate", UIFieldTypes.Text),
                };
                return(PartialView("_ProjectMemberTemplate", fields));

            case "Task":
                ViewBag.Name = "task";
                return(PartialView("_TaskTemplate"));

            case "LeaveBalance":
                ViewBag.Name = "leavebalance";
                return(PartialView("_LeaveBalanceDetailsTemplate"));

            case "Image":
                return(PartialView("_singleImageComponent"));

            case "LeadSource":
                ViewBag.Name = "crmleadsource";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "LeadStatus":
                ViewBag.Name = "crmleadstatu";
                fields       = new List <UIField>
                {
                    UIField.GetField("name", "Name"),
                };
                break;

            case "LeadCategory":
                ViewBag.Name = "crmleadcategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "PotentialCategory":
                ViewBag.Name = "crmpotentialcategorie";
                fields       = new List <UIField>
                {
                    UIField.GetField("title", "Title"),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "SalesStage":
                ViewBag.Name = "crmsalesstage";
                fields       = new List <UIField>
                {
                    UIField.GetField("name", "Name"),
                    UIField.GetField("salestatus", "Status", "statusType", "status", "Select Status", UIFieldTypes.DropDown),
                };
                break;

            case "CRMAccounts":
                ViewBag.Name = "crmaccount";
                fields       = new List <UIField>
                {
                    UIField.GetField("employee", "Assigned To User", "assignedToEmployee", "assignedToEmployeeId", "Select Employee", UIFieldTypes.DropDown),
                    UIField.GetField("title", "Title", UIFieldTypes.Text),
                    UIField.GetField("industry", "Industry", UIFieldTypes.Text),
                    UIField.GetField("employeecount", "Employee Count", "employeeCountType", "employeeCount", "Select Employee Count", UIFieldTypes.DropDown),
                    UIField.GetField("foundedOn", "Founded On", UIFieldTypes.DateTime),
                    UIField.GetField("email", "Email", UIFieldTypes.Text),
                    UIField.GetField("phoneNo", "Phone No", UIFieldTypes.Text),
                    UIField.GetField("secondaryEmail", "Secondary Email", UIFieldTypes.Text),
                    UIField.GetField("officePhone", "Office Phone", UIFieldTypes.Text),
                    UIField.GetField("website", "Website", UIFieldTypes.Text),
                    UIField.GetField("facebook", "Facebook", UIFieldTypes.Text),
                    UIField.GetField("twitter", "Twitter", UIFieldTypes.Text),
                    UIField.GetField("googlePlus", "Google Plus", UIFieldTypes.Text),
                    UIField.GetField("linkedIn", "Linked In", UIFieldTypes.Text),
                    UIField.GetField("city", "City", UIFieldTypes.Text),
                    UIField.GetField("country", "Country", UIFieldTypes.Text),
                    UIField.GetField("address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("communicationAddress", "Communication Address", UIFieldTypes.TextArea),
                    UIField.GetField("expertise", "Expertise", UIFieldTypes.Text),
                    UIField.GetField("description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("crmaccounts", "Parent Account", "parent", "parentId", "Select Parent Account", UIFieldTypes.DropDown),
                };
                break;

            case "CRMContacts":
                ViewBag.Name = "crmcontact";
                fields       = new List <UIField>
                {
                    UIField.GetField("crmaccounts", "Parent Account", "parentAccount", "parentAccountId", "Select Account", UIFieldTypes.DropDown),
                    UIField.GetField("firstName", "FirstName", UIFieldTypes.Text),
                    UIField.GetField("lastName", "LastName", UIFieldTypes.Text),
                    UIField.GetField("gender", "Gender", "genderType", "gender", "Select Gender", UIFieldTypes.DropDown),
                    UIField.GetField("email", "Email", UIFieldTypes.Text),
                    UIField.GetField("secondaryEmail", "Secondary Email", UIFieldTypes.Text),
                    UIField.GetField("phoneNo", "Phone No", UIFieldTypes.Text),
                    UIField.GetField("officePhone", "Office Phone", UIFieldTypes.Text),
                    UIField.GetField("website", "Website", UIFieldTypes.Text),
                    UIField.GetField("skype", "Skype", UIFieldTypes.Text),
                    UIField.GetField("facebook", "Facebook", UIFieldTypes.Text),
                    UIField.GetField("twitter", "Twitter", UIFieldTypes.Text),
                    UIField.GetField("googlePlus", "Google Plus", UIFieldTypes.Text),
                    UIField.GetField("linkedIn", "Linked In", UIFieldTypes.Text),
                    UIField.GetField("organization", "Organization", UIFieldTypes.Text),
                    UIField.GetField("designation", "Designation", UIFieldTypes.Text),
                    UIField.GetField("city", "City", UIFieldTypes.Text),
                    UIField.GetField("country", "Country", UIFieldTypes.Text),
                    UIField.GetField("address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("communicationAddress", "Communication Address", UIFieldTypes.TextArea),
                    UIField.GetField("dateOfBirth", "Date Of Birth", UIFieldTypes.DateTime),
                    UIField.GetField("expertise", "Expertise", UIFieldTypes.Text),
                    UIField.GetField("comments", "Comments", UIFieldTypes.TextArea),
                };
                break;
            }

            return(PartialView("_FormTemplate", fields));
        }
Beispiel #3
0
        public ActionResult Index(string type)
        {
            var viewModel = new FormViewModel();

            switch (type)
            {
            case "Locations":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Phone"),
                    UIField.GetField("Address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Users":
                ViewBag.DepartmentId      = new SelectList(_gridDataContext.Departments, "Id", "Title");
                ViewBag.Gender            = GetEnumSelectList <Gender>();
                ViewBag.BloodGroup        = GetEnumSelectList <BloodGroup>();
                ViewBag.MaritalStatus     = GetEnumSelectList <MaritalStatus>();
                ViewBag.LocationId        = new SelectList(_gridDataContext.Locations, "Id", "Title");
                ViewBag.DesignationId     = new SelectList(_gridDataContext.Designations, "Id", "Title");
                ViewBag.ShiftId           = new SelectList(_gridDataContext.Designations, "Id", "Title");
                ViewBag.ReportingPersonId = new SelectList(_gridDataContext.Users.Include("Person").Where(u => u.Id != 1 && u.EmployeeStatus != EmployeeStatus.Ex), "Id", "Person.Name");
                ViewBag.EmployeeStatus    = GetEnumSelectList <EmployeeStatus>();
                ViewBag.PaymentMode       = GetEnumSelectList <PaymentMode>();
                ViewBag.ShiftId           = new SelectList(_gridDataContext.Roles, "Id", "Name");

                ViewData["TechnologyIds"] = new MultiSelectList(_gridDataContext.Technologies, "Id", "Title");
                ViewData["RoleIds"]       = new MultiSelectList(_gridDataContext.Roles, "Id", "Name");

                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("DepartmentId", "Department", UIFieldTypes.DropDown),
                    UIField.GetField("EmployeeCode", "Employee Code"),
                    UIField.GetField("Username"),
                    UIField.GetField("Password", "Password", UIFieldTypes.Password),
                    UIField.GetField("Person.FirstName", "First Name"),
                    UIField.GetField("Person.MiddleName", "Middle Name"),
                    UIField.GetField("Person.LastName", "Last Name"),
                    UIField.GetField("Person.Gender", "Gender", UIFieldTypes.DropDown, "Gender"),
                    UIField.GetField("Person.Email"),
                    UIField.GetField("Person.SecondaryEmail", "Secondary Email"),
                    UIField.GetField("Person.PhoneNo", "Phone No"),
                    UIField.GetField("Person.Address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("Person.CommunicationAddress", "Communication Address", UIFieldTypes.TextArea),
                    UIField.GetField("Person.PassportNo", "Passport No"),
                    UIField.GetField("Person.DateOfBirth", "Date Of Birth", UIFieldTypes.DateTime),
                    UIField.GetField("Person.BloodGroup", "Blood Group", UIFieldTypes.DropDown, "BloodGroup"),
                    UIField.GetField("Person.MaritalStatus", "Marital Status", UIFieldTypes.DropDown, "MaritalStatus"),
                    UIField.GetField("Person.MarriageAnniversary", "Marriage Anniversary", UIFieldTypes.DateTime),
                    UIField.GetField("LocationId", "Location", UIFieldTypes.DropDown),
                    UIField.GetField("DesignationId", "Designation", UIFieldTypes.DropDown),
                    UIField.GetField("ShiftId", "Shift", UIFieldTypes.DropDown),
                    UIField.GetField("ReportingPersonId", "Reporting Person", UIFieldTypes.DropDown),
                    UIField.GetField("Experience"),
                    UIField.GetField("DateOfJoin", "Date Of Joining", UIFieldTypes.DateTime),
                    UIField.GetField("ConfirmationDate", "Date Of Confirmation", UIFieldTypes.DateTime),
                    UIField.GetField("DateOfResignation", "Date Of Resignation", UIFieldTypes.DateTime),
                    UIField.GetField("LastDate", "Last Date", UIFieldTypes.DateTime),
                    UIField.GetField("OfficialEmail", "Official Email"),
                    UIField.GetField("OfficialPhone", "Official Phone"),
                    UIField.GetField("OfficialMessengerId", "Official Messenger Id"),
                    UIField.GetField("EmployeeStatus", "Employee Status", UIFieldTypes.DropDown),
                    UIField.GetField("TechnologyIds", "Technologies", UIFieldTypes.MultiSelectDropDown),
                    UIField.GetField("RequiresTimeSheet", "Requires TimeSheet", UIFieldTypes.CheckBox),
                    UIField.GetField("Salary"),
                    UIField.GetField("Bank"),
                    UIField.GetField("BankAccountNumber", "Bank Account Number"),
                    UIField.GetField("PANCard", "PAN Card"),
                    UIField.GetField("PaymentMode", "Payment Mode", UIFieldTypes.DropDown),
                    UIField.GetField("RoleIds", "Roles", UIFieldTypes.MultiSelectDropDown),
                };
                break;

            case "EmailTemplates":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("Content", "Content", UIFieldTypes.HtmlEditor)
                };
                break;

            case "Technologies":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("Icon"),
                    UIField.GetField("Category")
                };
                break;

            case "RequirementCategories":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title")
                };
                break;

            case "Requirements":
                ViewBag.AssignedToUserId  = new SelectList(_gridDataContext.Users.Include("Person").Where(u => u.Id != 1 && u.EmployeeStatus != EmployeeStatus.Ex), "Id", "Person.Name");
                ViewBag.ContactId         = new SelectList(_gridDataContext.Users.Include("Person").Where(u => u.Id != 1 && u.EmployeeStatus != EmployeeStatus.Ex), "Id", "Person.Name");
                ViewBag.Source            = new SelectList(_gridDataContext.CRMLeadSources, "Id", "Title");
                ViewBag.CategoryId        = new SelectList(_gridDataContext.RequirementCategories, "Id", "Title");
                ViewData["TechnologyIds"] = new MultiSelectList(_gridDataContext.Technologies, "Id", "Title");
                ViewBag.BillingType       = GetEnumSelectList <BillingType>();

                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("AssignedToUserId", "Assigned To User", UIFieldTypes.DropDown),
                    UIField.GetField("ContactId", "Contact", UIFieldTypes.DropDown),
                    UIField.GetField("Source", "Source", UIFieldTypes.DropDown),
                    UIField.GetField("CategoryId", "Category", UIFieldTypes.DropDown),
                    UIField.GetField("TechnologyIds", "Technologies", UIFieldTypes.MultiSelectDropDown),
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("Url"),
                    UIField.GetField("BillingType", "Billing Type", UIFieldTypes.DropDown),
                    UIField.GetField("Budget"),
                    UIField.GetField("PostedOn", "Posted On", UIFieldTypes.DateTime),
                };
                break;

            case "SoftwareCategories":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                };
                break;

            case "Softwares":
                ViewBag.Status             = GetEnumSelectList <SoftwareStatus>();
                ViewBag.LicenseType        = GetEnumSelectList <LicenseType>();
                ViewBag.SoftwareCategoryId = new SelectList(_gridDataContext.SoftwareCategories, "Id", "Title");
                viewModel.Fields           = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("Version"),
                    UIField.GetField("LatestVersion", "Latest Version"),
                    UIField.GetField("RecommendedVersion", "Recommended Version"),
                    UIField.GetField("Status", "Status", UIFieldTypes.DropDown),
                    UIField.GetField("LicenseType", "License Type", UIFieldTypes.DropDown),
                    UIField.GetField("LatestVersion", "Latest Version"),
                    UIField.GetField("SoftwareCategoryId", "Software Category", UIFieldTypes.DropDown),
                };
                break;

            case "Awards":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Holidays":
                ViewBag.HolidayType = GetEnumSelectList <HolidayType>();
                viewModel.Fields    = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("HolidayType", "Holiday Type", UIFieldTypes.DropDown),
                    UIField.GetField("Date", "Date", UIFieldTypes.DateTime)
                };
                break;

            case "LeaveTypes":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "LeavePeriods":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Start", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("End", "End Date", UIFieldTypes.DateTime)
                };
                break;

            case "Leaves":
                ViewBag.LeaveTypeId = new SelectList(_gridDataContext.LeaveTypes, "Id", "Title");
                ViewBag.Duration    = GetEnumSelectList <LeaveDuration>();
                return(PartialView("_Leave"));

            case "Departments":
                ViewBag.ParentId = new SelectList(_gridDataContext.Departments, "Id", "Title");
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("MailAlias", "Mail Alias"),
                    UIField.GetField("ParentId", "Parent", UIFieldTypes.DropDown),
                };
                break;

            case "Designations":
                ViewBag.DepartmentId = new SelectList(_gridDataContext.Designations, "Id", "Title");
                ViewBag.Band         = GetEnumSelectList <Band>();
                viewModel.Fields     = new List <UIField>
                {
                    UIField.GetField("DepartmentId", "Department", UIFieldTypes.DropDown),
                    UIField.GetField("Title"),
                    UIField.GetField("Band", "Band", UIFieldTypes.DropDown),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("MailAlias", "Mail Alias"),
                };
                break;

            case "Shifts":
                ViewBag.DepartmentId = new SelectList(_gridDataContext.Designations, "Id", "Title");
                ViewBag.Band         = GetEnumSelectList <Band>();
                viewModel.Fields     = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("StartTime", "Start Time", UIFieldTypes.DateTime),
                    UIField.GetField("EndTime", "End Time", UIFieldTypes.DateTime),
                    UIField.GetField("NeedsCompensation", "Needs Compensation", UIFieldTypes.CheckBox)
                };
                break;

            case "Roles":
                ViewData["PermissionIds"] = new MultiSelectList(_gridDataContext.Permissions, "Id", "Title");
                viewModel.Fields          = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("PermissionIds", "Permissions", UIFieldTypes.MultiSelectDropDown),
                };
                break;

            case "Skills":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Hobbies":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "Certifications":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "JobOpenings":
                ViewBag.OpeningStatus = GetEnumSelectList <JobOpeningStatus>();
                viewModel.Fields      = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("NoOfVacancies", "No Of Vacancies"),
                    UIField.GetField("OpeningStatus", "Opening Status", UIFieldTypes.DropDown),
                };
                break;

            case "Candidates":
                ViewBag.Status               = GetEnumSelectList <CandidateStatus>();
                ViewBag.Source               = GetEnumSelectList <CandidatesSource>();
                ViewData["TechnologyIds"]    = new MultiSelectList(_gridDataContext.Technologies, "Id", "Title");
                ViewBag.Gender               = GetEnumSelectList <Gender>();
                ViewBag.CandidateDesignation = new SelectList(_gridDataContext.CandidateDesignations, "Id", "Title");

                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("RecievedOn", "Recieved On", UIFieldTypes.DateTime),
                    UIField.GetField("Status", "Status", UIFieldTypes.DropDown),
                    UIField.GetField("Source", "Source", UIFieldTypes.DropDown),
                    UIField.GetField("TechnologyIds", "Technologies", UIFieldTypes.MultiSelectDropDown),
                    UIField.GetField("FirstName", "First Name", UIFieldTypes.Text),
                    UIField.GetField("MiddleName", "Middle Name", UIFieldTypes.Text),
                    UIField.GetField("LastName", "Last Name", UIFieldTypes.Text),
                    UIField.GetField("Gender", "Gender", UIFieldTypes.DropDown),
                    UIField.GetField("Email", "Email", UIFieldTypes.Text),
                    UIField.GetField("SecondaryEmail", "Secondary Email", UIFieldTypes.Text),
                    UIField.GetField("PhoneNo", "Phone Number", UIFieldTypes.Text),
                    UIField.GetField("OfficePhone", "Office Phone", UIFieldTypes.Text),
                    UIField.GetField("Skype", "Skype", UIFieldTypes.Text),
                    UIField.GetField("Facebook", "Facebook", UIFieldTypes.Text),
                    UIField.GetField("Twitter", "Twitter", UIFieldTypes.Text),
                    UIField.GetField("GooglePlus", "Google Plus", UIFieldTypes.Text),
                    UIField.GetField("LinkedIn", "LinkedIn", UIFieldTypes.Text),
                    UIField.GetField("Organization", "Organization", UIFieldTypes.Text),
                    UIField.GetField("Designation", "Designation", UIFieldTypes.Text),
                    UIField.GetField("CandidateDesignation", "Candidate Designation", UIFieldTypes.DropDown),
                    UIField.GetField("Address", "Address", UIFieldTypes.TextArea),
                    UIField.GetField("CommunicationAddress", "Communication Address", UIFieldTypes.TextArea),
                    UIField.GetField("DateOfBirth", "Date Of Birth", UIFieldTypes.Text),
                    UIField.GetField("Qualification", "Qualification", UIFieldTypes.Text),
                    UIField.GetField("TotalExperience", "Total Experience", UIFieldTypes.Text),
                    UIField.GetField("CurrentCTC", "Current CTC", UIFieldTypes.Text),
                    UIField.GetField("ExpectedCTC", "Expected CTC", UIFieldTypes.Text),
                    UIField.GetField("Comments", "Comments", UIFieldTypes.TextArea),
                };
                break;

            case "LeadSources":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "LeadCategories":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "LeadStatus":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Name")
                };
                break;

            case "Projects":
                ViewBag.ParentId          = new SelectList(_gridDataContext.Projects, "Id", "Title");
                ViewBag.ClientId          = new SelectList(_gridDataContext.CRMContacts.Include("Person"), "Id", "Person.Name");
                ViewData["TechnologyIds"] = new MultiSelectList(_gridDataContext.Technologies, "Id", "Title");
                ViewBag.Status            = GetEnumSelectList <ProjectStatus>();
                viewModel.Fields          = new List <UIField>
                {
                    UIField.GetField("ParentId", "Sub Project Of", UIFieldTypes.DropDown),
                    UIField.GetField("ClientId", "Client", UIFieldTypes.DropDown),
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("TechnologyIds", "Technologies", UIFieldTypes.MultiSelectDropDown),
                    UIField.GetField("StartDate", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("EndDate", "End Date", UIFieldTypes.DateTime),
                    UIField.GetField("Status", "Status", UIFieldTypes.DropDown),
                    UIField.GetField("IsPublic", "Is Public", UIFieldTypes.CheckBox),
                    UIField.GetField("InheritMembers", "Inherit Members", UIFieldTypes.CheckBox)
                };
                break;

            case "Tasks":
                ViewBag.ProjectId  = new SelectList(_gridDataContext.Projects, "Id", "Title");
                ViewBag.AssigneeId = new SelectList(_gridDataContext.Users.Include("Person"), "Id", "Person.Name");
                ViewBag.TaskStatus = GetEnumSelectList <ProjectTaskStatus>();
                ViewBag.Priority   = GetEnumSelectList <TaskPriority>();
                viewModel.Fields   = new List <UIField>
                {
                    UIField.GetField("ProjectId", "Project", UIFieldTypes.DropDown),
                    UIField.GetField("AssigneeId", "Assignee", UIFieldTypes.DropDown),
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("ExpectedTime", "Expected Time"),
                    UIField.GetField("TaskStatus", "Status", UIFieldTypes.DropDown),
                    UIField.GetField("Priority", "Priority", UIFieldTypes.DropDown),
                    UIField.GetField("StartDate", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("EndDate", "End Date", UIFieldTypes.DateTime)
                };
                break;

            case "ArticleCategories":
                ViewBag.ParentCategoryId = new SelectList(_gridDataContext.Categories, "Id", "Title");
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea),
                    UIField.GetField("IsPublic", "Is Public", UIFieldTypes.CheckBox),
                    UIField.GetField("ParentCategoryId", "Parent Category", UIFieldTypes.DropDown)
                };
                break;

            case "Articles":
                ViewBag.CategoryId = new SelectList(_gridDataContext.Categories, "Id", "Title");
                viewModel.Fields   = new List <UIField>
                {
                    UIField.GetField("CategoryId", "Category", UIFieldTypes.DropDown),
                    UIField.GetField("IsPublic", "Is Public", UIFieldTypes.CheckBox),
                    UIField.GetField("Title"),
                    UIField.GetField("Summary", "Summary", UIFieldTypes.HtmlEditor),
                    UIField.GetField("Content", "Content", UIFieldTypes.HtmlEditor),
                    UIField.GetField("ArticleVersion", "Article Version"),
                    UIField.GetField("Keywords"),
                    UIField.GetField("IsFeatured", "Is Featured", UIFieldTypes.CheckBox),
                };
                break;

            case "TicketCategories":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };
                break;

            case "TicketSubCategories":
                ViewBag.TicketCategoryId = new SelectList(_gridDataContext.TicketCategories, "Id", "Title");
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("TicketCategoryId", "Ticket Category", UIFieldTypes.DropDown),
                    UIField.GetField("Title"),
                    UIField.GetField("Description", "Description", UIFieldTypes.TextArea)
                };

                break;

            case "Tickets":
                return(PartialView("_Ticket"));
            }

            return(PartialView("_Bootstrap", viewModel));
        }
Beispiel #4
0
        public ActionResult Index(string type, string mode = "Manage")
        {
            var viewModel = new ListViewModel();

            switch (type)
            {
            case "Locations":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#location/create";
                viewModel.Title          = "Manage Locations";
                viewModel.CanManage      = WebUser.Permissions.Contains(200);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Address"),
                    UIField.GetField("Phone"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Permissions":
                viewModel.ShowDetailsLink = false;
                viewModel.Title           = "Manage Permissions";
                viewModel.Fields          = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("PermissionCode", "Permission Code"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Roles":
                viewModel.Title          = "Manage Roles";
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#role/create";
                viewModel.CanManage      = WebUser.Permissions.Contains(200);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Technologies":
                viewModel.Title          = "Manage Technologies";
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#technology/create";
                viewModel.CanManage      = WebUser.Permissions.Contains(200);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Icon"),
                    UIField.GetField("Category"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Awards":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#award/create";
                viewModel.Title          = "Manage Awards";
                viewModel.CanManage      = WebUser.Permissions.Contains(200);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "EmailTemplates":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#emailtemplate/create";
                viewModel.Title          = "Manage Email Templates";
                viewModel.CanManage      = WebUser.Permissions.Contains(200);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Users":
                viewModel.Title     = "Employees";
                viewModel.CanManage = WebUser.Permissions.Contains(210);
                if (viewModel.CanManage)
                {
                    viewModel.ShowCreateLink = true;
                    viewModel.CreateLink     = "#user/create";
                    viewModel.Title          = "Manage Employees";
                }
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("Code"),
                    UIField.GetField("Location"),
                    UIField.GetField("Department"),
                    UIField.GetField("Designation"),
                    UIField.GetField("LastActivity", "Last Activity", UIFieldTypes.DateTime)
                };
                break;

            case "Candidates":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#candidate/create";
                viewModel.Title          = "Manage Candidates";
                viewModel.CanManage      = WebUser.Permissions.Contains(500);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("Code"),
                    UIField.GetField("TotalExperience", "Total Experience"),
                    UIField.GetField("Source"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime)
                };
                break;

            case "Interviews":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("ScheduledOn"),
                    UIField.GetField("Status"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime)
                };
                break;

            case "TeamLeaves":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("CreatedByUser.Person.Name", "Employee"),
                    UIField.GetField("LeaveType.Title", "Leave Type"),
                    UIField.GetField("Duration"),
                    UIField.GetField("Start", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("Start", "End Date", UIFieldTypes.DateTime),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime),
                    UIField.GetField("Status", "Status")
                };
                break;

            case "Departments":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#department/create";
                viewModel.Title          = "Manage Departments";
                viewModel.CanManage      = WebUser.Permissions.Contains(210);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("MailAlias", "Mail Alias"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Designations":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#designation/create";
                viewModel.Title          = "Manage Designations";
                viewModel.CanManage      = WebUser.Permissions.Contains(210);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Department"),
                    UIField.GetField("Band"),
                    UIField.GetField("MailAlias"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Shifts":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#shift/create";
                viewModel.Title          = "Manage Shifts";
                viewModel.CanManage      = WebUser.Permissions.Contains(210);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("StartTime", "Start Time", UIFieldTypes.DateTime),
                    UIField.GetField("EndTime", "End Time", UIFieldTypes.DateTime),
                    UIField.GetField("NeedsCompensation", "Needs Compensation", UIFieldTypes.DateTime),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Skills":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#skill/create";
                viewModel.Title          = "Manage Skills";
                viewModel.CanManage      = WebUser.Permissions.Contains(210);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Hobbies":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#hobby/create";
                viewModel.Title          = "Manage Hobbies";
                viewModel.CanManage      = WebUser.Permissions.Contains(210);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Certifications":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#certification/create";
                viewModel.Title          = "Manage Certifications";
                viewModel.CanManage      = WebUser.Permissions.Contains(210);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "JobOpenings":
                viewModel.Title     = "Job Openings";
                viewModel.CanManage = WebUser.Permissions.Contains(500);
                viewModel.Fields    = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Vacancies"),
                    UIField.GetField("Status"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "CandidateDesignations":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Rounds":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Offers":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Holidays":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#holiday/create";
                viewModel.Title          = "Manage Holidays";
                viewModel.CanManage      = WebUser.Permissions.Contains(215);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Type"),
                    UIField.GetField("Date", "Date", UIFieldTypes.DateTime),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "LeaveTypes":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#leavetype/create";
                viewModel.Title          = "Manage Leave Types";
                viewModel.CanManage      = WebUser.Permissions.Contains(215);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "LeavePeriods":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#leaveperiod/create";
                viewModel.Title          = "Manage Leave Periods";
                viewModel.CanManage      = WebUser.Permissions.Contains(215);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Start", "Start", UIFieldTypes.DateTime),
                    UIField.GetField("End", "End", UIFieldTypes.DateTime),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Leaves":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#leave/create";
                viewModel.Title          = "Manage Leaves";
                viewModel.CanManage      = WebUser.Permissions.Contains(215);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Employee"),
                    UIField.GetField("LeaveType", "Leave Type"),
                    UIField.GetField("Duration"),
                    UIField.GetField("Period"),
                    UIField.GetField("AppliedOn", "Applied On", UIFieldTypes.DateTime),
                    UIField.GetField("Status"),
                    UIField.GetField("Approver"),
                    UIField.GetField("ActedOn", "Acted On", UIFieldTypes.DateTime)
                };
                break;

            case "Vendors":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Email"),
                    UIField.GetField("Phone"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "AssetCategories":
                viewModel.Fields = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "SoftwareCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#softwarecategory/create";
                viewModel.Title          = "Manage Software Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(230);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Softwares":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#software/create";
                viewModel.Title          = "Manage Softwares";
                viewModel.CanManage      = WebUser.Permissions.Contains(230);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Version"),
                    UIField.GetField("Status"),
                };
                break;

            case "LeadSources":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#leadsource/create";
                viewModel.Title          = "Manage Lead Sources";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "LeadStatus":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#leadstatus/create";
                viewModel.Title          = "Manage Lead Statues";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Name")
                };
                break;

            case "LeadCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#leadcategory/create";
                viewModel.Title          = "Manage Lead Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description")
                };
                break;

            case "Leads":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#lead/create";
                viewModel.Title          = "Manage Leads";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Expertise"),
                    UIField.GetField("Description")
                };
                break;

            case "SalesStages":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#salesstage/create";
                viewModel.Title          = "Manage Sales Stages";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Name"),
                    UIField.GetField("Status")
                };
                break;

            case "PotentialCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#potentialcategory/create";
                viewModel.Title          = "Manage Potential Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Description")
                };
                break;

            case "Potentials":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#potential/create";
                viewModel.Title          = "Manage Potentials";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("ExpectedAmount"),
                    UIField.GetField("ExpectedCloseDate"),
                    UIField.GetField("Description")
                };
                break;

            case "CRMAccounts":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#crmaccount/create";
                viewModel.Title          = "Manage Accounts";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Industry"),
                    UIField.GetField("Email"),
                    UIField.GetField("PhoneNo"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Contacts":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#contact/create";
                viewModel.Title          = "Manage Contacts";
                viewModel.CanManage      = WebUser.Permissions.Contains(220);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Expertise"),
                    UIField.GetField("Comments"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "RequirementCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#requirementcategory/create";
                viewModel.Title          = "Manage Requirement Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(225);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Requirements":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#requirement/create";
                viewModel.Title          = "Manage Requirements";
                viewModel.CanManage      = WebUser.Permissions.Contains(225);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Source"),
                    UIField.GetField("Category"),
                    UIField.GetField("BillingType", "Billing Type"),
                    UIField.GetField("Budget"),
                    UIField.GetField("Status"),
                    UIField.GetField("PostedOn", "Posted On", UIFieldTypes.DateTime),
                    UIField.GetField("RespondedOn", "Responded On", UIFieldTypes.DateTime)
                };
                break;

            case "Projects":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#project/create";
                viewModel.Title          = "Manage Projects";
                viewModel.CanManage      = WebUser.Permissions.Contains(240);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Status", "Status"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime)
                };
                break;

            case "Tasks":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#task/create";
                viewModel.Title          = "Manage Tasks";
                viewModel.CanManage      = WebUser.Permissions.Contains(240);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Code"),
                    UIField.GetField("Title"),
                    UIField.GetField("Project.Title", "Project"),
                    UIField.GetField("Priority"),
                    UIField.GetField("StartDate", "Start Date", UIFieldTypes.DateTime),
                    UIField.GetField("DueDate", "Due Date", UIFieldTypes.DateTime),
                    UIField.GetField("TaskStatus", "Status"),
                    UIField.GetField("CreatedOn", "Applied On", UIFieldTypes.DateTime)
                };
                break;

            case "ArticleCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#articlecategory/create";
                viewModel.Title          = "Manage Article Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(700);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("IsPublic"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Articles":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#article/create";
                viewModel.Title          = "Manage Articles";
                viewModel.CanManage      = WebUser.Permissions.Contains(700);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("Category.Title", "Category"),
                    UIField.GetField("IsPublic"),
                    UIField.GetField("IsFeatured"),
                    UIField.GetField("Hits"),
                    UIField.GetField("Rating"),
                    UIField.GetField("Version"),
                    UIField.GetField("State"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "TicketCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#ticketcategory/create";
                viewModel.Title          = "Manage Ticket Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(1100);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "TicketSubCategories":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#ticketsubcategory/create";
                viewModel.Title          = "Manage Ticket Sub Categories";
                viewModel.CanManage      = WebUser.Permissions.Contains(1100);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("CreatedOn", "Created On", UIFieldTypes.DateTime)
                };
                break;

            case "Tickets":
                viewModel.ShowCreateLink = true;
                viewModel.CreateLink     = "#ticket/create";
                viewModel.Title          = "Manage Tickets";
                viewModel.CanManage      = WebUser.Permissions.Contains(1100);
                viewModel.Fields         = new List <UIField>
                {
                    UIField.GetField("Title"),
                    UIField.GetField("DueDate", "Due Date", UIFieldTypes.DateTime),
                    UIField.GetField("AssignedTo", "Assigned To"),
                    UIField.GetField("Status"),
                    UIField.GetField("CreatedBy", "Created By"),
                    UIField.GetField("LastUpdatedOn", "Last Updated On", UIFieldTypes.DateTime)
                };
                break;
            }

            return(PartialView("_Table", viewModel));
        }