Пример #1
0
        public async Task <IActionResult> Update(int Id, ClaimDTO claimdto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var ClaimFromDb = _unitOfWork.Claim.Get(Id);

            var ExistingPolicy = _unitOfWork.Policy.GetPolicyByPolice_No(ClaimFromDb.Police_No);


            if (ExistingPolicy.Effective > claimdto.Incured_Date || claimdto.Incured_Date > ExistingPolicy.Expiry)
            {
                return(BadRequest(error: "IncurredDate should fall within the Effective and Expiry of the policy"));
            }

            if (claimdto.Claimed_Amount < 1)
            {
                return(BadRequest(error: "ClaimedAmount should be greater than 1"));
            }


            _unitOfWork.Claim.Update(Id, claimdto);

            await _unitOfWork.SaveAllAsync();

            return(NoContent());

            throw new Exception($"Updating claim {Id} failed on update");
        }
Пример #2
0
        protected string CapNhatInfoBasic(ClaimDTO cl, KhachHangDTO kh, string ten)
        {
            string body = "<p>Update Notification - Giám định viên " + ten + " đã cập nhật một số thông tin của Claim.<p>";

            // body += "<br/> ";
            body += "<br/>1.  Previous Report: " + cl.BaoCaoTruoc;
            body += "<br/>2.	Policy number: "+ cl.PolicyNo;
            body += "<br/>3.	Location of loss: "+ cl.Premises;
            body += "<br/>4.	Insured: "+ kh.TenKhachHang;
            body += "<br/>5.	Adress: "+ kh.DiaChi;
            body += "<br/>6.	Trade: "+ kh.LinhVucKinhDoanh;
            body += "<br/>7.	Date Of loss: "+ cl.Dol;
            body += "<br/>8.	Cause of loss: "+ cl.SortCause;
            body += "<br/>9.	Extent Of Loss: "+ kh.Fax;
            body += "<br/>10.	Sum Insured: "+ cl.SumInsured;
            body += "<br/>12.	Insurance Period: "+ cl.Effective;
            body += "<br/>13.	Applicable Deductible: "+ cl.MucMienThuong;
            body += "<br/>14.	Extentsion Clause: "+ cl.DKBS;
            body += "<br/>15.	Insured's Claim: "+ cl.KhieuNai;
            body += "<br/>16.	Reserve for insurers: "+ cl.DuPhongBoiThuong;
            body += "<br/>17.	Proposed Adjustment: "+ cl.DieuChinh;
            body += "<br/>17.	Proposed Sellement: "+ cl.BoiThuong;
            string sto    = "*****@*****.**";
            string master = "*****@*****.**";

            //sm.KiemTraMailChinh(master, body, "Update Cover Infomation - " + cl.MaClaim, "Claim_CoverInfo","");
            return(sm.KiemTraMailChinh(master, body, "Update Cover Infomation - " + cl.MaClaim, "Claim_CoverInfo"));
        }
Пример #3
0
        protected void btnCapNhatInfoBasic_Click(object sender, EventArgs e)
        {
            KhachHangDTO khm1    = new KhachHangDTO();
            ClaimDTO     clm1    = new ClaimDTO();
            string       maclaim = cldao.LayMaTheoTen(lblThamChieuHead.Text);

            if (maclaim != null)
            {
                clm1.MaClaim         = maclaim;
                clm1.TenClaim        = txtReferencenumber.Text;
                clm1.Premises        = txtPremises.Text;
                clm1.PolicyNo        = txtPolicyNo.Text;
                clm1.Effective       = txtEffective.Text;
                clm1.TypePolicy      = txtTypeOfloss.Text;
                khm1.TenKhachHang    = txtInsured.Text;
                khm1.TenNguoiDaiDien = txtContactPerson.Text;
                khm1.Fax             = txtFaxno.Text;
                khm1.DienThoai       = txtPhone.Text;
                khm1.Email           = txtEmail.Text;
                khm1.DiaChi          = txtAddress.Text;
                clm1.Dol             = txtDateofloss.Text;
                bool up = cldao.UpdateInfo(clm1, khm1);
                if (up == true)
                {
                    string m = sm.CapNhatInfoBasic(clm1, khm1);
                    Response.Write("<script>alert('Updated!');</script>");
                }
            }
        }
