///---------------------------------------------------------------------------------
        protected void view_Save(object sender, EventArgs e)
        {
            bool isNew = false;
            if (agentId == 0)
            {
                isNew = true;

                agentId = ProxyHelper.GetUserAgentId(this.UserId);
                sosProfile.AgentId = agentId;

                AgentPool agentPool = (AgentPool)Application["AgentPool"];
                agentPool.RegisterAgent(agentId);
            }


            if (agentId != 0)
            {
                UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt = BllProxyAgent.SelectAgent(agentId);
                if (dt.Rows.Count != 0)
                {
                    string firstName = dt[0].first_name;
                    string lastName = dt[0].last_name;
                    string email = dt[0].email;
                    BllProxyUserHelper.UpdateUserDetails(this.UserId, firstName, lastName, email);

                }
            }

            if(isNew)
                this.Refresh();

        }
Пример #2
0
        private static UCENTRIK.DATASETS.AgentDS.AgentDSDataTable processData(UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt)
        {
            foreach (UCENTRIK.DATASETS.AgentDS.AgentDSRow row in dt.Rows)
            {
                row.full_name = Helper.GetFullName(row.first_name, row.last_name);
            }

            return(dt);
        }
        public static Int32 GetUserAgentId(Int32 userId)
        {
            Int32 id = 0;

            UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt = BllProxyAgent.GetAgentByUser(userId);

            if (dt.Rows.Count > 0)
            {
                id = dt[0].agent_id;
            }

            return(id);
        }
        protected void setAgent(Int32 _agentId)
        {
            this.clearMessage();

            UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt = BllProxyAgent.SelectAgent(_agentId);

            if (dt.Rows.Count > 0)
            {
                lblAgentName.Text = dt[0].full_name;

                setAgentLanguages(_agentId);
            }
            else
            {
                lblAgentName.Text = "ERROR: " + _agentId.ToString();
            }
        }
Пример #5
0
 public static UCENTRIK.DATASETS.AgentDS.AgentDSDataTable GetAgentByUser(Int32 userId)
 {
     UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt = DalAgent.GetAgentByUser(userId);
     return(processData(dt));
 }
Пример #6
0
 public static UCENTRIK.DATASETS.AgentDS.AgentDSDataTable SelectAgent(Int32 agentId)
 {
     UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt = DalAgent.SelectAgent(agentId);
     return(processData(dt));
 }
Пример #7
0
 public static UCENTRIK.DATASETS.AgentDS.AgentDSDataTable GetAllAgents()
 {
     UCENTRIK.DATASETS.AgentDS.AgentDSDataTable dt = DalAgent.GetAllAgents();
     return(processData(dt));
 }