public static Savings GetById(int id) { const string GET_ALL = "select Id,MemberId,SavingsDate,SavingsAmt,SavingsId,CreatedBy from tbSavings where Id=@Id and Deleted=0"; Savings ret = new Savings(); SqlCommand cmd = new SqlCommand(GET_ALL); cmd.Parameters.Add(new SqlParameter("Id", id)); ret = SqlManager.Select <Savings>(cmd).First(); return(ret); }
public static bool Insert(Savings savings) { const string insert = "insert [tbSavings] (MemberId,SavingsDate,SavingsAmt,SavingsId,CreatedBy,Deleted) values (@MemberId,@SavingsDate,@SavingsAmt,@SavingsId,@CreatedBy,@Deleted) "; SqlCommand ret = new SqlCommand(insert); ret.Parameters.Add(new SqlParameter("CreatedBy", savings.CreatedBy)); ret.Parameters.Add(new SqlParameter("MemberId", savings.MemberId)); ret.Parameters.Add(new SqlParameter("SavingsDate", savings.SavingsDate)); ret.Parameters.Add(new SqlParameter("SavingsAmt", savings.SavingsAmt)); ret.Parameters.Add(new SqlParameter("SavingsId", savings.SavingsId)); ret.Parameters.Add(new SqlParameter("Deleted", savings.Deleted)); return(SqlManager.ExecuteNonQuery(ret)); }