Пример #4
0
        /// <summary>
        /// 从认领平台认领作者
        /// </summary>
        /// <param name="claim">它有两个属性:
        ///     1.Username,认领的用户名
        ///     2.AuthorId,被认领的论文作者的ID
        /// </param>
        public void ClaimAuthor(ClaimDTO claim)
        {
            Author author = context.Author.FirstOrDefault(a => a.Id == claim.AuthorId);

            if (null == author)
            {
                return;
            }
            //该作者必须是没有候选人的
            if (!isNoneCandidatesAuthor(author.Id))
            {
                return;
            }
            Person person = context.Person.First(p => p.PersonNo == claim.Username);

            //禁止重复添加
            var count = context.Candidate
                        .Where(c => c.AuthorId == claim.AuthorId && c.PersonNo == claim.Username)
                        .ToList().Count;

            if (count > 0)
            {
                return;
            }

            //生成一条新的候选人认领信息
            Candidate candidate = CreateNewCandidate(author, person);

            context.Candidate.Add(candidate);
            context.SaveChanges();
        }
Пример #5
0
        protected void loadClaim(string maclaim)
        {
            ClaimDTO cl = new ClaimDTO();

            cl = cldao.LayInFo(maclaim);
            lblThamChieuHead.Text   = cl.TenClaim.ToString();
            txtReferencenumber.Text = cl.TenClaim.ToString();
            txtDateofloss.Text      = cl.Dol.ToString();
            txtPremises.Text        = cl.Premises.ToString();
            txtTypeOfloss.Text      = cl.TypePolicy.ToString();
            txtbrief.Text           = cl.TomTatVuViec.ToString();
            txtNote.Text            = cl.GhiChu.ToString();
            txtPolicyNo.Text        = cl.PolicyNo.ToString();
            txtEffective.Text       = cl.Effective.ToString();
            txtA1.Text          = cl.A1.ToString();
            txtA2.Text          = cl.A2.ToString();
            txtC1.Text          = cl.C1.ToString();
            txtC2.Text          = cl.C2.ToString();
            txtC3.Text          = cl.C3.ToString();
            txtE1.Text          = cl.E1.ToString();
            txtE2.Text          = cl.E2.ToString();
            txtG.Text           = cl.G.ToString();
            txtH.Text           = cl.H.ToString();
            txtI.Text           = cl.I.ToString();
            txtK.Text           = cl.K.ToString();
            ckDiscuss.Text      = cl.Discuss.ToString();
            txtD1.Text          = cl.D1.ToString();
            txtLossHistory.Text = cl.LossHistory.ToString();
            txtGioiThieu.Text   = cl.GioiThieuNDBH.ToString();
        }
        public IHttpActionResult PostClaim([FromBody] ClaimDTO claimDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid claim"));
            }

            var response = "";

            // ClaimsMotor
            if (claimDto.Businessclass == "1")
            {
                var claim = new WebClaim
                {
                    bizclassId  = claimDto.Businessclass,
                    bizclass    = claimDto.Businessclassname,
                    policyno    = claimDto.RegistrationNo,
                    description = claimDto.Description,
                    location    = claimDto.Location,
                    lossDate    = DateTime.Parse(claimDto.Dateofloss),
                    Email       = claimDto.Email,
                    Phoneno     = claimDto.Phoneno
                };

                _context.WebClaims.Add(claim);
                _context.SaveChanges();
            }

            // ClaimsMarine ="2"
            //ClaimsFire & Burglary = "3"


            return(Ok());
        }
Пример #7
0
        public void ShowClaimView(ClaimDTO claim)
        {
            var view = ServiceLocator.Current.GetInstance <IShowClaimView>();

            ((ShowClaimVM)view.ViewModel).Load(claim);
            viewManager.ShowInDialog(view);
        }
Пример #8
0
        public void Update(int Id, ClaimDTO claimDTO)
        {
            var ClaimFromDb = _context.Claims.FirstOrDefault(c => c.Id == Id);

            _mapper.Map(claimDTO, ClaimFromDb);

            _context.SaveChanges();
        }
