Exemplo n.º 1
0
 private void radioButtonNo_CheckedChanged(object sender, EventArgs e)
 {
     DisableTextfield();
     txtContactDetail.Text               = "";
     txtThirdPartyName.Text              = "";
     txthirdPartyEstimatValOfLoss.Text   = "";
     txtThirdPartyDamageVal.Text         = "";
     objClaimModel.ThirdPartyInvolvement = false;
     ClaimerrorPro.Clear();
 }
Exemplo n.º 2
0
 private void Search_Click(object sender, EventArgs e)
 {
     if (Search.Text == "Search")
     {
         Search.Text = "Processing..";
     }
     if (txtSearchVrnPolicy.Text != "")
     {
         bindClaimDetail(txtSearchVrnPolicy.Text);
         Search.Text = "Search";
     }
     else
     {
         //MessageBox.Show("Please Enter VRN/POLICY No.");
         Search.Text = "Search";
         ClaimerrorPro.SetError(txtSearchVrnPolicy, "Please Enter VRN/POLICY No.");
         txtSearchVrnPolicy.Focus();
         return;
     }
 }
Exemplo n.º 3
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (txtPolicyNo.Text != "")
            {
                objClaimModel.PolicyNumber   = txtPolicyNo.Text;
                objClaimModel.CoverStartDate = txtStartDate.Text;
                objClaimModel.CoverEndDate   = txtEndDate.Text;
                objClaimModel.VRNNumber      = txtVRNNo.Text;
                objClaimModel.CustomerName   = txtCustomerName.Text;
                pnlClaimNotification.Visible = false;
                pnlClamantDetail.Visible     = true;
                if (objClaimModel.ThirdPartyInvolvement == true)
                {
                    EndableTextField();
                }
                if (objClaimModel.ThirdPartyInvolvement == false || objClaimModel.ThirdPartyInvolvement == null)
                {
                    DisableTextfield();
                }
            }

            else
            {
                //MessageBox.Show("Please Enter the Vrn/Policy No In Search Textbox ");
                ClaimerrorPro.SetError(txtSearchVrnPolicy, "Please Enter the Vrn/Policy No In Search Textbox ");
                txtSearchVrnPolicy.Focus();
                return;
            }

            //DisableTextfield();

            //pnlClaimNotification.Visible = false;
            //pnlClamantDetail.Visible = false;
            //PnlMsg.Visible = true;
            //datePickDateOfLoss.CustomFormat = " ";
        }
Exemplo n.º 4
0
        public void bindClaimDetail(string SearchText)
        {
            //var LocalApiURL = "http://localhost:6220/api/Claimant/";
            //var client = new RestClient(LocalApiURL + "ClaimDetail?SearchText=" + SearchText);
            var client  = new RestClient(ApiURL + "ClaimDetail?SearchText=" + SearchText);
            var request = new RestRequest(Method.GET);

            request.AddHeader("password", Pwd);
            request.AddHeader("username", username);
            request.AddParameter("application/json", "{\n\t\"Name\":\"ghj\"\n}", ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);
            var           result   = JsonConvert.DeserializeObject <ClaimRegisterModel>(response.Content);

            if (result != null)
            {
                if (result.PolicyNumber != null)
                {
                    EnableClaimPanel();
                    txtPolicyNo.Text     = result.PolicyNumber;
                    txtVRNNo.Text        = result.VRNNumber;
                    txtCustomerName.Text = result.CustomerName;
                    objClaimModel.UserId = result.UserId;
                    if (result.CoverStartDate != null)
                    {
                        txtStartDate.Text = Convert.ToString(result.CoverStartDate);
                    }
                    else
                    {
                        txtStartDate.Text = Convert.ToString(DateTime.Now);
                    }
                    if (result.CoverEndDate != null)
                    {
                        //txtEndDate.Text = Convert.ToString(Convert.ToDateTime(result.CoverEndDate).ToShortDateString());
                        txtEndDate.Text = Convert.ToString(result.CoverEndDate);
                    }
                    else
                    {
                        txtEndDate.Text = Convert.ToString(DateTime.Now);
                    }
                }
                else
                {
                    //MessageBox.Show("VRN/Policy No doesn't Exist.Please Try Again");
                    ClaimerrorPro.SetError(txtSearchVrnPolicy, "VRN/Policy No doesn't Exist.Please Try Again");
                    txtSearchVrnPolicy.Focus();
                    EmptyAlltext();
                    DisableClaimPanel();
                    return;
                }
            }
            else
            {
                //MessageBox.Show("VRN/Policy No doesn't Exist.Please Try Again");
                ClaimerrorPro.SetError(txtSearchVrnPolicy, "VRN/Policy No doesn't Exist.Please Try Again");
                txtSearchVrnPolicy.Focus();
                DisableTextfield();
                return;
            }

            //cmbCoverType.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
        }
