Exemplo n.º 1
0
        public List <CallOperators> GetCallOperators(string operatorId = "")
        {
            Datahandler          dh            = Datahandler.getData();
            List <CallOperators> callOperators = new List <CallOperators>();
            DataTable            table         = new DataTable();

            if (operatorId != "")
            {
                table = dh.readDataFromDB(DataAccesHelper.QueryGetCallOperators + " WHERE " + DataAccesHelper.operatorId + " = '" + operatorId + "'");
            }
            else
            {
                table = dh.readDataFromDB(DataAccesHelper.QueryGetCallOperators);
            }

            foreach (DataRow item in table.Rows)
            {
                CallOperators c = new CallOperators();
                c.PersonId      = item[DataAccesHelper.operatorId].ToString();
                c.Name          = item[DataAccesHelper.operatorName].ToString();
                c.Surname       = item[DataAccesHelper.operatorSurname].ToString();
                c.PersonAddress = new Address(item[DataAccesHelper.addressId].ToString(), item[DataAccesHelper.addrLine1].ToString(), item[DataAccesHelper.addrLine2].ToString(), item[DataAccesHelper.addrCity].ToString(), item[DataAccesHelper.addrPostalCode].ToString());
                c.PersonContact = new Contact(item[DataAccesHelper.contactId].ToString(), item[DataAccesHelper.contactCell].ToString(), item[DataAccesHelper.contactEmail].ToString());
                c.Status        = item[DataAccesHelper.operatorStatus].ToString();
                callOperators.Add(c);
            }

            return(callOperators);
        }
Exemplo n.º 2
0
 public CallLog(CallOperators logOperator, Client logClient, DateTime startTime, DateTime endTime, string remarks)
 {
     this.LogOperator = logOperator;
     this.LogClient   = logClient;
     this.StartTime   = startTime;
     this.EndTime     = endTime;
     this.Remarks     = remarks;
 }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            CallOperators co = obj as CallOperators;

            if ((object)co == null)
            {
                return(false);
            }
            return(base.Equals(obj) && (this.Status == co.Status));
        }
Exemplo n.º 4
0
        public CallOperators GetMatchingCallOperator()
        {
            CallOperators        callOp  = new CallOperators();
            List <CallOperators> callOps = callOp.GetCallOperators();

            foreach (CallOperators item in callOps)
            {
                if (item.PersonContact.Email == this.Email)
                {
                    callOp = item;
                }
            }
            callOp = callOp != null ? callOp : new CallOperators("", this.Name, this.Surname, new Address(), new Contact(), "Active");

            return(callOp);
        }