Ejemplo n.º 1
0
        public void approveLoan2(Loans2 l)
        {
            ClientC inter = new ClientC();
            Client  c     = inter.FindClient(l.ClientId);

            c.MiddleProcess = "2app";
            inter.UpdateClient(c);
        }
Ejemplo n.º 2
0
        public Loans2 FindLoan2ByClient(string Cid)
        {
            Loans2 l = new Loans2();

            //search
            while (con.State == ConnectionState.Open)
            {
                System.Threading.Thread.Sleep(500);
            }
            con.Open();
            MySqlCommand cmd = new MySqlCommand("select * from Loans2 ", con);
            // where ClientId=@id cmd.Parameters.AddWithValue("@close", Convert.ToInt32(false));
            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                l.Close    = Convert.ToBoolean(Convert.ToInt32(reader["Close"].ToString()));
                l.ClientId = reader["ClientId"].ToString();
                if (l.ClientId == Cid)
                {
                    if (!l.Close)
                    {
                        l.Id             = reader["id"].ToString();
                        l.OpenCC         = reader["OpenCC"].ToString();
                        l.OpenRC         = reader["OpenRC"].ToString();
                        l.OpenRELoans    = reader["OpenRELoans"].ToString();
                        l.OpenILoans     = reader["OpenILoans"].ToString();
                        l.TotalOpenAcc   = reader["TotalOpenAcc"].ToString();
                        l.AcceverLate    = reader["AcceverLate"].ToString();
                        l.CollectionAcc  = reader["CollectionAcc"].ToString();
                        l.AvgAccAge      = reader["AvgAccAge"].ToString();
                        l.OldestAcc      = reader["OldestAcc"].ToString();
                        l.CRDebt         = reader["CRDebt"].ToString();
                        l.REDebt         = reader["REDebt"].ToString();
                        l.ILDebt         = reader["ILDebt"].ToString();
                        l.CollectionDebt = reader["CollectionDebt"].ToString();
                        l.TDebt          = reader["TDebt"].ToString();
                        l.PublicRecords  = reader["PublicRecords"].ToString();
                        l.Experian       = reader["Experian"].ToString();
                        l.Equifax        = reader["Equifax"].ToString();
                        l.TransUnio      = reader["TransUnio"].ToString();
                        l.Fico2          = reader["Fico2"].ToString();
                        l.Fico3          = reader["Fico3"].ToString();
                        l.Fico8          = reader["Fico8"].ToString();
                        l.Comment        = reader["Comment"].ToString();
                        l.Source         = Convert.ToBoolean(Convert.ToInt32(reader["Source"].ToString()));
                    }
                }
            }
            con.Close();
            InquiriesC inq = new InquiriesC();

            l.InqList = inq.ListOfInq(l.Id);
            CAccountC cacc = new CAccountC();

            l.CAccList = cacc.ListOfCAcc(l.Id);
            return(l);
        }