Exemplo n.º 5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                var Dateloss = datePickDateOfLoss.Text;
                var format   = "MM/dd/yyyy";
                //var format = "dd/MM/yyyy";
                var      GetStartDate = DateTime.ParseExact(txtStartDate.Text, format, CultureInfo.InvariantCulture);
                var      GetEndDate   = DateTime.ParseExact(txtEndDate.Text, format, CultureInfo.InvariantCulture);
                DateTime startdate    = GetStartDate;
                DateTime enddate      = GetEndDate;

                // DateTime startdate = Convert.ToDateTime(txtStartDate.Text);
                // DateTime enddate = Convert.ToDateTime(txtEndDate.Text);

                if (startdate != null && enddate != null)
                {
                    if (txtClaimantName.Text == "")
                    {
                        // MessageBox.Show("Claimant name is required field");
                        ClaimerrorPro.SetError(txtClaimantName, "Claimant name is required field.");
                        txtClaimantName.Focus();
                        return;
                    }
                    else
                    {
                        objClaimModel.ClaimantName = txtClaimantName.Text;
                    }
                    if (Dateloss != " ")
                    {
                        if (Convert.ToDateTime(Dateloss) >= startdate)
                        {
                            if (enddate >= Convert.ToDateTime(Dateloss))
                            {
                                //MessageBox.Show("Claim Is Approved");
                            }
                            else
                            {
                                //MessageBox.Show("Your date of loss doesn't exist in policy start/end date.");
                                ClaimerrorPro.SetError(datePickDateOfLoss, "Your date of loss doesn't exist in policy start/end date.");
                                datePickDateOfLoss.Focus();
                                return;
                            }
                        }
                        else
                        {
                            //MessageBox.Show("Your date of loss doesn't exist in policy start/end date.");
                            ClaimerrorPro.SetError(datePickDateOfLoss, "Your date of loss doesn't exist in policy start/end date.");
                            datePickDateOfLoss.Focus();
                            return;
                        }

                        if (txtPlaceOfLoss.Text == "")
                        {
                            //MessageBox.Show("Place of loss is required field");

                            ClaimerrorPro.SetError(txtPlaceOfLoss, "Place of loss is required field.");
                            txtPlaceOfLoss.Focus();
                            return;
                        }
                        else
                        {
                            objClaimModel.PlaceOfLoss = txtPlaceOfLoss.Text;
                        }
                        if (txtEstimatValofLoss.Text == "")
                        {
                            // MessageBox.Show("Estimated val of loss is required field");
                            ClaimerrorPro.SetError(txtEstimatValofLoss, "Estimated val of loss is required field.");
                            txtEstimatValofLoss.Focus();
                            return;
                        }
                        else
                        {
                            objClaimModel.EstimatedValueOfLoss = Convert.ToDecimal(txtEstimatValofLoss.Text);
                        }
                        if (txtDescriptionofloss.Text == "")
                        {
                            //MessageBox.Show("Description of loss is required field");
                            ClaimerrorPro.SetError(txtDescriptionofloss, "Description of loss is required field.");
                            txtDescriptionofloss.Focus();
                            return;
                        }
                        else
                        {
                            objClaimModel.DescriptionOfLoss = txtDescriptionofloss.Text;
                        }

                        objClaimModel.DateOfLoss = Convert.ToDateTime(datePickDateOfLoss.Text);


                        if (radioButtonYes.Checked == true || radioButtonNo.Checked == true)
                        {
                            if (radioButtonYes.Checked)
                            {
                                objClaimModel.ThirdPartyInvolvement = true;
                                if (txtContactDetail.Text == "")
                                {
                                    //MessageBox.Show("Contact detail is required field");
                                    ClaimerrorPro.SetError(txtContactDetail, "Contact detail is required field.");
                                    txtContactDetail.Focus();
                                    return;
                                }
                                else
                                {
                                    objClaimModel.ThirdPartyContactDetails = txtContactDetail.Text;
                                }
                                if (txtThirdPartyName.Text == "")
                                {
                                    //MessageBox.Show("Third party name is required field");
                                    ClaimerrorPro.SetError(txtThirdPartyName, "Third party name is required field.");
                                    txtThirdPartyName.Focus();
                                    return;
                                }
                                else
                                {
                                    objClaimModel.ThirdPartyName = txtThirdPartyName.Text;
                                }
                                if (txthirdPartyEstimatValOfLoss.Text == "")
                                {
                                    //MessageBox.Show("Third party estimated val of loss is required field");
                                    ClaimerrorPro.SetError(txthirdPartyEstimatValOfLoss, "Third party estimated val of loss is required field.");
                                    txthirdPartyEstimatValOfLoss.Focus();
                                    return;
                                }
                                else
                                {
                                    objClaimModel.ThirdPartyEstimatedValueOfLoss = Convert.ToDecimal(txthirdPartyEstimatValOfLoss.Text);
                                }
                                if (txtThirdPartyDamageVal.Text == "")
                                {
                                    //MessageBox.Show("Third party damage value is required field");
                                    ClaimerrorPro.SetError(txtThirdPartyDamageVal, "Third party damage value is required field.");
                                    txtThirdPartyDamageVal.Focus();
                                    return;
                                }
                                else
                                {
                                    objClaimModel.ThirdPartyDamageValue = Convert.ToDecimal(txtThirdPartyDamageVal.Text);
                                }
                                objClaimModel.ThirdPartyMakeId  = Convert.ToString(comboMake.SelectedValue);
                                objClaimModel.ThirdPartyModelId = Convert.ToString(comboModel.SelectedValue);
                            }
                            else
                            {
                                objClaimModel.ThirdPartyInvolvement = false;
                            }
                        }
                        else
                        {
                            //MessageBox.Show("Please Enter the required fields.");
                            ClaimerrorPro.SetError(radioButtonNo, "Please select the third party involvement.");
                            radioButtonNo.Focus();
                            return;
                        }


                        SaveClaimantDetail(objClaimModel);
                    }
                    else
                    {
                        if (radioButtonNo.Checked)
                        {
                            objClaimModel.ThirdPartyMakeId  = "";
                            objClaimModel.ThirdPartyModelId = "";
                        }
                        //MessageBox.Show("Please select date of loss");
                        ClaimerrorPro.SetError(datePickDateOfLoss, "Please select date of loss.");
                        datePickDateOfLoss.Focus();
                        return;
                    }
                    //}
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("Please try again");
                return;
            }
        }
