public bool Backend_AddContract(string clientName, string clientRegno, string clientPhone, string clientEmail, string clientAddress, long facilityId, long areaId, DateTime startDate, string settlementMethod) { Trace.WriteLine("Backend_AddContract"); bool result = false; long newContractId = -1; DataManager dataMan = new DataManager(); long clientId = dataMan.CheckUserExists(clientRegno); if (clientId > -1) { if (dataMan.CheckActiveContractExists(clientRegno) > -1) { result = false; } else { newContractId = dataMan.AddContract(clientId, areaId, facilityId, startDate, settlementMethod); result = true; } } else { clientId = dataMan.AddUser(clientName, clientRegno, clientPhone, clientEmail, clientAddress); newContractId = dataMan.AddContract(clientId, areaId, facilityId, startDate, settlementMethod); result = true; } if (result && newContractId != -1) { NotifyNetworkOwner(newContractId); } return result; }
public bool Frontend_AuthenticateClient(string clientRegno, string password) { Trace.WriteLine("Frontend_AuthenticateClient"); DataManager dataMan = new DataManager(); return dataMan.CheckUserExists(clientRegno) > -1; }