コード例 #1
0
ファイル: UserController.cs プロジェクト: kunhat9/Studies
        public PartialViewResult _Students_Details(string userID)
        {
            TB_USERS user = new TB_USERS();

            try
            {
                user = User_Service.GetById(int.Parse(userID));
            }
            catch (Exception ex)
            {
                CORE.Helpers.IOHelper.WriteLog(StartUpPath, "UserController :", ex.Message, ex.ToString());
            }

            return(PartialView(user));
        }
コード例 #2
0
ファイル: UserController.cs プロジェクト: kunhat9/Studies
        public PartialViewResult _Accountant_Details(string userID)
        {
            TB_USERS user = new TB_USERS();

            try
            {
                user            = User_Service.GetById(int.Parse(userID));
                user.UserStatus = user.UserStatus.Equals("A") ? "1" : "0";
            }
            catch (Exception ex)
            {
                CORE.Helpers.IOHelper.WriteLog(StartUpPath, "UserController :", ex.Message, ex.ToString());
            }

            return(PartialView(user));
        }
コード例 #3
0
ファイル: AjaxController.cs プロジェクト: kunhat9/Studies
        public JsonResult ExportProduct(string userId, string startDate, string endDate, string type)
        {
            AjaxResultModel Result = new AjaxResultModel();

            try
            {
                TB_USERS user = new TB_USERS();
                user = User_Service.GetById(Int32.Parse(userId));
                string fileName = "\\Export\\HD" + user.UserFullName + "_" + startDate + "_" + endDate + ".xls";
                string filePath = HttpContext.Server.MapPath("~" + fileName);
                string err      = "";
                if (type.Equals("STUDIES"))
                {
                    err = BillExport(filePath, userId, startDate, endDate, type);
                }
                else
                {
                    err = User_Service.ReportSalaryTeacher(userId, startDate, endDate);
                    if (err.Equals("00"))
                    {
                        err = "";
                    }
                }

                if (string.IsNullOrEmpty(err))
                {
                    Result.Code   = 0;
                    Result.Result = fileName;
                }
                else
                {
                    Result.Code   = 999;
                    Result.Result = err;
                }
            }
            catch (Exception Ex)
            {
                Result.Code   = 2000;
                Result.Result = "Có lỗi xảy ra. Vui lòng thử lại sau hoặc liên hệ với người quản trị.";
                IOHelper.WriteLog(StartUpPath, IpAddress, "Ajax::ExportProduct :", Ex.Message, Ex.ToString());
            }
            return(Json(Result));
        }