Exemplo n.º 6
0
        private void datePickDateOfLoss_ValueChanged(object sender, EventArgs e)
        {
            datePickDateOfLoss.CustomFormat = "MM/dd/yyyy";

            ClaimerrorPro.Clear();
        }
Exemplo n.º 7
0
 private void txtClaimantName_TextChanged(object sender, EventArgs e)
 {
     ClaimerrorPro.Clear();
 }
Exemplo n.º 8
0
 private void textBox2_TextChanged(object sender, EventArgs e)
 {
     ClaimerrorPro.Clear();
 }
Exemplo n.º 9
0
 private void txtPlaceOfLoss_TextChanged(object sender, EventArgs e)
 {
     ClaimerrorPro.Clear();
 }
Exemplo n.º 10
0
 private void radioButtonYes_CheckedChanged(object sender, EventArgs e)
 {
     EndableTextField();
     objClaimModel.ThirdPartyInvolvement = true;
     ClaimerrorPro.Clear();
 }
Exemplo n.º 11
0
 private void txtEstimatValofLoss_TextChanged(object sender, EventArgs e)
 {
     ClaimerrorPro.Clear();
 }
Exemplo n.º 12
0
 private void txtContactDetail_TextChanged(object sender, EventArgs e)
 {
     ClaimerrorPro.Clear();
 }
Exemplo n.º 13
0
 private void txtThirdPartyDamageVal_TextChanged(object sender, EventArgs e)
 {
     ClaimerrorPro.Clear();
 }
Exemplo n.º 14
0
 private void txtSearchVrnPolicy_TextChanged(object sender, EventArgs e)
 {
     objClaimModel = new ClaimRegisterModel();
     ClaimerrorPro.Clear();
 }