Exemplo n.º 1
0
        public async Task <IHttpActionResult> AddUploadLog(AddUploadLogParameter param)
        {
            var adapter = new MyPatchSGStoredProcedureAdapter();

            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());
        }
Exemplo n.º 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 MyPatchSGStoredProcedureAdapter();
            var procResult = adapter.ExecuteStoredProcedure <int>(procParam.StoredProcedureName, procParam).SingleOrDefault();

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

            return(false);
        }