Пример #9
0
        public void Add(ClaimDTO obj)
        {
            var   permissions = _permissionRepository.GetAllSpecific(obj.Permissions);
            Claim auth        = new Claim(obj.Name, permissions);

            _claimRepository.Add(auth);
            _unitOfWork.Commit();
        }
Пример #10
0
        public void Update(ClaimDTO obj)
        {
            var permissions = _permissionRepository.GetAllSpecific(obj.Permissions);
            var auth        = _claimRepository.GetByName(obj.Name);

            auth.Permissions = permissions;
            _claimRepository.Update(auth);
            _unitOfWork.Commit();
        }
Пример #11
0
 public HttpResponseMessage PostClaimAuthor(ClaimDTO dto)
 {
     dto.Username = HttpContext.Current.Session["username"].ToString();
     repository.ClaimAuthor(dto);
     return(new HttpResponseMessage()
     {
         Content = new StringContent("success")
     });
 }
Пример #12
0
 public ShowClaimVM(IPMSController appController,
                    IClaimServiceWrapper claimService,
                    IPeriodMgtAppLocalizedResources periodMgtAppLocalizedResources)
 {
     this.appController             = appController;
     this.claimService              = claimService;
     PeriodMgtAppLocalizedResources = periodMgtAppLocalizedResources;
     Claim       = new ClaimDTO();
     DisplayName = PeriodMgtAppLocalizedResources.ShowClaimViewTitle;
 }
Пример #13
0
        public async Task <ActionResult> Create(ClaimDTO claim)
        {
            if (!ModelState.IsValid)
            {
                return(View(claim));
            }

            var newlyCreatedClaim = await _claimService.AddAsync(claim);

            return(RedirectToAction(nameof(Details), new { id = newlyCreatedClaim.ClaimId }));
        }
Пример #14
0
        public async Task <ActionResult> Edit(int id, ClaimDTO form)
        {
            if (!ModelState.IsValid)
            {
                return(View(form));
            }

            await _claimService.UpdateAsync(form);

            return(RedirectToAction(nameof(Index)));
        }
Пример #15
0
        public ClaimDTO AddClaim(long periodId, ClaimDTO claimDto)
        {
            if (ClaimTypeEnum.FromValue <ClaimTypeEnum>(claimDto.ClaimTypeId.ToString()) == null)
            {
                throw new ClaimArgumentException("Claim", "ClaimType");
            }

            var claim = claimService.AddClaim(new PeriodId(claimDto.PeriodId), claimDto.EmployeeNo, claimDto.Title, claimDto.ClaimDate,
                                              ClaimTypeEnum.FromValue <ClaimTypeEnum>(claimDto.ClaimTypeId.ToString()), claimDto.Request);

            return(claimDTOMapper.MapToModel(claim));
        }
        public async Task <ApiResult> CreateRoleClaim(string roleName, ClaimDTO model)
        {
            var user = await roleManager.FindByNameAsync(roleName);

            var result = await roleManager.AddClaimAsync(user, new Claim(model.type, model.value));

            if (result.Succeeded)
            {
                return(Ok());
            }

            return(BadRequest());
        }
