Esempio n. 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;
                }
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> PutSamplingworkFTMain([FromQuery] SamplingworkFTMain samplingworkFTMain)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }
                var updateData = _context.SamplingworkFTMain.Where(x => x.RAppraisalID == samplingworkFTMain.RAppraisalID).FirstOrDefault();
                if (updateData == null)
                {
                    return(NotFound(EnumMessage.StatusMessage.Error.NotFoundUpdate));
                }
                else
                {
                    updateData.AppraisalID          = samplingworkFTMain.AppraisalID;
                    updateData.ProjectName          = samplingworkFTMain.ProjectName;
                    updateData.ProjectCode          = samplingworkFTMain.ProjectCode;
                    updateData.MonthCheck           = samplingworkFTMain.MonthCheck;
                    updateData.YearCheck            = samplingworkFTMain.YearCheck;
                    updateData.BankDateCheck        = samplingworkFTMain.BankDateCheck;
                    updateData.SubCategory          = samplingworkFTMain.SubCategory;
                    updateData.Landplot             = samplingworkFTMain.Landplot;
                    updateData.RoomPlan             = samplingworkFTMain.RoomPlan;
                    updateData.ProjPlan             = samplingworkFTMain.ProjPlan;
                    updateData.House_Roomno         = samplingworkFTMain.House_Roomno;
                    updateData.Pictures             = samplingworkFTMain.Pictures;
                    updateData.OtherDocument        = samplingworkFTMain.OtherDocument;
                    updateData.AppraisalBankid      = samplingworkFTMain.AppraisalBankid;
                    updateData.AppraisalDate        = samplingworkFTMain.AppraisalDate;
                    updateData.ChkReportBankid      = samplingworkFTMain.ChkReportBankid;
                    updateData.ChkReportdate        = samplingworkFTMain.ChkReportdate;
                    updateData.AssistantAppDirector = samplingworkFTMain.AssistantAppDirector;
                    updateData.AssistDate           = samplingworkFTMain.AssistDate;
                    _context.Update(updateData);
                    await _context.SaveChangesAsync();

                    return(Ok(EnumMessage.StatusMessage.Success.DataSaveChange));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> PutSamplingworkLTF([FromQuery] SamplingworkLTF samplingworkLTF)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }


                var updateData = _context.SamplingworkLTF.Where(x => x.RAppraisalID == samplingworkLTF.RAppraisalID).FirstOrDefault();
                if (updateData == null)
                {
                    return(NotFound(EnumMessage.StatusMessage.Error.NotFoundUpdate));
                }
                else
                {
                    updateData.RJobType             = samplingworkLTF.RJobType;
                    updateData.ProjectName          = samplingworkLTF.ProjectName;
                    updateData.ProjectCode          = samplingworkLTF.ProjectCode;
                    updateData.CIFName              = samplingworkLTF.CIFName;
                    updateData.AANo                 = samplingworkLTF.AANo;
                    updateData.APNO                 = samplingworkLTF.APNO;
                    updateData.ConstDeedNo          = samplingworkLTF.ConstDeedNo;
                    updateData.LandNo               = samplingworkLTF.LandNo;
                    updateData.SubCategory          = samplingworkLTF.SubCategory;
                    updateData.SplitEntry           = samplingworkLTF.SplitEntry;
                    updateData.Street               = samplingworkLTF.Street;
                    updateData.SubDistrict          = samplingworkLTF.SubDistrict;
                    updateData.District             = samplingworkLTF.District;
                    updateData.Province             = samplingworkLTF.Province;
                    updateData.AssessCompany        = samplingworkLTF.AssessCompany;
                    updateData.MonthCheck           = samplingworkLTF.MonthCheck;
                    updateData.LastDateSurvey       = samplingworkLTF.LastDateSurvey;
                    updateData.BankDateCheck        = samplingworkLTF.BankDateCheck;
                    updateData.checkdevland         = samplingworkLTF.checkdevland;
                    updateData.chkpublicutility     = samplingworkLTF.chkpublicutility;
                    updateData.chkconstruction      = samplingworkLTF.chkconstruction;
                    updateData.chkfacility          = samplingworkLTF.chkfacility;
                    updateData.chklandlocation      = samplingworkLTF.chklandlocation;
                    updateData.surveybanklist       = samplingworkLTF.surveybanklist;
                    updateData.appraisalbanklist    = samplingworkLTF.appraisalbanklist;
                    updateData.Ownerbanklist        = samplingworkLTF.Ownerbanklist;
                    updateData.Otherdetail          = samplingworkLTF.Otherdetail;
                    updateData.Remark               = samplingworkLTF.Remark;
                    updateData.Buildingplan         = samplingworkLTF.Buildingplan;
                    updateData.Other                = samplingworkLTF.Other;
                    updateData.Appraisalchk         = samplingworkLTF.Appraisalchk;
                    updateData.CommentDetail        = samplingworkLTF.CommentDetail;
                    updateData.AppraisalBankid      = samplingworkLTF.AppraisalBankid;
                    updateData.AppraisalDate        = samplingworkLTF.AppraisalDate;
                    updateData.chkmistake           = samplingworkLTF.chkmistake;
                    updateData.mistakedetail        = samplingworkLTF.mistakedetail;
                    updateData.warningletter        = samplingworkLTF.warningletter;
                    updateData.warningdetail        = samplingworkLTF.warningdetail;
                    updateData.Headteam             = samplingworkLTF.Headteam;
                    updateData.datecheck            = samplingworkLTF.datecheck;
                    updateData.AssistantAppDirector = samplingworkLTF.AssistantAppDirector;
                    updateData.AssistDate           = samplingworkLTF.AssistDate;
                    updateData.AppDirector          = samplingworkLTF.AppDirector;
                    updateData.AppDireDate          = samplingworkLTF.AppDireDate;
                    updateData.reportdetail         = samplingworkLTF.reportdetail;
                    _context.Update(updateData);
                    await _context.SaveChangesAsync();

                    return(Ok(EnumMessage.StatusMessage.Success.DataSaveChange));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Esempio n. 4
0
        public async Task <IActionResult> PutRAppraisalInfo([FromQuery] RAppraisalInfo rAppraisalInfo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                var updateData = (from data in _context.RAppraisalInfo
                                  where data.RAppraisalID == rAppraisalInfo.RAppraisalID
                                  select data).FirstOrDefault();
                if (updateData == null)
                {
                    return(BadRequest(EnumMessage.StatusMessage.Error.NotFoundUpdate));
                }
                else
                {
                    updateData.RAppraisalID          = rAppraisalInfo.RAppraisalID;
                    updateData.AppraisalID           = rAppraisalInfo.AppraisalID;
                    updateData.DateCompCheck         = rAppraisalInfo.DateCompCheck;
                    updateData.BankDateCheck         = rAppraisalInfo.BankDateCheck;
                    updateData.CIFName               = rAppraisalInfo.CIFName;
                    updateData.MonthCheck            = rAppraisalInfo.MonthCheck;
                    updateData.YearCheck             = rAppraisalInfo.YearCheck;
                    updateData.APPNO                 = rAppraisalInfo.APPNO;
                    updateData.ProjectName           = rAppraisalInfo.ProjectName;
                    updateData.Houseno               = rAppraisalInfo.Houseno;
                    updateData.Street                = rAppraisalInfo.Street;
                    updateData.SubDistrict           = rAppraisalInfo.SubDistrict;
                    updateData.District              = rAppraisalInfo.District;
                    updateData.Province              = rAppraisalInfo.Province;
                    updateData.LandLocationDetail    = rAppraisalInfo.LandLocationDetail;
                    updateData.Publicutility         = rAppraisalInfo.Publicutility;
                    updateData.Otherdetail           = rAppraisalInfo.Otherdetail;
                    updateData.DocumentType          = rAppraisalInfo.DocumentType;
                    updateData.DocumentNo            = rAppraisalInfo.DocumentNo;
                    updateData.AreaNgan              = rAppraisalInfo.AreaNgan;
                    updateData.AreaRai               = rAppraisalInfo.AreaRai;
                    updateData.AreaWa                = rAppraisalInfo.AreaWa;
                    updateData.LCAppraisalUPrice     = rAppraisalInfo.LCAppraisalUPrice;
                    updateData.LCAppraisalPrice      = rAppraisalInfo.LCAppraisalPrice;
                    updateData.LBAppraisalUPrice     = rAppraisalInfo.LBAppraisalUPrice;
                    updateData.LBAppraisalPrice      = rAppraisalInfo.LBAppraisalPrice;
                    updateData.LBPriceSuitable       = rAppraisalInfo.LBPriceSuitable;
                    updateData.LDAppraisalPrice      = rAppraisalInfo.LDAppraisalPrice;
                    updateData.LHigh_lower           = rAppraisalInfo.LHigh_lower;
                    updateData.LDiffAppraisalPercent = rAppraisalInfo.LDiffAppraisalPercent;
                    updateData.LAcceptPrice          = rAppraisalInfo.LAcceptPrice;
                    updateData.BuildingModel         = rAppraisalInfo.BuildingModel;
                    updateData.NoOfFloor             = rAppraisalInfo.NoOfFloor;
                    updateData.DocuementAttach       = rAppraisalInfo.DocuementAttach;
                    updateData.BCAppraisalPrice      = rAppraisalInfo.BCAppraisalPrice;
                    updateData.BBAppraisalPrice      = rAppraisalInfo.BBAppraisalPrice;
                    updateData.BDAppraisalPrice      = rAppraisalInfo.BDAppraisalPrice;
                    updateData.BHigh_lower           = rAppraisalInfo.BHigh_lower;
                    updateData.BDiffAppraisalPercent = rAppraisalInfo.BDiffAppraisalPercent;
                    updateData.BPriceSuitable        = rAppraisalInfo.BPriceSuitable;
                    updateData.BAcceptPrice          = rAppraisalInfo.BAcceptPrice;
                    updateData.TPriceSuitable        = rAppraisalInfo.TPriceSuitable;
                    updateData.TCAppraisalPrice      = rAppraisalInfo.TCAppraisalPrice;
                    updateData.TBAppraisalPrice      = rAppraisalInfo.TBAppraisalPrice;
                    updateData.TDAppraisalPrice      = rAppraisalInfo.TDAppraisalPrice;
                    updateData.THigh_lower           = rAppraisalInfo.THigh_lower;
                    updateData.TDiffAppraisalPercent = rAppraisalInfo.TDiffAppraisalPercent;
                    updateData.AppraisalSummary      = rAppraisalInfo.AppraisalSummary;
                    updateData.AppraisalList         = rAppraisalInfo.AppraisalList;
                    updateData.AppraisalBankid       = rAppraisalInfo.AppraisalBankid;
                    updateData.AppraisalDate         = rAppraisalInfo.AppraisalDate;
                    updateData.chkmistake            = rAppraisalInfo.chkmistake;
                    updateData.mistakedetail         = rAppraisalInfo.mistakedetail;
                    updateData.warningletter         = rAppraisalInfo.warningletter;
                    updateData.warningdetail         = rAppraisalInfo.warningdetail;
                    updateData.Headteam              = rAppraisalInfo.Headteam;
                    updateData.datecheck             = rAppraisalInfo.datecheck;
                    updateData.AssistantAppDirector  = rAppraisalInfo.AssistantAppDirector;
                    updateData.AssistDate            = rAppraisalInfo.AssistDate;
                    updateData.AppDirector           = rAppraisalInfo.AppDirector;
                    updateData.AppDireDate           = rAppraisalInfo.AppDireDate;
                    _context.Update(updateData);
                    await _context.SaveChangesAsync();

                    return(Ok(EnumMessage.StatusMessage.Success.DataSaveChange));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }