Пример #1
0
        public async Task <IHttpActionResult> AddUploadLog(AddUploadLogParameter param)
        {
            var adapter = new MyPatchStoredProcedureAdapter();

            var procParam = new AddUploadLogParams
            {
                Upload_Date = param.UploadDate,
                Login_ID    = param.LoginID,
                Status      = param.Status,
                File_Path   = param.FilePath,
                Total_Time  = float.Parse(param.TotalTime),
                App_Version = param.AppVersion,
                OS_Type     = param.OSType,
                OS_Version  = param.OSVersion,
                MacAddr     = param.MacAddr
            };

            var result = adapter.ExecuteStoredProcedure <int>(procParam.StoredProcedureName, procParam).SingleOrDefault();

            if (result > 0)
            {
                return(Ok());
            }

            return(BadRequest());
        }
Пример #2
0
        public bool InsertUploadLog(string UploadDate, string LoginID, string Status, string FilePath, int ElapsedTime, string AppVersion, string OSType, string OSVersion, string MacAddr)
        {
            var procParam = new AddUploadLogParams
            {
                Upload_Date = UploadDate,
                Login_ID    = LoginID,
                Status      = Status,
                File_Path   = FilePath,
                Total_Time  = (float)ElapsedTime,
                App_Version = AppVersion,
                OS_Type     = OSType,
                OS_Version  = OSVersion,
                MacAddr     = MacAddr
            };

            var adapter    = new MyPatchStoredProcedureAdapter();
            var procResult = adapter.ExecuteStoredProcedure <int>(procParam.StoredProcedureName, procParam).SingleOrDefault();

            if (procResult > 0)
            {
                return(true);
            }

            return(false);
        }
Пример #3
0
        public async Task <IHttpActionResult> EmployeeList(EmployeeListParameter param)
        {
            var adapter = new MyPatchStoredProcedureAdapter();

            var procParam = new EmployeeListParams
            {
                SupervisorID = param.SupervisorID
            };

            var dbEmployees = adapter.ExecuteStoredProcedure <EmployeeListModel>(procParam.StoredProcedureName, procParam);
            var employees   = dbEmployees.ToList <EmployeeListModel>();

            if (employees.Count > 0)
            {
                return(Ok(employees));
            }

            return(NotFound());
        }
Пример #4
0
        public async Task <IHttpActionResult> VerifyLogin(VerifyLoginParameter param)
        {
            var adapter = new MyPatchStoredProcedureAdapter();

            var procParam = new VerifyLoginParams
            {
                UserID   = param.UserID,
                Password = param.Password,
                MacAddr  = param.MacAddr
            };

            var dbLogins = adapter.ExecuteStoredProcedure <VerifyLoginModel>(procParam.StoredProcedureName, procParam);
            var Logins   = dbLogins.ToList <VerifyLoginModel>();

            if (Logins.Count > 0)
            {
                return(Ok(Logins[0]));
            }

            return(NotFound());
        }
Пример #5
0
        public async Task <IHttpActionResult> GetFileName(GetFileNameParameter param)
        {
            string userName = param.UserName;

            var outputModel = new ResourceFileNameModel();

            outputModel.UserName = userName;

            var adapter = new MyPatchStoredProcedureAdapter();

            var procParam = new GetDBFileParams
            {
                UserID = userName,
                AppID  = param.AppID,
                OS     = param.OS
            };

            var dbFileNames = adapter.ExecuteStoredProcedure <DBFileNameModel>(procParam.StoredProcedureName, procParam);

            outputModel.DbFileNames = dbFileNames.ToList <DBFileNameModel>();

            return(Ok(outputModel));
        }