Пример #17
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            ClaimDTO        cldto   = new ClaimDTO();
            KhachHangDAO    kh      = new KhachHangDAO();
            KhachHangDTO    khdto   = new KhachHangDTO();
            GiamDinhVienDAO gd      = new GiamDinhVienDAO();
            int             maGDV   = int.Parse(Request.Cookies["MaGDV"].Value);
            string          tengd   = gd.LayTenTheoMa(maGDV);
            string          ma      = Session["ThamChieu"].ToString();
            int             idkhach = cldao.ClaimMaKH(ma);
            //khdto.MaKhachHang = idkhach;
            //update custumer
            string ten = txtTenInsured.Text;

            khdto.TenKhachHang = ten;
            string diachi = txtDiaChi.Text;

            khdto.DiaChi = diachi;
            string linhvuckd = txtLinhVucKinhDoanh.Text;

            khdto.LinhVucKinhDoanh = linhvuckd;
            bool upkh = kh.Updatecover(idkhach, ten, diachi, linhvuckd);

            //update claim
            cldto.MaClaim          = ma;
            cldto.BaoCaoTruoc      = txtBaoCaoTruoc.Text;
            cldto.PolicyNo         = txtHDBH.Text;
            cldto.Premises         = txtDiaDiemTonThat.Text;
            cldto.Dol              = txtNgayTonThat.Text;
            cldto.SortCause        = txtNguyenNhan.Text;
            cldto.PhamViTonThat    = txtPhamViTT.Text;
            cldto.SumInsured       = txtSumInsured.Text;
            cldto.Effective        = txtThoiHanBH.Text;
            cldto.MucMienThuong    = txtMucMienThuong.Text;
            cldto.DKBS             = txtDieuKhoanBoSung.Text;
            cldto.KhieuNai         = txtKhieuNaiNDBH.Text;
            cldto.DuPhongBoiThuong = txtDuPhongBoiThuong.Text;
            cldto.DieuChinh        = txtTinhToanDieuChinh.Text;
            cldto.TruMienThuong    = txtTruMucMienThuong.Text;
            cldto.BoiThuong        = txtDeXuatBoiThuong.Text;
            cldto.NamePolicy       = txtTypePolicy.Text;
            bool kq = cldao.UpdateClaimCover(cldto);

            if (kq == true && upkh == true)
            {
                string cn = CapNhatInfoBasic(cldto, khdto, tengd);
                Response.Write("<script> alert('Updated!');</script>");
                loadCover(ma);
            }
        }
Пример #18
0
        public void AddClaim(ClaimDTO claim)
        {
            Name n = null;

            try
            {
                n = (Name)claim.ActionTemplate;
                m_claimTree.Add(n, claim.ClaimSI);
            }
            catch (DuplicatedKeyException)
            {
                throw new Exception($"There is already a claim associated to the action template \"{n}\"");
            }
        }
Пример #19
0
        public string SendNewClaim(ClaimDTO cl, KhachHangDTO kh, string dv, string tengdv)
        {
            string body = "Thông tin vụ mới " + cl.TenClaim + "\n";

            body += "<br/>1.  Tham chiếu SAVVY: " + cl.TenClaim;
            body += "<br/>2.  Giám định viên thụ lý: " + tengdv;
            body += "<br/>3.  Đơn vị bảo hiểm: " + dv;
            body += "<br/>4.  Người được bảo hiểm: " + kh.TenKhachHang;
            body += "<br/>5.  Ngày chỉ định: " + cl.AssignedDate;
            body += "<br/>";
            body += "<br/>Thông tin sẽ được cập nhật sau khi Giám định viên đi công tác hiện trường hoặc thông tin được cung cấp từ nhà bảo hiểm!";
            string sto = "*****@*****.**";

            return(KiemTraMailChinh(sto, body, "New Claim " + cl.TenClaim + " - " + kh.TenKhachHang, "New Claim"));
        }
Пример #20
0
        public async Task <ClaimDTO> AddAsync(ClaimDTO claim)
        {
            var response = await _httpClient.PostAsync($"{_claimServiceApiConfig.BaseAddress}/claims", new StringContent(JsonConvert.SerializeObject(claim), Encoding.UTF8, "application/json"));

            if (!response.IsSuccessStatusCode)
            {
                return(null);
            }

            var jsonResult = await response.Content.ReadAsStringAsync();

            var createdClaim = JsonConvert.DeserializeObject <ClaimDTO>(jsonResult);

            return(createdClaim);
        }
Пример #21
0
        public string CapNhatInfoBasicFR(ClaimDTO cl)
        {
            string body = "Thông báo cập nhật thông tin chung : FR_" + cl.TenClaim + "\n";

            body += "<br/>1.    Previous report: " + cl.BaoCaoTruocFR;
            body += "<br/>2.	Accept loss amount: "+ cl.ThietHaiHopLy;
            body += "<br/>3.	Coverablle amount: "+ cl.TonThatHopLe;
            body += "<br/>4.	Less savalge: "+ cl.TruGiaTriThuHoi;
            body += "<br/>5.	Interim payment: "+ cl.TamUngBoiThuong;
            body += "<br/>6.	Les deductible: "+ cl.TruMienThuong;
            body += "<br/>7.	Proposed settlemt: "+ cl.BoiThuong;
            string sto = "*****@*****.**";

            //string sto = "*****@*****.**";
            return(KiemTraMailChinh(sto, body, "Update Basic Information of Claim " + cl.MaClaim, "Claim_CoverInfor"));
        }