Ejemplo n.º 3
0
        public void CreateLoan2(Loans2 l)
        {
            Loans1C c = new Loans1C();

            l.Id = c.FindLoan1ByClient(l.ClientId).Id.ToString();
            InquiriesC inq = new InquiriesC();

            foreach (var v in l.InqList)
            {
                v.LoansId = l.Id;
                inq.CreateInq(v);
            }
            CAccountC cacc = new CAccountC();

            foreach (var v in l.CAccList)
            {
                cacc.CreateCAcc(v);
            }

            while (con.State == ConnectionState.Open)
            {
                System.Threading.Thread.Sleep(500);
            }
            con.Open();

            string       query = "INSERT INTO Loans2 (Id,OpenCC,OpenRC,OpenRELoans,OpenILoans,TotalOpenAcc,AcceverLate,CollectionAcc,AvgAccAge,OldestAcc,CRDebt,REDebt,ILDebt,CollectionDebt,TDebt,PublicRecords,Experian,Equifax,TransUnio,Fico2,Fico3,Fico8,Comment,ClientId,Close,Source) VALUES (@Id,@OpenCC,@OpenRC,@OpenRELoans,@OpenILoans,@TotalOpenAcc,@AcceverLate,@CollectionAcc,@AvgAccAge,@OldestAcc,@CRDebt,@REDebt,@ILDebt,@CollectionDebt,@TDebt,@PublicRecords,@Experian,@Equifax,@TransUnio,@Fico2,@Fico3,@Fico8,@Comment,@ClientId,@Close,@Source)";
            MySqlCommand cmd   = new MySqlCommand(query, con);

            cmd.Parameters.AddWithValue("@Id", l.Id);
            cmd.Parameters.AddWithValue("@OpenCC", l.OpenCC);
            cmd.Parameters.AddWithValue("@OpenRC", l.OpenRC);
            cmd.Parameters.AddWithValue("@OpenRELoans", l.OpenRELoans);
            cmd.Parameters.AddWithValue("@OpenILoans", l.OpenILoans);
            cmd.Parameters.AddWithValue("@TotalOpenAcc", l.TotalOpenAcc);
            cmd.Parameters.AddWithValue("@AcceverLate", l.AcceverLate);
            cmd.Parameters.AddWithValue("@CollectionAcc", l.CollectionAcc);
            cmd.Parameters.AddWithValue("@AvgAccAge", l.AvgAccAge);
            cmd.Parameters.AddWithValue("@OldestAcc", l.OldestAcc);
            cmd.Parameters.AddWithValue("@CRDebt", l.CRDebt);
            cmd.Parameters.AddWithValue("@REDebt", l.REDebt);
            cmd.Parameters.AddWithValue("@ILDebt", l.ILDebt);
            cmd.Parameters.AddWithValue("@CollectionDebt", l.CollectionDebt);
            cmd.Parameters.AddWithValue("@TDebt", l.TDebt);
            cmd.Parameters.AddWithValue("@PublicRecords", l.PublicRecords);
            cmd.Parameters.AddWithValue("@Experian", l.Experian);
            cmd.Parameters.AddWithValue("@Equifax", l.Equifax);
            cmd.Parameters.AddWithValue("@Comment", l.Comment);
            cmd.Parameters.AddWithValue("@TransUnio", l.TransUnio);
            cmd.Parameters.AddWithValue("@Fico2", l.Fico2);
            cmd.Parameters.AddWithValue("@Fico3", l.Fico3);
            cmd.Parameters.AddWithValue("@Fico8", l.Fico8);
            cmd.Parameters.AddWithValue("@ClientId", l.ClientId);
            cmd.Parameters.AddWithValue("@Close", Convert.ToInt32(l.Close).ToString());
            cmd.Parameters.AddWithValue("@Source", Convert.ToInt32(l.Source).ToString());

            cmd.ExecuteNonQuery();
            con.Close();
        }
