Ejemplo n.º 1
0
        public List <CallLog> GetCalls(string clientId = "")
        {
            Datahandler    dh    = Datahandler.getData();
            List <CallLog> calls = new List <CallLog>();
            DataTable      table = new DataTable();

            if (clientId != "")
            {
                table = dh.readDataFromDB(DataAccesHelper.QueryGetAllCalls + " WHERE " + DataAccesHelper.callClientId + " = '" + clientId + "'");
            }
            else
            {
                table = dh.readDataFromDB(DataAccesHelper.QueryGetAllCalls);
            }

            foreach (DataRow item in table.Rows)
            {
                CallLog c = new CallLog();
                c.LogOperator = new CallOperators(item[DataAccesHelper.callOperatorId].ToString(), item[DataAccesHelper.operatorName].ToString(), item[DataAccesHelper.operatorSurname].ToString(), null, null, "");
                c.LogClient   = new Client("", "", "", null, null, "", "", item[DataAccesHelper.callClientId].ToString());
                c.StartTime   = Convert.ToDateTime(item[DataAccesHelper.callStartTime].ToString());
                c.EndTime     = Convert.ToDateTime(item[DataAccesHelper.callEndTime].ToString());
                c.Remarks     = item[DataAccesHelper.callRemarks].ToString();
                calls.Add(c);
            }

            return(calls);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            CallLog cl = (CallLog)obj;

            if ((object)cl == null)
            {
                return(false);
            }
            return((this.LogOperator == cl.LogOperator) && (this.LogClient == cl.LogClient) && (this.StartTime == cl.StartTime) && (this.EndTime == cl.EndTime) && (this.Remarks == cl.Remarks));
        }