Пример #22
0
        public void Load(ClaimDTO claimParam, ActionType actionTypeParam)
        {
            actionType = actionTypeParam;
            if (actionTypeParam == ActionType.AddClaim)
            {
                IsReplyMode = false;
            }
            else if (actionTypeParam == ActionType.ReplyToClaim)
            {
                IsReplyMode = true;
            }
            else
            {
                throw new Exception("Action Mode Is not Valid");
            }

            Claim = claimParam;
            preload();
        }
Пример #23
0
        public string CapNhatInfoBasic(ClaimDTO cl, KhachHangDTO kh)
        {
            string body = "Thông báo cập nhật ! " + "\n";

            body += "<br/>1.  Reference: " + cl.TenClaim;
            body += "<br/>2.	Policy number: "+ cl.PolicyNo;
            body += "<br/>3.	Địa điểm tốn thất: "+ cl.Premises;
            body += "<br/>4.	Người được bảo hiểm: "+ kh.TenKhachHang;
            body += "<br/>5.	Địa chỉ: "+ kh.DiaChi;
            body += "<br/>6.	Người liên hệ: "+ kh.TenNguoiDaiDien;
            body += "<br/>7.	Email: "+ kh.Email;
            body += "<br/>8.	Phone: "+ kh.DienThoai;
            body += "<br/>9.	Fax: "+ kh.Fax;
            body += "<br/>10.	Effective: "+ cl.Effective;
            body += "<br/>11.	Date of loss: "+ cl.Dol;
            string sto = "*****@*****.**";

            //string sto = "*****@*****.**";
            return(KiemTraMailChinh(sto, body, "Update Basic Information of Claim " + cl.MaClaim, "Claim_CoverInfor"));
        }
Пример #24
0
        public string CapNhatInfoBasicPR(ClaimDTO cl, KhachHangDTO kh)
        {
            string body = "Thông báo cập nhật thông tin chung : PR_" + cl.TenClaim + "\n";

            body += "<br/>1.    Previous report: " + cl.ILADATE;
            body += "<br/>2.	Policy number: "+ cl.PolicyNo;
            body += "<br/>3.	Date of loss: "+ cl.Dol;
            body += "<br/>4.	Cause of loss: "+ cl.SortCause;
            body += "<br/>5.	Extend of loss: "+ cl.PhamViTonThat;
            body += "<br/>6.	Name policy: "+ cl.NamePolicy;
            body += "<br/>7.	Sum insured: "+ cl.SumInsured;
            body += "<br/>8.	Effective: "+ cl.Effective;
            body += "<br/>9.	Deductible: "+ cl.MucMienThuong;
            body += "<br/>10.	Extension Clause: "+ cl.DKBS;
            body += "<br/>11.	Insured's claim: "+ cl.KhieuNai;
            body += "<br/>12.	Interim reserve: "+ cl.DuPhongBoiThuong;
            body += "<br/>13.	Trade: "+ kh.LinhVucKinhDoanh;
            string sto = "*****@*****.**";

            //string sto = "*****@*****.**";
            return(KiemTraMailChinh(sto, body, "Update Basic Information of Claim " + cl.MaClaim, "Claim_CoverInfor"));
        }
