예제 #1
0
        public static LeadBuildResult AddProjectLeadBldg(int ProjectID, int Building, int AddressID, int Age, int Type, int LHCUnits, bool FloodHazard, bool FloodIns,
                                                         int VerifiedBy, string InsuredBy, int HistStatus, int AppendA)
        {
            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 = "AddProjectLeadBldg";

                        //11 Parameters
                        command.Parameters.Add(new SqlParameter("ProjectID", ProjectID));
                        command.Parameters.Add(new SqlParameter("Building", Building));
                        command.Parameters.Add(new SqlParameter("AddressID", AddressID));
                        command.Parameters.Add(new SqlParameter("Age", Age));

                        command.Parameters.Add(new SqlParameter("Type", Type));
                        command.Parameters.Add(new SqlParameter("LHCUnits", LHCUnits));
                        command.Parameters.Add(new SqlParameter("FloodHazard", FloodHazard));
                        command.Parameters.Add(new SqlParameter("FloodIns", FloodIns));
                        command.Parameters.Add(new SqlParameter("VerifiedBy", VerifiedBy));
                        command.Parameters.Add(new SqlParameter("InsuredBy", InsuredBy));
                        command.Parameters.Add(new SqlParameter("HistStatus", HistStatus));
                        command.Parameters.Add(new SqlParameter("AppendA", AppendA));

                        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();

                        LeadBuildResult ap = new LeadBuildResult();

                        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 LeadBuildResult AddProjectLeadUnit(int LeadBldgID, int Unit, int EBLStatus, int HHCount, int Rooms, decimal HHIncome, bool PartyVerified, int IncomeStatus, decimal MatchFunds,
                                                         DateTime ClearDate, DateTime CertDate, DateTime ReCertDate)
        {
            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 = "AddProjectLeadUnit";

                        command.Parameters.Add(new SqlParameter("LeadBldgID", LeadBldgID));
                        command.Parameters.Add(new SqlParameter("Unit", Unit));
                        command.Parameters.Add(new SqlParameter("EBLStatus", EBLStatus));
                        command.Parameters.Add(new SqlParameter("HHCount", HHCount));
                        command.Parameters.Add(new SqlParameter("Rooms", Rooms));
                        command.Parameters.Add(new SqlParameter("HHIncome", HHIncome));
                        command.Parameters.Add(new SqlParameter("PartyVerified", PartyVerified));
                        command.Parameters.Add(new SqlParameter("IncomeStatus", IncomeStatus));
                        command.Parameters.Add(new SqlParameter("MatchFunds", MatchFunds));
                        command.Parameters.Add(new SqlParameter("ClearDate", ClearDate.ToShortDateString() == "1/1/0001" ? System.Data.SqlTypes.SqlDateTime.Null : ClearDate));
                        command.Parameters.Add(new SqlParameter("CertDate", CertDate.ToShortDateString() == "1/1/0001" ? System.Data.SqlTypes.SqlDateTime.Null : CertDate));
                        command.Parameters.Add(new SqlParameter("ReCertDate", ReCertDate.ToShortDateString() == "1/1/0001" ? System.Data.SqlTypes.SqlDateTime.Null : ReCertDate));

                        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();

                        LeadBuildResult ap = new LeadBuildResult();

                        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;
            }
        }