public IActionResult ParameterChangeOrderNo(Int64 ParameterID1, Int64 ParameterID2, int OrderNo1, int OrderNo2)
        {
            ExcelHepler Helper   = new ExcelHepler(_hostingEnvironment);
            string      userId   = _userManager.GetUserId(HttpContext.User);
            string      userName = HttpContext.User.Identity.Name;

            ParameterService parameterService = new ParameterService(_context);
            FileService      FileService      = new FileService(_hostingEnvironment, _context);

            PDC_Parameter item1 = parameterService.GetParameterOne(ParameterID1);
            PDC_Parameter item2 = parameterService.GetParameterOne(ParameterID2);

            string ErrorMsg = string.Empty;

            item1.OrderNo      = OrderNo1;
            item1.Modifyer     = userId;
            item1.ModifyerName = userName;
            item1.ModifyerDate = DateTime.Now;
            parameterService.UpdateParameter(item1, ref ErrorMsg);


            item2.OrderNo      = OrderNo2;
            item2.Modifyer     = userId;
            item2.ModifyerName = userName;
            item2.ModifyerDate = DateTime.Now;
            parameterService.UpdateParameter(item2, ref ErrorMsg);



            return(Json(ErrorMsg));
        }
        public IActionResult UploadWorkDetail(string ParameterText, string ParameterValue, IFormFile file)
        {
            ParameterService parameterService = new ParameterService(_context);
            FileService      FileService      = new FileService(_hostingEnvironment, _context);
            string           ErrorMsg         = string.Empty;
            string           userId           = _userManager.GetUserId(HttpContext.User);
            string           userName         = HttpContext.User.Identity.Name;

            PDC_File      newFile = new PDC_File();
            PDC_Parameter item    = parameterService.GetParameterOne("ConfigurationWorkDetail");

            if (file.Length > 0)
            {
                PDC_File WorkDetail_File = FileService.GetFileList("ConfigurationWorkDetail", item.ParameterID).FirstOrDefault();

                if (WorkDetail_File != null)
                {
                    FileService.FileRemove(WorkDetail_File.FileID);
                }

                FileService.FileAdd(file, "ConfigurationWorkDetail", userId, userName, out newFile, item.ParameterID);
            }

            item.ParameterText  = ParameterText;
            item.ParameterValue = ParameterValue;
            item.Modifyer       = userId;
            item.ModifyerName   = userName;
            item.ModifyerDate   = DateTime.Now;

            parameterService.UpdateParameter(item, ref ErrorMsg);

            return(Json(new { ErrorMsg = ErrorMsg, File = newFile }));
        }
        public IActionResult UploadProjectTime(string ApplyDrawText, string SendReturnText, string ReleaseText, string RejectText)
        {
            ParameterService parameterService = new ParameterService(_context);
            string           userId           = _userManager.GetUserId(HttpContext.User);
            string           userName         = HttpContext.User.Identity.Name;

            string ErrorMsg = string.Empty;

            PDC_Parameter ApplyDrawitem = parameterService.GetParameterOne("ConfigurationApplyDraw");

            ApplyDrawitem.ParameterText = ApplyDrawText;
            ApplyDrawitem.Modifyer      = userId;
            ApplyDrawitem.ModifyerName  = userName;
            ApplyDrawitem.ModifyerDate  = DateTime.Now;

            PDC_Parameter SendReturnitem = parameterService.GetParameterOne("ConfigurationSendReturn");

            SendReturnitem.ParameterText = SendReturnText;
            SendReturnitem.Modifyer      = userId;
            SendReturnitem.ModifyerName  = userName;
            SendReturnitem.ModifyerDate  = DateTime.Now;

            PDC_Parameter Releaseitem = parameterService.GetParameterOne("ConfigurationRelease");

            Releaseitem.ParameterText = ReleaseText;
            Releaseitem.Modifyer      = userId;
            Releaseitem.ModifyerName  = userName;
            Releaseitem.ModifyerDate  = DateTime.Now;

            PDC_Parameter Rejectitem = parameterService.GetParameterOne("ConfigurationReject");

            Rejectitem.ParameterText = RejectText;
            Rejectitem.Modifyer      = userId;
            Rejectitem.ModifyerName  = userName;
            Rejectitem.ModifyerDate  = DateTime.Now;

            parameterService.UpdateParameter(ApplyDrawitem, ref ErrorMsg);
            parameterService.UpdateParameter(SendReturnitem, ref ErrorMsg);
            parameterService.UpdateParameter(Releaseitem, ref ErrorMsg);
            parameterService.UpdateParameter(Rejectitem, ref ErrorMsg);

            return(Json(ErrorMsg));
        }
Пример #4
0
        public async Task <IActionResult> PutParameter([FromRoute] int id, [FromBody] Parameter parameter)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != parameter.Id)
            {
                return(BadRequest());
            }

            await _parameterService.UpdateParameter(id, parameter);

            return(NoContent());
        }
        public IActionResult SavePCB(Int64 ParameterID, string ParameterDesc)
        {
            ParameterService parameterService = new ParameterService(_context);
            string           userId           = _userManager.GetUserId(HttpContext.User);
            string           userName         = HttpContext.User.Identity.Name;

            PDC_Parameter m_PCBParameter = parameterService.GetParameterOne(ParameterID);

            string ErrorMsg = string.Empty;

            m_PCBParameter.ParameterDesc = ParameterDesc;
            m_PCBParameter.Modifyer      = userId;
            m_PCBParameter.ModifyerName  = userName;
            m_PCBParameter.ModifyerDate  = DateTime.Now;
            parameterService.UpdateParameter(m_PCBParameter, ref ErrorMsg);

            return(Json(ErrorMsg));
        }
        public IActionResult UploadDescription(string ParameterText)
        {
            ParameterService parameterService = new ParameterService(_context);

            string userId   = _userManager.GetUserId(HttpContext.User);
            string userName = HttpContext.User.Identity.Name;

            string ErrorMsg = string.Empty;

            PDC_Parameter item = parameterService.GetParameterOne("ConfigurationDescription");

            item.ParameterText = ParameterText;
            item.Modifyer      = userId;
            item.ModifyerName  = userName;
            item.ModifyerDate  = DateTime.Now;

            parameterService.UpdateParameter(item, ref ErrorMsg);

            return(Json(ErrorMsg));
        }