예제 #1
0
        public static HomeOwnershipResult AddProjectHomeOwnership(int HomeOwnershipID, int Owner, int LkLender, bool vhfa, bool RDLoan, decimal VHCBGrant, decimal OwnerApprec, decimal CapImprove,
                                                                  decimal InitFee, decimal ResaleFee, decimal StewFee, decimal AssistLoan, decimal RehabLoan)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["dbConnection"].ConnectionString))
                {
                    connection.Open();

                    using (SqlCommand command = new SqlCommand())
                    {
                        command.Connection  = connection;
                        command.CommandType = CommandType.StoredProcedure;
                        command.CommandText = "AddProjectHomeOwnership";

                        command.Parameters.Add(new SqlParameter("HomeOwnershipID", HomeOwnershipID));
                        command.Parameters.Add(new SqlParameter("Owner", Owner));
                        command.Parameters.Add(new SqlParameter("LkLender", LkLender));
                        command.Parameters.Add(new SqlParameter("vhfa", vhfa));
                        command.Parameters.Add(new SqlParameter("RDLoan", RDLoan));
                        command.Parameters.Add(new SqlParameter("VHCBGrant", VHCBGrant));
                        command.Parameters.Add(new SqlParameter("OwnerApprec", OwnerApprec));
                        command.Parameters.Add(new SqlParameter("CapImprove", CapImprove));
                        command.Parameters.Add(new SqlParameter("InitFee", InitFee));
                        command.Parameters.Add(new SqlParameter("ResaleFee", ResaleFee));
                        command.Parameters.Add(new SqlParameter("StewFee", StewFee));
                        command.Parameters.Add(new SqlParameter("AssistLoan", AssistLoan));
                        command.Parameters.Add(new SqlParameter("RehabLoan", RehabLoan));

                        SqlParameter parmMessage = new SqlParameter("@isDuplicate", SqlDbType.Bit);
                        parmMessage.Direction = ParameterDirection.Output;
                        command.Parameters.Add(parmMessage);

                        SqlParameter parmMessage1 = new SqlParameter("@isActive", SqlDbType.Int);
                        parmMessage1.Direction = ParameterDirection.Output;
                        command.Parameters.Add(parmMessage1);


                        command.CommandTimeout = 60 * 5;

                        command.ExecuteNonQuery();

                        HomeOwnershipResult ap = new HomeOwnershipResult();

                        ap.IsDuplicate = DataUtils.GetBool(command.Parameters["@isDuplicate"].Value.ToString());
                        ap.IsActive    = DataUtils.GetBool(command.Parameters["@isActive"].Value.ToString());

                        return(ap);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        public static HomeOwnershipResult AddHomeOwnershipAddress(int ProjectID, int AddressID, bool MH, bool Condo, bool SFD)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["dbConnection"].ConnectionString))
                {
                    connection.Open();

                    using (SqlCommand command = new SqlCommand())
                    {
                        command.Connection  = connection;
                        command.CommandType = CommandType.StoredProcedure;
                        command.CommandText = "AddHomeOwnershipAddress";

                        //11 Parameters
                        command.Parameters.Add(new SqlParameter("ProjectID", ProjectID));
                        command.Parameters.Add(new SqlParameter("AddressID", AddressID));
                        command.Parameters.Add(new SqlParameter("MH", MH));
                        command.Parameters.Add(new SqlParameter("Condo", Condo));
                        command.Parameters.Add(new SqlParameter("SFD", SFD));

                        SqlParameter parmMessage = new SqlParameter("@isDuplicate", SqlDbType.Bit);
                        parmMessage.Direction = ParameterDirection.Output;
                        command.Parameters.Add(parmMessage);

                        SqlParameter parmMessage1 = new SqlParameter("@isActive", SqlDbType.Int);
                        parmMessage1.Direction = ParameterDirection.Output;
                        command.Parameters.Add(parmMessage1);


                        command.CommandTimeout = 60 * 5;

                        command.ExecuteNonQuery();

                        HomeOwnershipResult ap = new HomeOwnershipResult();

                        ap.IsDuplicate = DataUtils.GetBool(command.Parameters["@isDuplicate"].Value.ToString());
                        ap.IsActive    = DataUtils.GetBool(command.Parameters["@isActive"].Value.ToString());

                        return(ap);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }