public override bool Init(Client client) { if (client.ConnType == ConnectionType.WebSocket && client.WSData != null) { string[] WSData = Regex.Split(client.WSData, BaseFuncs.WSplit); string Action = WSData[0]; if (Action == "AddPhoneCall" && WSData.Length == 4) { PhoneCall phoneCall = new PhoneCall(); phoneCall.Name = WSData[1]; phoneCall.Phone = WSData[2]; phoneCall.Comment = WSData[3]; if (phoneCallService.Add(phoneCall) != null) { Logger.ConsoleLog("Added new phone call: " + phoneCall.Phone, ConsoleColor.Yellow); } } } else { BaseFuncs.Show404(client); } return(false); }
public PhoneCall Add(PhoneCall phoneCall) { if (phoneCall.Name.Length > 1 && phoneCall.Phone.Length > 1) { return(this.GetByID(DBConnector.manager.InsertQueryReturn(phoneCall))); } return(null); }
public void ChangeStatus(int status, int phoneCallID) { DBConnector.manager.FastUpdate <PhoneCall>(data => { PhoneCall phoneCall = data as PhoneCall; if (phoneCall.ID == phoneCallID) { phoneCall.Status = status; return(phoneCall); } return(null); }); }