IwbDataRow.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using IwbZero.ToolCommon.StringModel;
  3. namespace IwbZero.IwbDataQuery
  4. {
  5. public class IwbDataRow : IwbBaseAttribute
  6. {
  7. public DateTime GetDateTime(string pcField)
  8. {
  9. return GetString(pcField).StrToDt();
  10. }
  11. public decimal GetDec(string pcField)
  12. {
  13. return GetString(pcField).ValD();
  14. }
  15. public int GetInt(string pcField)
  16. {
  17. return GetString(pcField).ValI();
  18. }
  19. public string GetString(string pcField)
  20. {
  21. return base[pcField].ToString().Trim();
  22. }
  23. public string GetString(string pcField, string pcDefault)
  24. {
  25. string str = GetString(pcField);
  26. if (str == "")
  27. {
  28. str = pcDefault;
  29. }
  30. return str;
  31. }
  32. public void Set(string pcField, object pcValue)
  33. {
  34. string key = pcField.UAndT();
  35. if (pcValue == null)
  36. {
  37. pcValue = "";
  38. }
  39. if (_htProperties.ContainsKey(key))
  40. {
  41. base[pcField] = pcValue;
  42. }
  43. else
  44. {
  45. _htProperties.Add(key, pcValue);
  46. }
  47. }
  48. }
  49. }