Пример #25
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            ClaimDTO     cldto = new ClaimDTO();
            KhachHangDTO khdto = new KhachHangDTO();
            string       id    = Session["ThamChieu"].ToString();

            if (id != "")
            {
                cldto.MaClaim  = id;
                cldto.TenClaim = txtTenClaim.Text;
                string iladate = txtDateILA.Text.Trim();
                if (iladate != "")
                {
                    cldto.ILADATE = iladate;
                }
                else
                {
                    cldto.ILADATE = "";
                }
                string nameP = txtPolicyNo.Text.Trim();
                if (nameP != "")
                {
                    cldto.PolicyNo = nameP;
                }
                else
                {
                    cldto.PolicyNo = "";
                }
                string dol = txtDOL.Text.Trim();
                if (dol != "")
                {
                    cldto.Dol = dol;
                }
                else
                {
                    cldto.Dol = "";
                }
                string cause = txtCauseloss.Text.Trim();
                if (cause != "")
                {
                    cldto.SortCause = cause;
                }
                else
                {
                    cldto.SortCause = "";
                }
                string pvtt = txtExtendofloss.Text.Trim();
                if (pvtt != "")
                {
                    cldto.PhamViTonThat = pvtt;
                }
                else
                {
                    cldto.PhamViTonThat = "";
                }
                string nametypo = txtTypepolicy.Text.Trim();
                if (nametypo != "")
                {
                    cldto.NamePolicy = nametypo;
                }
                else
                {
                    cldto.NamePolicy = "";
                }
                string sumI = txtSuminsured.Text.Trim();
                if (sumI != "")
                {
                    cldto.SumInsured = sumI;
                }
                else
                {
                    cldto.SumInsured = "";
                }
                string gd = txtperiod.Text.Trim();
                if (gd != "")
                {
                    cldto.Effective = gd;
                }
                else
                {
                    cldto.Effective = "";
                }
                string mmt = txtDeductible.Text.Trim();
                if (mmt != "")
                {
                    cldto.MucMienThuong = mmt;
                }
                else
                {
                    cldto.MucMienThuong = "";
                }
                string dkbs = txtExtensionclaise.Text.Trim();
                if (dkbs != "")
                {
                    cldto.DKBS = dkbs;
                }
                else
                {
                    cldto.DKBS = "";
                }
                string kn = txtKhieuNai.Text.Trim();
                if (kn != "")
                {
                    cldto.KhieuNai = kn;
                }
                else
                {
                    cldto.KhieuNai = "";
                }
                string dpbt = txtInterimreserve.Text;
                if (dpbt != "")
                {
                    cldto.DuPhongBoiThuong = dpbt;
                }
                else
                {
                    cldto.DuPhongBoiThuong = "";
                }
                int maKH = cl.ClaimMaKH(id);
                if (maKH != 0)
                {
                    khdto.MaKhachHang = maKH;
                }
                khdto.LinhVucKinhDoanh = txtTrade.Text.Trim();
                bool up    = cl.UpdateInfoPRIRFR(cldto, khdto);
                int  maGDV = int.Parse(Request.Cookies["MaGDV"].Value);
                if (up == true)
                {
                    sm.CapNhatInfoBasicPR(cldto, khdto);
                    sm.CapNhatInfoBasicFR(cldto);

                    string noidung = gdv.LayTenTheoMa(maGDV) + " edited cover preliminary report of case " + id + " .";
                    SaveLogTracking(maGDV, noidung, id);
                    Response.Write("<script>parent.closeDialog();</script>");
                    Response.Write("<script>parent.reloaData();</script>");
                }
                else
                {
                    string noidung = gdv.LayTenTheoMa(maGDV) + " faild to edit cover preliminary report of case " + id + " .";
                    SaveLogTracking(maGDV, noidung, id);
                    Response.Write("<script> alert('Error Update!');</script>");
                }
            }
        }
Пример #26
0
 public ShowClaimVM()
 {
     Claim = new ClaimDTO {
         Title = "ff"
     };
 }
Пример #27
0
 public Claim(ClaimDTO claimDTO)
 {
     ClaimId = Guid.NewGuid();
     Title   = claimDTO.Title;
     Value   = claimDTO.Value;
 }
Пример #28
0
 public void Load(ClaimDTO claimParam)
 {
     Claim = claimParam;
 }
Пример #29
0
 public static ClientClaim ToEntity(this ClaimDTO dto)
 {
     return(dto == null ? null : Mapper.Map <ClientClaim>(dto));
 }
Пример #30
0
        public async Task <bool> UpdateAsync(ClaimDTO claim)
        {
            var result = await _httpClient.PutAsync($"{_claimServiceApiConfig.BaseAddress}/Claims/{claim.ClaimId}", new StringContent(JsonConvert.SerializeObject(claim), Encoding.UTF8, "application/json"));

            return(result.IsSuccessStatusCode);
        }