Example #1
0
        public DTOTaskDetailResponse CreateUpdateTaskDetail(DTOAPITask objTask, DTOAPITaskDetail objTaskDetail, IFormFile objFile)
        {
            DTOTaskDetailResponse objDTOStatus = new DTOTaskDetailResponse();

            objDTOStatus.isSuccess  = true;
            objDTOStatus.message    = "";
            objDTOStatus.taskDetail = new DTOTaskDetail();

            // Get Settings
            string CurrentHostLocation = $"{this.Request.Scheme}://{this.Request.Host}{this.Request.PathBase}";
            string ContentRootPath     = _hostEnvironment.ContentRootPath;
            string strCurrentUser      = this.User.Claims.FirstOrDefault().Value;
            string strConnectionString = GetConnectionString();
            int    intUserId           = -1;
            bool   IsSuperUser         = true;
            bool   IsAdministrator     = true;
            bool   IsAuthenticated     = true;

            try
            {
                DTOTask paramTask = ExternalAPIUtility.MapAPITaskToTask(objTask, objTaskDetail);

                objDTOStatus = UploadTaskController.InsertUpdateTaskDetailMethod(
                    strConnectionString,
                    CurrentHostLocation,
                    ContentRootPath,
                    paramTask,
                    objFile,
                    strCurrentUser,
                    intUserId,
                    IsSuperUser,
                    IsAdministrator,
                    strCurrentUser,
                    IsAuthenticated);
            }
            catch (Exception ex)
            {
                objDTOStatus.isSuccess = false;
                objDTOStatus.message   = ex.GetBaseException().Message;
            }

            return(objDTOStatus);
        }
Example #2
0
        public DTOStatus UpdateTask(DTOAPITask objTask)
        {
            DTOStatus objDTOStatus = new DTOStatus();

            objDTOStatus.Success       = true;
            objDTOStatus.StatusMessage = "";

            // Get Settings
            string CurrentHostLocation = $"{this.Request.Scheme}://{this.Request.Host}{this.Request.PathBase}";
            string ContentRootPath     = _hostEnvironment.ContentRootPath;
            string strCurrentUser      = this.User.Claims.FirstOrDefault().Value;
            string strConnectionString = GetConnectionString();
            int    intUserId           = -1;
            bool   IsAuthenticated     = true;

            try
            {
                DTOTask paramTask = ExternalAPIUtility.MapAPITaskToTask(objTask, null);

                objDTOStatus = UploadTaskController.UpdateTaskMethod(
                    strConnectionString,
                    CurrentHostLocation,
                    ContentRootPath,
                    paramTask,
                    strCurrentUser,
                    intUserId,
                    IsAuthenticated);
            }
            catch (Exception ex)
            {
                objDTOStatus.Success       = false;
                objDTOStatus.StatusMessage = ex.GetBaseException().Message;
            }

            return(objDTOStatus);
        }