public static ConservationAct250Result AddAct250Farm(string UsePermit, int LkTownDev, int CDist, int Type, string DevName, int Primelost, int Statelost, int TotalAcreslost, int AcresDevelop, int Developer, decimal AntFunds, DateTime MitDate) { 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 = "AddAct250Farm"; command.Parameters.Add(new SqlParameter("UsePermit", UsePermit)); command.Parameters.Add(new SqlParameter("LkTownDev", LkTownDev)); command.Parameters.Add(new SqlParameter("CDist", CDist)); command.Parameters.Add(new SqlParameter("Type", Type)); command.Parameters.Add(new SqlParameter("DevName", DevName)); command.Parameters.Add(new SqlParameter("Primelost", Primelost)); command.Parameters.Add(new SqlParameter("Statelost", Statelost)); command.Parameters.Add(new SqlParameter("TotalAcreslost", TotalAcreslost)); command.Parameters.Add(new SqlParameter("AcresDevelop", AcresDevelop)); command.Parameters.Add(new SqlParameter("Developer", Developer)); command.Parameters.Add(new SqlParameter("AntFunds", AntFunds)); command.Parameters.Add(new SqlParameter("MitDate", MitDate.ToShortDateString() == "1/1/0001" ? System.Data.SqlTypes.SqlDateTime.Null : MitDate)); 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(); ConservationAct250Result ap = new ConservationAct250Result(); 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; } }
public static ConservationAct250Result AddAct250Projects(int Act250FarmID, int ProjectID, int LKTownConserve, decimal AmtFunds, DateTime DateClosed) { 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 = "AddAct250Projects"; command.Parameters.Add(new SqlParameter("Act250FarmID", Act250FarmID)); command.Parameters.Add(new SqlParameter("ProjectID", ProjectID)); command.Parameters.Add(new SqlParameter("LKTownConserve", LKTownConserve)); command.Parameters.Add(new SqlParameter("AmtFunds", AmtFunds)); command.Parameters.Add(new SqlParameter("DateClosed", DateClosed.ToShortDateString() == "1/1/0001" ? System.Data.SqlTypes.SqlDateTime.Null : DateClosed)); 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(); ConservationAct250Result ap = new ConservationAct250Result(); 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; } }