private void ReadSettings2(SettingsDM setting) { string sAPIInput = ""; APIRunner oAPI = new APIRunner(m); string[] aParamData = new string[10]; int iAPINumber = c.API05_READ_SETTINGS; aParamData[0] = ""; sAPIInput = m.ArrayToString(aParamData); oAPI.ActionCode = iAPINumber; oAPI.InputParameters = sAPIInput; oAPI.CallAPI(c.APIType.SENDDATA_RECEIVEDATA); if (oAPI.ErrorOccured) { ErrorMessage = oAPI.APIErrorMessage; SecretErrorDetails = oAPI.APIErrorSecretInfo; return; } ds1 = oAPI.DatasetReturned; if (m.EmptyTable(ds1)) { ErrorMessage = "Settings table has no rows"; return; } setting.SystemCustomCodes = m.GetFieldStr("SystemCustomCodes", ds1); setting.PinNumber1 = m.GetFieldStr("PinNumber1", ds1); setting.PinNumber2 = m.GetFieldStr("PinNumber2", ds1); setting.PinNumber3 = m.GetFieldStr("PinNumber3", ds1); setting.IncludeSecretInfoInErrMsgToUser = m.GetFieldBol("IncludeSecretInfoInErrMsgToUser", ds1); setting.CopywriteNotice = m.GetFieldStr("CopywriteNotice", ds1); setting.ProductName = m.GetFieldStr("ProductName", ds1); setting.ContactUrl = m.GetFieldStr("ContactUrl", ds1); setting.DisableSystem = m.GetFieldBol("DisableSystem", ds1); setting.DisableMessage = m.GetFieldStr("DisableMessage", ds1); setting.AboutLine1 = m.GetFieldStr("AboutLine1", ds1); setting.AboutLine2 = m.GetFieldStr("AboutLine2", ds1); setting.AboutLine3 = m.GetFieldStr("AboutLine3", ds1); setting.TextField1 = m.GetFieldStr("TextField1", ds1); setting.TextField2 = m.GetFieldStr("TextField2", ds1); setting.TextField3 = m.GetFieldStr("TextField3", ds1); setting.TextField4 = m.GetFieldStr("TextField4", ds1); setting.CheckBox1 = m.GetFieldBol("CheckBox1", ds1); setting.CheckBox2 = m.GetFieldBol("CheckBox2", ds1); setting.CheckBox3 = m.GetFieldBol("CheckBox3", ds1); setting.CheckBox4 = m.GetFieldBol("CheckBox4", ds1); setting.CheckBox5 = m.GetFieldBol("CheckBox5", ds1); setting.CheckBox6 = m.GetFieldBol("CheckBox6", ds1); setting.CheckBox7 = m.GetFieldBol("CheckBox7", ds1); }
private List <GroupItemDM> GetGroups2(bool bAll) { List <GroupItemDM> GroupList = new List <GroupItemDM>(); GroupItemDM GroupItem; string sAPIInput = ""; APIRunner oAPI = new APIRunner(m); string[] aParamData = new string[10]; int iAPINumber = c.API04_GET_GROUPS; if (bAll) { aParamData[0] = "1"; } else { aParamData[0] = "0"; } sAPIInput = m.ArrayToString(aParamData); oAPI.ActionCode = iAPINumber; oAPI.InputParameters = sAPIInput; oAPI.CallAPI(c.APIType.SENDDATA_RECEIVEDATA); if (oAPI.ErrorOccured) { ErrorMessage = oAPI.APIErrorMessage; SecretErrorDetails = oAPI.APIErrorSecretInfo; return(GroupList); } ds1 = oAPI.DatasetReturned; foreach (DataRow r in ds1.Tables[0].Rows) { GroupItem = new GroupItemDM(); GroupItem.GroupGUID = m.GetFieldStr("GroupGUID", r); GroupItem.GroupName = m.GetFieldStr("GroupName", r); GroupItem.GroupDescription = m.GetFieldStr("GroupDescription", r); GroupItem.GroupPin = m.GetFieldStr("GroupPin", r); GroupItem.GroupPhone = m.GetFieldStr("GroupPhone", r); GroupItem.GroupEmail = m.GetFieldStr("GroupEmail", r); GroupItem.GroupActive = m.GetFieldBol("GroupActive", r); GroupItem.GroupIsDefault = m.GetFieldBol("GroupIsDefault", r); GroupItem.GroupShowAllGroups = m.GetFieldBol("GroupShowAllGroups", r); GroupItem.GroupColor = m.GetFieldStr("GroupColor", r); GroupList.Add(GroupItem); } return(GroupList); }
private List <ChatDM> GetChatList2(string sTTGUID) { List <ChatDM> ccList = new List <ChatDM>(); ChatDM ccItem; string sAPIInput = ""; APIRunner oAPI = new APIRunner(m); string[] aParamData = new string[10]; aParamData[0] = sTTGUID; int iAPINumber = c.API06_GET_MESSAGES_LIST; sAPIInput = m.ArrayToString(aParamData); oAPI.ActionCode = iAPINumber; oAPI.InputParameters = sAPIInput; oAPI.CallAPI(c.APIType.SENDDATA_RECEIVEDATA); if (oAPI.ErrorOccured) { ErrorMessage = oAPI.APIErrorMessage; SecretErrorDetails = oAPI.APIErrorSecretInfo; return(ccList); } ds1 = oAPI.DatasetReturned; foreach (DataRow r in ds1.Tables[0].Rows) { ccItem = new ChatDM(); ccItem.ChatGUID = m.GetFieldStr("ChatGUID", r); ccItem.DateTimeEntered = m.GetFieldDate("DateTimeEntered", r); ccItem.Message = m.GetFieldStr("Message", r); ccItem.IPAddress = m.GetFieldStr("IPAddress", r); ccItem.DisplayLine = m.GetPrettyDate(ccItem.DateTimeEntered) + " -- " + ccItem.Message; ccList.Add(ccItem); } return(ccList); }
private List <AuditLogDM> GetAuditLog2(string ttGUID) { List <AuditLogDM> ccList = new List <AuditLogDM>(); AuditLogDM ccItem; string sAPIInput = ""; APIRunner oAPI = new APIRunner(m); string[] aParamData = new string[10]; aParamData[0] = ttGUID; int iAPINumber = c.API07_GET_AUDITLOG; sAPIInput = m.ArrayToString(aParamData); oAPI.ActionCode = iAPINumber; oAPI.InputParameters = sAPIInput; oAPI.CallAPI(c.APIType.SENDDATA_RECEIVEDATA); if (oAPI.ErrorOccured) { ErrorMessage = oAPI.APIErrorMessage; SecretErrorDetails = oAPI.APIErrorSecretInfo; return(ccList); } ds1 = oAPI.DatasetReturned; foreach (DataRow r in ds1.Tables[0].Rows) { ccItem = new AuditLogDM(); ccItem.LogGUID = m.GetFieldStr("LogGUID", r); ccItem.TTGUID = m.GetFieldStr("TTGUID", r); ccItem.LogDateTime = m.GetFieldDate("LogDateTime", r); ccItem.LogEvent = m.GetFieldStr("LogEvent", r); ccItem.LogIPAddress = m.GetFieldStr("LogIPAddress", r); ccItem.DisplayLine1 = m.FormatDT(ccItem.LogDateTime, c.DATE_FORMAT21).ToLower(); ccItem.DisplayLine2 = ccItem.LogEvent; ccList.Add(ccItem); } return(ccList); }
private List <TeeTimeItem> GetListOfTeeTimes2(string GroupGUID, bool ShowAllTeeTimes) { string sAPIInput = ""; APIRunner oAPI = new APIRunner(m); string[] aParamData = new string[10]; int iAPINumber = c.API01_GET_TEETIMES; TeeTimeItem ttItem; List <TeeTimeItem> TTList = new List <TeeTimeItem>(); if (m.IsEmpty(GroupGUID)) { GroupGUID = LookupDefaultGroupGUID(); } aParamData[0] = GroupGUID; aParamData[1] = m.BolToStr(ShowAllTeeTimes); sAPIInput = m.ArrayToString(aParamData); oAPI.ActionCode = iAPINumber; oAPI.InputParameters = sAPIInput; oAPI.CallAPI(c.APIType.SENDDATA_RECEIVEDATA); if (oAPI.ErrorOccured) { ErrorMessage = oAPI.APIErrorMessage; SecretErrorDetails = oAPI.APIErrorSecretInfo; return(TTList); } ds1 = oAPI.DatasetReturned; foreach (DataRow r in ds1.Tables[0].Rows) { ttItem = new TeeTimeItem(); ttItem.TTGUID = m.GetFieldStr("TeeTimeGUID", r); ttItem.GroupGUID = m.GetFieldStr("GroupGUID", r); ttItem.GroupName = m.GetFieldStr("GroupName", r); ttItem.TTDate = m.GetFieldDate("TeeTimeDate", r); ttItem.TTTime = m.GetFieldDate("TeeTimeTime", r); ttItem.TTDateFormated = m.GetFieldDateF("TeeTimeDate", r, c.DATE_FORMAT20); ttItem.TTTimeFormated = m.GetFieldDateF("TeeTimeTime", r, c.DATE_FORMAT10).ToLower(); ttItem.DaysFromNow = m.DaysFromNow(m.GetFieldDate("TeeTimeDate", r)); ttItem.Owner = m.GetFieldStr("TeeTimeOwner", r); ttItem.OwnerComment = m.GetFieldStr("OwnerComment", r); ttItem.Location = m.GetFieldStr("TeeTimeLocation", r); ttItem.Player1 = m.GetFieldStr("Player1", r); ttItem.Player2 = m.GetFieldStr("Player2", r); ttItem.Player3 = m.GetFieldStr("Player3", r); ttItem.Player4 = m.GetFieldStr("Player4", r); ttItem.Player1Comment = m.GetFieldStr("Player1Comment", r); ttItem.Player2Comment = m.GetFieldStr("Player2Comment", r); ttItem.Player3Comment = m.GetFieldStr("Player3Comment", r); ttItem.Player4Comment = m.GetFieldStr("Player4Comment", r); ttItem.WaitList1 = m.GetFieldStr("WaitList1", r); ttItem.WaitList2 = m.GetFieldStr("WaitList2", r); ttItem.WaitList3 = m.GetFieldStr("WaitList3", r); ttItem.IsDeleted = m.GetFieldBol("IsDeleted", r); ttItem.LockPlayer1 = m.GetFieldBol("LockPlayer1", r); ttItem.LockPlayer2 = m.GetFieldBol("LockPlayer2", r); ttItem.LockPlayer3 = m.GetFieldBol("LockPlayer3", r); ttItem.LockPlayer4 = m.GetFieldBol("LockPlayer4", r); ttItem.HideMessages = m.GetFieldBol("HideMessages", r); ttItem.LockMessages = m.GetFieldBol("LockMessages", r); ttItem.SpotsAvailable = SpotsLeft(ttItem); AddChatToTTItem(ttItem); TTList.Add(ttItem); } return(TTList); }