public void Delete(int Id , out string Message, out System.Drawing.Color Color) { Object.BudgetType budgetType = new Object.BudgetType(); budgetType.Id = Id; int ResultNumber = crud.Delete(budgetType); message.Delete(ResultNumber, out Message, out Color); }
public void Create(string Item, int OperationLengthId, int OperationTypeId , out string Message, out System.Drawing.Color Color) { Object.BudgetType budgetType = new Object.BudgetType(); budgetType.Item = Item; budgetType.OperationLengthId = OperationLengthId; budgetType.OperationTypeId = OperationTypeId; int ResultNumber = crud.Create(budgetType); message.Create(ResultNumber, out Message, out Color); }
public int Delete(Object.BudgetType budgetType) { using (SqlConnection con = new SqlConnection(SharedMethods.getConnectionString())) { SqlCommand cmd = new SqlCommand("Delete From tblBudgetType Where Id = @Id", con); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@Id", budgetType.Id); con.Open(); return(cmd.ExecuteNonQuery()); } }
public int Create(Object.BudgetType budgetType) { using (SqlConnection con = new SqlConnection(SharedMethods.getConnectionString())) { SqlCommand cmd = new SqlCommand("spAddBudgetType_tblBudgetType", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Item", budgetType.Item); cmd.Parameters.AddWithValue("@OperationTypeId", budgetType.OperationTypeId); cmd.Parameters.AddWithValue("@OperationLengthId", budgetType.OperationLengthId); SqlParameter Result = new SqlParameter("@ResultNumber", DbType.Int32); Result.Direction = ParameterDirection.Output; cmd.Parameters.Add(Result); con.Open(); cmd.ExecuteNonQuery(); con.Close(); return((int)Result.Value); } }