Exemple #1
0
        public async Task <IActionResult> PutSamplingUFTDetail([FromRoute] long RSubAppraisalID, [FromQuery] long RAppraisalID, [FromQuery] string CIFName, [FromQuery] string AANo, [FromQuery] string RoomNo,
                                                               [FromQuery] string BuildingNo, [FromQuery] string RegisterNumber, [FromQuery] string FloorNoCondo, [FromQuery] string PositionLatitude, [FromQuery] string PositionLongtitude, [FromQuery] bool chkconstruction)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                using (var context = new DBCams3context())
                {
                    var getDataUpdate = (from updateData in context.SamplingUFTDetail
                                         where updateData.RSubAppraisalID == RSubAppraisalID
                                         select updateData).FirstOrDefault();
                    if (getDataUpdate != null)
                    {
                        getDataUpdate.RSubAppraisalID    = RSubAppraisalID;
                        getDataUpdate.RAppraisalID       = RAppraisalID;
                        getDataUpdate.CIFName            = CIFName;
                        getDataUpdate.AANo               = AANo;
                        getDataUpdate.RoomNo             = RoomNo;
                        getDataUpdate.BuildingNo         = BuildingNo;
                        getDataUpdate.RegisterNumber     = RegisterNumber;
                        getDataUpdate.FloorNoCondo       = FloorNoCondo;
                        getDataUpdate.PositionLatitude   = PositionLatitude;
                        getDataUpdate.PositionLongtitude = PositionLongtitude;
                        getDataUpdate.chkconstruction    = chkconstruction;
                    }
                    else
                    {
                        return(Ok(EnumMessage.StatusMessage.Error.NotFoundUpdate));
                    }
                    _context.Update(getDataUpdate);
                    await _context.SaveChangesAsync();

                    return(Ok(EnumMessage.StatusMessage.Success.DataSaveChange));
                }
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SamplingUFTDetailExists(RSubAppraisalID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
        }
Exemple #2
0
 public SamplingLBFTDetailsController(DBCams3context context)
 {
     _context = context;
 }
Exemple #3
0
 public SamplingworkLTFController(DBCams3context context)
 {
     _context = context;
 }
Exemple #4
0
 public SamplingProjectViewController(DBCams3context context)
 {
     _context = context;
 }
Exemple #5
0
 public SamplingworkFTMainController(DBCams3context context)
 {
     _context = context;
 }
Exemple #6
0
 public AppraisalsController(DBCams3context context)
 {
     _context = context;
 }
Exemple #7
0
 public RAppraisalInfoesController(DBCams3context context)
 {
     _context = context;
 }