Ejemplo n.º 4
0
        public void UpdateLoan2(Loans2 l)
        {
            InquiriesC inq = new InquiriesC();

            inq.RemoveAllInqByLoan(l.Id.ToString());
            CAccountC cacc = new CAccountC();

            cacc.RemoveAllCAccByLoan(l.Id.ToString());
            foreach (var v in l.InqList)
            {
                inq.CreateInq(v);
            }
            foreach (var v in l.CAccList)
            {
                cacc.CreateCAcc(v);
            }

            //change
            while (con.State == ConnectionState.Open)
            {
                System.Threading.Thread.Sleep(500);
            }
            con.Open();
            string       query = "UPDATE Loans2 SET OpenCC=@OpenCC,Source=@Source,OpenRC=@OpenRC,OpenRELoans=@OpenRELoans,OpenILoans=@OpenILoans,TotalOpenAcc=@TotalOpenAcc,AcceverLate=@AcceverLate,CollectionAcc=@CollectionAcc,AvgAccAge=@AvgAccAge,OldestAcc=@OldestAcc,CRDebt=@CRDebt,REDebt=@REDebt,ILDebt=@ILDebt,CollectionDebt=@CollectionDebt,TDebt=@TDebt,PublicRecords=@PublicRecords,Experian=@Experian,Equifax=@Equifax,TransUnio=@TransUnio,Fico2=@Fico2,Fico3=@Fico3,Fico8=@Fico8,Comment=@Comment,ClientId=@ClientId,Close=@Close WHERE Id=@id";
            MySqlCommand cmd   = new MySqlCommand(query, con);

            cmd.Parameters.AddWithValue("@Id", l.Id);
            cmd.Parameters.AddWithValue("@OpenCC", l.OpenCC);
            cmd.Parameters.AddWithValue("@OpenRC", l.OpenRC);
            cmd.Parameters.AddWithValue("@OpenRELoans", l.OpenRELoans);
            cmd.Parameters.AddWithValue("@OpenILoans", l.OpenILoans);
            cmd.Parameters.AddWithValue("@TotalOpenAcc", l.TotalOpenAcc);
            cmd.Parameters.AddWithValue("@AcceverLate", l.AcceverLate);
            cmd.Parameters.AddWithValue("@CollectionAcc", l.CollectionAcc);
            cmd.Parameters.AddWithValue("@AvgAccAge", l.AvgAccAge);
            cmd.Parameters.AddWithValue("@OldestAcc", l.OldestAcc);
            cmd.Parameters.AddWithValue("@CRDebt", l.CRDebt);
            cmd.Parameters.AddWithValue("@REDebt", l.REDebt);
            cmd.Parameters.AddWithValue("@ILDebt", l.ILDebt);
            cmd.Parameters.AddWithValue("@CollectionDebt", l.CollectionDebt);
            cmd.Parameters.AddWithValue("@TDebt", l.TDebt);
            cmd.Parameters.AddWithValue("@PublicRecords", l.PublicRecords);
            cmd.Parameters.AddWithValue("@Experian", l.Experian);
            cmd.Parameters.AddWithValue("@Equifax", l.Equifax);
            cmd.Parameters.AddWithValue("@Comment", l.Comment);
            cmd.Parameters.AddWithValue("@TransUnio", l.TransUnio);
            cmd.Parameters.AddWithValue("@ClientId", l.ClientId);
            cmd.Parameters.AddWithValue("@Fico2", l.Fico2);
            cmd.Parameters.AddWithValue("@Fico3", l.Fico3);
            cmd.Parameters.AddWithValue("@Fico8", l.Fico8);
            cmd.Parameters.AddWithValue("@Close", Convert.ToInt32(l.Close).ToString());
            cmd.Parameters.AddWithValue("@Source", Convert.ToInt32(l.Source).ToString());
            cmd.ExecuteNonQuery();
            con.Close();
        }
Ejemplo n.º 5
0
        public void SendLoans2(Loans2 l)//send to approve
        {
            Loans2C inter = new Loans2C();

            inter.UpdateLoan2(l);
            ClientC inter1 = new ClientC();
            Client  c      = inter1.FindClient(l.ClientId);

            c.MiddleProcess = "2";
            inter1.UpdateClient(c);
        }
Ejemplo n.º 6
0
        public void CreateLoan2(Loans2 l)//create second step when click save
        {
            ClientC inter1 = new ClientC();

            if (inter1.FindClient(l.ClientId).MiddleProcess == "1")
            {
                throw new Exception("The Loan Didn't Approved Yet");
            }
            Loans2C inter = new Loans2C();

            inter.CreateLoan2(l);
        }
Ejemplo n.º 7
0
        public void Save(Loans2 l)//only save not change your status
        {
            Loans2C loans2C = new Loans2C();

            if (loans2C.checkIfExist(l.ClientId))
            {
                loans2C.UpdateLoan2(l);
            }
            else
            {
                loans2C.CreateLoan2(l);
            }
        }
Ejemplo n.º 8
0
        public List <Loans2> AllOpenLoans2()

        {
            List <Loans2> myL = new List <Loans2>();

            //search
            while (con.State == ConnectionState.Open)
            {
                System.Threading.Thread.Sleep(500);
            }
            con.Open();
            MySqlCommand cmd = new MySqlCommand("select * from Loans2 where Close=@close", con);

            cmd.Parameters.AddWithValue("@close", Convert.ToInt32(false));
            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Loans2 l = new Loans2();
                l.Id             = reader["id"].ToString();
                l.OpenCC         = reader["OpenCC"].ToString();
                l.OpenRC         = reader["OpenRC"].ToString();
                l.OpenILoans     = reader["OpenILoans"].ToString();
                l.TotalOpenAcc   = reader["TotalOpenAcc"].ToString();
                l.AcceverLate    = reader["AcceverLate"].ToString();
                l.CollectionAcc  = reader["CollectionAcc"].ToString();
                l.AvgAccAge      = reader["AvgAccAge"].ToString();
                l.OldestAcc      = reader["OldestAcc"].ToString();
                l.CRDebt         = reader["CRDebt"].ToString();
                l.REDebt         = reader["REDebt"].ToString();
                l.ILDebt         = reader["ILDebt"].ToString();
                l.CollectionDebt = reader["CollectionDebt"].ToString();
                l.TDebt          = reader["TDebt"].ToString();
                l.PublicRecords  = reader["PublicRecords"].ToString();
                l.Experian       = reader["Experian"].ToString();
                l.Equifax        = reader["Equifax"].ToString();
                l.TransUnio      = reader["TransUnio"].ToString();
                l.Fico2          = reader["Fico2"].ToString();
                l.Fico3          = reader["Fico3"].ToString();
                l.Fico8          = reader["Fico8"].ToString();
                l.Comment        = reader["Comment"].ToString();
                l.ClientId       = reader["ClientId"].ToString();
                l.Close          = Convert.ToBoolean(Convert.ToInt32(reader["Close"].ToString()));
                l.Source         = Convert.ToBoolean(Convert.ToInt32(reader["Source"].ToString()));
                myL.Add(l);
            }
            con.Close();
            return(myL);
        }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             cid    = Session["Value"].ToString().Split('@')[0];
             status = Session["Value"].ToString().Split('@')[1];
         }
         catch (Exception ex)
         {
             Response.Redirect("~/GlobalForm/StartPage.aspx");
         }
         l = loan.FindLoan2ByClientId(cid);
         fill();
         visabaleStep("1", "");
     }
 }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             cid    = Session["Value"].ToString().Split('@')[0];
             status = Session["Value"].ToString().Split('@')[1];
         }
         catch (Exception ex)
         {
             Response.Redirect("~/GlobalForm/StartPage.aspx");
         }
         l = loan.FindLoan2ByClientId(cid);
         fill();
         visabaleStep("1", "", "");
         if (status == "Client")
         {
             downloadDoc.Visible = false;
             Send.Visible        = false;
             Finish.Visible      = false;
             com1.Attributes.Add("readonly", "readonly");
             com2.Attributes.Add("readonly", "readonly");
             com3.Attributes.Add("readonly", "readonly");
             com4.Attributes.Add("readonly", "readonly");
             com5.Attributes.Add("readonly", "readonly");
         }
         else
         {
             Submit.Visible = false;
             if (l.Source)
             {
                 downloadS.Visible = true;
             }
         }
     }
 }
