Esempio n. 1
0
        public ActionResult Salary(EmployeeFilter filter)
        {
            var model = SalaryReport.Get(UserID, Employee.ID, Employee.BussinessID, filter);

            if (Request.IsAjaxRequest())
            {
                return(Json(new
                {
                    html = RenderPartialViewToString(Views.SalaryPartial, model)
                }, JsonRequestBehavior.DenyGet));
            }
            return(View(Views.Salary, model));
        }
Esempio n. 2
0
        public ActionResult SalaryDownload(EmployeeFilter filter)
        {
            var result = false;

            try
            {
                var data = SalaryReport.Get(UserID, Employee.ID, Employee.BussinessID, filter);
                if (data != null)
                {
                    var fileName = String.Format("Salary_{0}.xls", DateTime.Now.ToString("ddMMyyyyHHmmss"));
                    var file     = String.Format("{0}/Content/Download/{1}", SiteConfiguration.ApplicationPath, fileName);
                    Functions.CheckDirectory(String.Format("{0}/Content/Download/", SiteConfiguration.ApplicationPath));
                    SaveDownloadSalary(file, data);
                    Session[SessionKey.Download] = fileName;
                    result = true;
                }
            }
            catch { }
            return(Json(new
            {
                result = result
            }, JsonRequestBehavior.DenyGet));
        }