public string SaveFinancialyears(string startyear /*, string endyear*/, string status) { LeaveSchemeComponent newobj = new LeaveSchemeComponent(); string response = newobj.SaveFinancialyears(startyear /*, endyear*/, status); return(response); }
public bool checkyear(int usertypeid, int yearvalue) { LeaveSchemeComponent compobj = new LeaveSchemeComponent(); var response = compobj.checkyear(usertypeid, yearvalue); return(response); }
public string UpdateLeavescheme(string id, string userid, string accountid) { LeaveSchemeComponent objDtl = new LeaveSchemeComponent(); var strresponse = objDtl.UpdateLeavescheme(id, userid, accountid); return(strresponse); }
public JsonResult GetFinanacialYears() { LeaveSchemeComponent newobj = new LeaveSchemeComponent(); List <FinancialYearEntity> yearlist = newobj.GetFinanacialYears(); return(Json(yearlist, JsonRequestBehavior.AllowGet)); }
public string updateLeavecount(List <LeaveSchemeModel> leaveupdate) { LeaveSchemeComponent objDtl = new LeaveSchemeComponent(); var strresponse = objDtl.updateLeavecount(leaveupdate); return(strresponse); }
public JsonResult Getleaveschemebyid(string id) { LeaveSchemeComponent objDtl = new LeaveSchemeComponent(); List <LeaveSchemeEntity> lstleavetype = objDtl.Getleaveschemebyid(id); return(Json(lstleavetype, JsonRequestBehavior.AllowGet)); }
public string SaveLeavescheme(List <LeaveSchemeModel> jsonobj) { LeaveSchemeComponent objDtl = new LeaveSchemeComponent(); var strresponse = objDtl.SaveLeaveScheme(jsonobj); return(strresponse); }
public ActionResult HolidayCalendar() { var LeaveSchemeComponent = new LeaveSchemeComponent(); var FinancialYears = LeaveSchemeComponent.Getallfinancialyears().Select(a => new SelectListItem() { Value = a.FinancialYearId.ToString(), Text = a.StartDate.ToString(), }).OrderByDescending(x => x.Value); ViewBag.FinancialYears = FinancialYears; HomeController hm = new HomeController(); var obj = hm.GetAdminMenu(); var mk = "read"; foreach (var item in obj) { if (item.ModuleName == "Add Holiday Calendar") { mk = item.ModuleAccessType; ViewBag.a = mk; } } return(View()); }
public string ChangeStatus(string id, string status) { string strResponse = string.Empty; var objDtl = new LeaveSchemeComponent(); strResponse = objDtl.ChangeStatus(id, status); return(strResponse); }
public JsonResult GetLeaveTypes(string id, int yearid) { // LeaveSchemeEntity leavetypes = null; LeaveSchemeComponent objDtl = new LeaveSchemeComponent(); List <LeaveSchemeEntity> lstleavetype = objDtl.GetLeaveTypes(id, yearid); ViewBag.getleavetypes = lstleavetype; return(Json(lstleavetype, JsonRequestBehavior.AllowGet)); }
public JsonResult GetLeaveSchemeCollection() { List <LeaveSchemeEntity> LeaveSchemeDetails = null; try { var objDtl = new LeaveSchemeComponent(); LeaveSchemeDetails = objDtl.GetLeaveSchemeDetail(); ViewBag.LeaveSchemeDetails = LeaveSchemeDetails[0].LSchm_Version; } catch (Exception ex) { return(null); } return(Json(LeaveSchemeDetails, JsonRequestBehavior.AllowGet)); }
//UserSessionInfo objSessioninfo = new UserSessionInfo(); public ActionResult Index(bool?pdf) { UserSessionInfo _objSessioninfo = Session["UserSessionInfo"] as UserSessionInfo; int AccountId = _objSessioninfo.AccountId; ViewBag.AccountID = AccountId; int UserId = _objSessioninfo.UserId; ViewBag.Accountid = _objSessioninfo.AccountId; ViewBag.UserId = UserId; string roleID = _objSessioninfo.RoleName; LeaveSchemeComponent compobj = new LeaveSchemeComponent(); var Accountname = compobj.GetallAccountnames(AccountId, roleID).Select(a => new SelectListItem() { Value = a.Acc_AccountID.ToString(), Text = a.Acc_AccountName, }); ViewBag.accountnames = Accountname; ViewBag.Roleid = _objSessioninfo.RoleName; HomeController hm = new HomeController(); var obj = hm.GetAdminMenu(); var mk = "read"; foreach (var item in obj) { if (item.ModuleName == "Add Employeement Type") { mk = item.ModuleAccessType; ViewBag.a = mk; } } //} return(View()); }
//UserSessionInfo objSessioninfo = new UserSessionInfo(); public ActionResult Index(bool?pdf) { if (!pdf.HasValue) { #region to return LeaveTypeList //objSessioninfo.UserId = 501; //Session["UserSessionInfo"] = objSessioninfo; UserSessionInfo info = new UserSessionInfo(); int accountid = info.AccountId; List <LookupStatusDetail> objStatusList = new List <LookupStatusDetail>(); objStatusList.Add(new LookupStatusDetail { StatusID = 1, Status = "Active" }); objStatusList.Add(new LookupStatusDetail { StatusID = 0, Status = "InActive" }); var objStList = from cl in objStatusList orderby cl.StatusID select new { value = cl.StatusID, text = cl.Status }; ViewBag.Status = objStList; LeaveSchemeComponent compobj = new LeaveSchemeComponent(); var Accountname = compobj.GetallAccountnames(accountid).Select(a => new SelectListItem() { Value = a.Acc_AccountID.ToString(), Text = a.Acc_AccountName, }); ViewBag.Accountname = Accountname; HomeController hm = new HomeController(); var obj = hm.GetAdminMenu(); foreach (var item in obj) { //if (item.ModuleAccessType.ToLower() == "read/write") //{ // var mk = item.ModuleAccessType; // ViewBag.a = mk; //} //else //{ // var mk = item.ModuleAccessType; // ViewBag.a = mk; //} if (item.ModuleName == "Add Leave Type") { var mk = item.ModuleAccessType; ViewBag.a = mk; } } return(View()); #endregion } else { string filename = "LeaveType.pdf"; string filePath = Server.MapPath("~/Content/PDFs/" + filename); var objDtl = new LeaveTypeComponent(); IList <LeaveTypeEntity> LeaveTypeList = objDtl.GetLeaveTypeDetail(); ExportPDF(LeaveTypeList, new string[] { "LTyp_LeaveTypeID", "AccountName", "LTyp_LeaveType", "LTyp_LeaveTypeDescription" }, filePath); return(File(filePath, "application/pdf")); } }
public ActionResult Index(bool?pdf) { var LeaveSchemeComponent = new LeaveSchemeComponent(); if (!pdf.HasValue) { #region to return LeaveSchemeList //objSessioninfo.UserId = 501; //Session["UserSessionInfo"] = objSessioninfo; UserSessionInfo objinfo = new UserSessionInfo(); var accountid = objinfo.AccountId; ViewBag.accid = accountid; var usertypeid = objinfo.Usr_UserTypeID; List <LookupStatusDetail> objStatusList = new List <LookupStatusDetail>(); objStatusList.Add(new LookupStatusDetail { StatusID = 1, Status = "Active" }); objStatusList.Add(new LookupStatusDetail { StatusID = 0, Status = "InActive" }); var objStList = from cl in objStatusList orderby cl.StatusID select new { value = cl.StatusID, text = cl.Status }; ViewBag.Status = objStList; var Employeementtypes = LeaveSchemeComponent.GetAllEmployeementtypes().Select(a => new SelectListItem() { Value = a.Usr_UserTypeID.ToString(), Text = a.UserType, }); ViewBag.Employeementtypes = Employeementtypes; var UserTypes = LeaveSchemeComponent.GetAllUserTypes().Select(a => new SelectListItem() { Value = a.Usr_UserTypeID.ToString(), Text = a.UserType, }); ViewBag.UserTypes = UserTypes; var Accountname = LeaveSchemeComponent.GetallAccountnames(accountid).Select(a => new SelectListItem() { Value = a.Acc_AccountID.ToString(), Text = a.Acc_AccountName, }); ViewBag.Accountname = Accountname; var FinancialYears = LeaveSchemeComponent.Getallfinancialyears().Select(a => new SelectListItem() { Value = a.FinancialYearId.ToString(), Text = a.financialyear, }).OrderByDescending(x => x.Value); ViewBag.FinancialYears = FinancialYears; var leavetypes = LeaveSchemeComponent.Getallleavetypes(); ViewBag.leavecount = leavetypes.Count(); ViewBag.leavetypes = leavetypes; HomeController hm = new HomeController(); var obj = hm.GetAdminMenu(); foreach (var item in obj) { if (item.ModuleName == "Add Leave Scheme") { var mk = item.ModuleAccessType; ViewBag.a = mk; } //if (item.ModuleAccessType.ToLower() == "read/write") //{ // var mk = item.ModuleAccessType; // ViewBag.a = mk; //} //else //{ // var mk = item.ModuleAccessType; // ViewBag.a = mk; //} } return(View()); #endregion } else { string filename = "LeaveScheme.pdf"; string filePath = Server.MapPath("~/Content/PDFs/" + filename); var objDtl = new LeaveSchemeComponent(); IList <LeaveSchemeEntity> LeaveSchemeList = objDtl.GetLeaveSchemeDetail(); ExportPDF(LeaveSchemeList, new string[] { "LSchm_LeaveSchemeID", "AccountName", "LSchm_LeaveScheme", "LSchm_LeaveSchemeDescription" }, filePath); return(File(filePath, "application/pdf")); } }
//UserSessionInfo objSessioninfo = new UserSessionInfo(); public ActionResult Index(bool?pdf) { var RoleComponent = new RoleComponent(); HomeController hm = new HomeController(); var obj = hm.GetAdminMenu(); var mk = "read"; foreach (var item in obj) { //if (item.ModuleAccessType == "Read") //{ // var mk = item.ModuleAccessType; // ViewBag.a = mk; //} if (item.ModuleName == "Add Role") { mk = item.ModuleAccessType; ViewBag.a = mk; } } if (!pdf.HasValue) { #region to return RoleList //objSessioninfo.UserId = 501; //Session["UserSessionInfo"] = objSessioninfo; UserSessionInfo info = new UserSessionInfo(); var rolename = info.RoleName; int userid = info.UserId; int accountId = info.AccountId; string RoleId = info.RoleName; ViewBag.accid = accountId; var orgcomponent = new OrganizationAccountComponent(); List <LookupStatusDetail> objStatusList = new List <LookupStatusDetail>(); objStatusList.Add(new LookupStatusDetail { StatusID = 1, Status = "Active" }); objStatusList.Add(new LookupStatusDetail { StatusID = 0, Status = "InActive" }); var objStList = from cl in objStatusList orderby cl.StatusID select new { value = cl.StatusID, text = cl.Status }; ViewBag.Status = objStList; var modules = RoleComponent.Getallmodules(); ViewBag.modules = modules; ViewBag.Roleid = info.RoleName; var access = RoleComponent.Getallaccess(); ViewBag.access = access; var objDtl = new UserComponent(); LeaveSchemeComponent compobj = new LeaveSchemeComponent(); var AccountNames = compobj.GetallAccountnames(accountId, RoleId).Select(a => new SelectListItem() { Value = a.Acc_AccountID.ToString(), Text = a.Acc_AccountName, }); ViewBag.accountnames = AccountNames; var rolenames = orgcomponent.Getrolenames(rolename).Select(a => new SelectListItem() { Value = a.GenericRoleID.ToString(), Text = a.Title, }); ViewBag.rolenames = rolenames; return(View()); #endregion } else { UserSessionInfo info = new UserSessionInfo(); var rolename = info.RoleName; ViewBag.Roleid = info.RoleName; int accountid = info.AccountId; string filename = "Role.pdf"; string filePath = Server.MapPath("~/Content/PDFs/" + filename); var objDtl = new RoleComponent(); IList <RoleEntity> RoleList = objDtl.GetRoleDetail(accountid, rolename); //ExportPDF(RoleList, new string[] { "Rol_RoleID", "AccountName", "Rol_RoleCode", "Rol_RoleName", "Rol_RoleDescription" }, filePath); return(File(filePath, "application/pdf")); } }