Ejemplo n.º 11
0
        public void Finish(Loans2 l)
        {
            try
            {
                if (Convert.ToInt32(l.OpenCC) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Credit Cards@1");
            }
            try
            {
                if (Convert.ToInt32(l.OpenRC) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Retail Cards@1");
            }
            try
            {
                if (Convert.ToInt32(l.OpenRELoans) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Real Estate Loans@1");
            }
            try
            {
                if (Convert.ToInt32(l.OpenILoans) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Installment Loans@1");
            }
            try
            {
                if (Convert.ToInt32(l.TotalOpenAcc) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Total Open Account@1");
            }
            try
            {
                if (Convert.ToInt32(l.AcceverLate) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Account Ever Late@1");
            }
            try
            {
                if (Convert.ToInt32(l.CollectionAcc) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Collection Account@1");
            }
            try
            {
                if (Convert.ToInt32(l.AvgAccAge.Split('/')[0]) < 1 || Convert.ToInt32(l.AvgAccAge.Split('/')[0]) > 12)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Month Of Average Account Age @1");
            }
            try
            {
                if (Convert.ToInt32(l.AvgAccAge.Split('/')[1]) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Year Of Average Account Age @1");
            }
            try
            {
                if (Convert.ToInt32(l.OldestAcc.Split('/')[0]) < 1 || Convert.ToInt32(l.AvgAccAge.Split('/')[0]) > 12)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Month Of Oldest Account @1");
            }
            try
            {
                if (Convert.ToInt32(l.OldestAcc.Split('/')[1]) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Year Of Oldest Account @1");
            }
            try
            {
                if (Convert.ToInt32(l.CRDebt) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Credit And Retail Card Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.REDebt) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Real Estate Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.ILDebt) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Installment Loans Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.CollectionDebt) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Collections Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.TDebt) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Total Debt@1");
            }
            foreach (var v in l.CAccList)
            {
                AddAccount(v);
            }
            foreach (var v in l.InqList)
            {
                AddInquiries(v);
            }
            try
            {
                if (Convert.ToInt32(l.Experian) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Experian @5");
            }
            try
            {
                if (Convert.ToInt32(l.Equifax) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Equifax@5");
            }
            try
            {
                if (Convert.ToInt32(l.TransUnio) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Trans Unio @5");
            }
            try
            {
                if (Convert.ToInt32(l.Fico2) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Fico 2 @5");
            }
            try
            {
                if (Convert.ToInt32(l.Fico8) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Fico 8 @5");
            }
            try
            {
                if (Convert.ToInt32(l.Fico3) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Fico 3 @5");
            }
            Loans2C loans2C = new Loans2C();

            loans2C.UpdateLoan2(l);
            ClientC c      = new ClientC();
            Client  client = c.FindClient(l.ClientId);

            client.MiddleProcess = "2app";
            c.UpdateClient(client);
            string     message = "We want to let you know that the report was approved";
            SendEmailC send    = new SendEmailC();

            send.SendEmailF(client.Mail, "The Report Was Approved", message);
        }
Ejemplo n.º 12
0
        public void Send(Loans2 l)
        {
            //try
            //{
            //    if (Convert.ToInt32(l.OpenCC.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Open Credit Cards@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.OpenRC.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Open Retail Cards@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.OpenRELoans.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Open Real Estate Loans@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.OpenILoans.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Open Installment Loans@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.TotalOpenAcc.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Total Open Account@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.AcceverLate.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Account Ever Late@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.CollectionAcc.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Collection Account@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.AvgAccAge.Split('/')[0]) < 1 || Convert.ToInt32(l.AvgAccAge.Split('/')[0]) > 12)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Month Of Average Account Age @1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.AvgAccAge.Split('/')[1]) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Year Of Average Account Age @1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.OldestAcc.Split('/')[0]) < 1 || Convert.ToInt32(l.AvgAccAge.Split('/')[0]) > 12)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Month Of Oldest Account @1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.OldestAcc.Split('/')[1]) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Year Of Oldest Account @1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.CRDebt.Replace(",","")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Credit And Retail Card Debt@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.REDebt.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Real Estate Debt@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.ILDebt.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Installment Loans Debt@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.CollectionDebt.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Collections Debt@1");
            //}
            //try
            //{
            //    if (Convert.ToInt32(l.TDebt.Replace(",", "")) < 0)
            //        throw new Exception();
            //}
            //catch
            //{
            //    throw new Exception("Unavailable Total Debt@1");
            //}
            foreach (var v in l.CAccList)
            {
                AddAccount(v);
            }
            foreach (var v in l.InqList)
            {
                AddInquiries(v);
            }
            try
            {
                if (Convert.ToInt32(l.Experian.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Experian @5");
            }
            try
            {
                if (Convert.ToInt32(l.Equifax.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Equifax@5");
            }
            try
            {
                if (Convert.ToInt32(l.TransUnio.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Trans Unio @5");
            }
            Loans2C loans2C = new Loans2C();

            loans2C.UpdateLoan2(l);
            ClientC c      = new ClientC();
            Client  client = c.FindClient(l.ClientId);

            client.MiddleProcess = "2napp";
            c.UpdateClient(client);
            UserC      u       = new UserC();
            SendEmailC send    = new SendEmailC();
            string     message = "We want to let you know that there are several  problrm in your report. Please enter to our system(to the report) and change them. (you will have a comments in the system about the changes)";

            send.SendEmailF(client.Mail, "The Report Of" + client.Fname + " " + client.Lname, message);
        }
Ejemplo n.º 13
0
        public void Submit(Loans2 l)//save (update) and change the status and let the  employee knows
        {
            try
            {
                if (Convert.ToInt32(l.OpenCC) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Credit Cards@1");
            }
            try
            {
                if (Convert.ToInt32(l.OpenRC) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Retail Cards@1");
            }
            try
            {
                if (Convert.ToInt32(l.OpenRELoans) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Real Estate Loans@1");
            }
            try
            {
                if (Convert.ToInt32(l.OpenILoans) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Open Installment Loans@1");
            }
            try
            {
                if (Convert.ToInt32(l.TotalOpenAcc) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Total Open Account@1");
            }
            try
            {
                if (Convert.ToInt32(l.AcceverLate) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Account Ever Late@1");
            }
            try
            {
                if (Convert.ToInt32(l.CollectionAcc) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Collection Account@1");
            }
            try
            {
                if (Convert.ToInt32(l.AvgAccAge.Split('/')[0]) < 1 || Convert.ToInt32(l.AvgAccAge.Split('/')[0]) > 12)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Month Of Average Account Age @1");
            }
            try
            {
                if (Convert.ToInt32(l.AvgAccAge.Split('/')[1]) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Year Of Average Account Age @1");
            }
            try
            {
                if (Convert.ToInt32(l.OldestAcc.Split('/')[0]) < 1 || Convert.ToInt32(l.AvgAccAge.Split('/')[0]) > 12)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Month Of Oldest Account @1");
            }
            try
            {
                if (Convert.ToInt32(l.OldestAcc.Split('/')[1]) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Year Of Oldest Account @1");
            }
            try
            {
                if (Convert.ToInt32(l.CRDebt.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Credit And Retail Card Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.REDebt.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Real Estate Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.ILDebt.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Installment Loans Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.CollectionDebt.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Collections Debt@1");
            }
            try
            {
                if (Convert.ToInt32(l.TDebt.Replace(",", "")) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Total Debt@1");
            }
            foreach (var v in l.CAccList)
            {
                AddAccount(v);
            }
            foreach (var v in l.InqList)
            {
                AddInquiries(v);
            }
            try
            {
                if (Convert.ToInt32(l.Experian) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Experian @5");
            }
            try
            {
                if (Convert.ToInt32(l.Equifax) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Equifax@5");
            }
            try
            {
                if (Convert.ToInt32(l.TransUnio) < 0)
                {
                    throw new Exception();
                }
            }
            catch
            {
                throw new Exception("Unavailable Trans Unio @5");
            }
            Loans2C loans2C = new Loans2C();
            string  message = "";
            ClientC c       = new ClientC();
            Client  c1      = c.FindClient(l.ClientId);

            if (loans2C.checkIfExist(l.ClientId))
            {
                loans2C.UpdateLoan2(l);
                message = c1.Fname + " " + c1.Lname + " " + c1.Mail + " " + c1.MobileNum + " " + "Change the report";
            }
            else
            {
                loans2C.CreateLoan2(l);
                message = c1.Fname + " " + c1.Lname + " " + c1.Mail + " " + c1.MobileNum + " " + "Send report";
            }
            c1.MiddleProcess = "2";
            c.UpdateClient(c1);
            SendEmailC send = new SendEmailC();
            UserC      u    = new UserC();

            send.SendEmailF(u.FindNeedEmail("Manager", l.ClientId), "Report Of " + c1.Fname + " " + c1.Lname, message);
        }
Ejemplo n.º 14
0
        public Loans2 pageLoad(string clienId)
        {
            Loans2 loans2 = FindLoan2ByClientId(clienId);

            return(loans2);
        }