private DTO_Scope DisplayScopeInfo(List <DTO_Scope> scopelist, int typescope, DTO_Claim c)
        {
            DTO_Scope t = new DTO_Scope();

            if (scope != null && c != null && typescope > 0 && typescope < 4)
            {
                foreach (DTO_Scope s in scopelist)
                {
                    if (s.ScopeTypeID == typescope)
                    {
                        bool b = s.ScopeID.Equals(t.ScopeID);
                        if (!b)
                        {
                            SetDisplayToScopeTypeIDByScope(s);
                            deductibleTextBox.Text = s.Deductible.ToString();
                            oandPTextBox.Text      = s.OandP.ToString();
                            interiorTextBox.Text   = s.Interior.ToString();
                            gutterTextBox.Text     = s.Gutter.ToString();
                            totalTextBox.Text      = s.Total.ToString();
                            exteriorTextBox.Text   = s.Exterior.ToString();
                            taxTextBox.Text        = s.Tax.ToString();
                            Roof.Text = s.RoofAmount.ToString();
                            return(scope);
                        }
                        else
                        {
                            return(t);
                        }
                    }
                }
            }
            return(t);
        }
 virtual public double Calculate(DTO_Scope scope, bool acv = true)
 {
     if (acv)
     {
         return(scope.Total - scope.Interior - scope.Exterior - scope.Gutter - scope.RoofAmount - scope.Deductible - scope.OandP - scope.Tax);
     }
     else
     {
         return(scope.Total - scope.Interior - scope.Exterior - scope.Gutter - scope.RoofAmount - scope.Tax);
     }
 }
        public async Task AddScope(DTO_Scope token)
        {
            try
            {
                var response = await client.PostAsJsonAsync(string.Format(@"{0}{1}", URL, "AddScope"),
                                                            token);

                response.EnsureSuccessStatusCode();
                Scope = await response.Content.ReadAsAsync <DTO_Scope>();
            }
            catch (Exception ex)
            {
            }
        }
示例#4
0
 public Scope(DTO_Scope s)
 {
     ScopeID     = s.ScopeID;
     ScopeTypeID = s.ScopeTypeID;
     ClaimID     = s.ClaimID;
     Interior    = s.Interior;
     Exterior    = s.Exterior;
     Gutter      = s.Gutter;
     RoofAmount  = s.RoofAmount;
     Tax         = s.Tax;
     Deductible  = s.Deductible;
     Total       = s.Total;
     OandP       = s.OandP;
     Accepted    = s.Accepted;
 }
        private int SetDisplayToScopeTypeIDByScope(DTO_Scope s)
        {
            int scopeType = s.ScopeTypeID;

            if (scopeType == 1)
            {
                radioButton.IsChecked = true;
            }
            if (scopeType == 2)
            {
                radioButton_Copy.IsChecked = true;
            }
            if (scopeType == 3)
            {
                radioButton_Copy1.IsChecked = true;
            }
            return(scopeType);
        }
        private int SetScopeByScopeID(DTO_Scope scope)
        {
            int i = scope.ScopeTypeID;

            switch (i)
            {
            case 1:
            {
                ImageBrush ib = new ImageBrush();
                ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/CheckMark.png", UriKind.Relative));
                MRNEstimateStatusImage.Background = ib;



                radioButton.IsChecked = true;
                claimscopelist.Add(scope);
                return(i);
            }

            case 2:
            {
                ImageBrush ib = new ImageBrush();
                ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/CheckMark.png", UriKind.Relative));
                OldScopeStatusImage.Background = ib;

                radioButton_Copy.IsChecked = true;
                claimscopelist.Add(scope);
                return(i);
            }

            case 3:
            {
                ImageBrush ib = new ImageBrush();
                ib.ImageSource = new BitmapImage(new Uri(@"../../ResourceFiles/CheckMark.png", UriKind.Relative));
                NewScopeStatusImage.Background = ib;
                radioButton_Copy1.IsChecked    = true;

                return(i);
            }

            default:
            {
                if (i < 1)
                {
                    if (MessageBoxResult.Yes == MessageBox.Show("No Scopes were available for this Claim. Would you like to enter our estimate details?", "No previous data found", MessageBoxButton.YesNo, MessageBoxImage.Question))
                    {
                        radioButton.IsChecked = true;


                        claimscopelist.Add(scope);
                        i = 1;
                    }
                }
                else if (i > 3)
                {
                    if (MessageBoxResult.Yes == MessageBox.Show("A Scope with an out of range value has been found for this claim it may be a final scope. Would you like to enter the view it's details?", "Scope Out of Range", MessageBoxButton.YesNo, MessageBoxImage.Warning))
                    {
                        radioButton_Copy1.IsChecked = true;
                        i = 3;
                    }
                }
            }
                return(i);
            }
        }