Esempio n. 1
0
        public ClientsIndustry GetClientIndustryByID(string clientIndustryID, string agentid, string clientid)
        {
            if (string.IsNullOrEmpty(clientIndustryID))
            {
                return null;
            }
            var list = GetClientIndustry(agentid, clientid);
            if (list.Where(m => m.ClientIndustryID == clientIndustryID).Count() > 0)
            {
                return list.Where(m => m.ClientIndustryID == clientIndustryID).FirstOrDefault();
            }

            ClientsIndustry model = new ClientsIndustry();
            DataTable dt = SystemDAL.BaseProvider.GetClientIndustryByID(clientIndustryID);
            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid);
                list.Add(model);
            }
            return model;
        }
Esempio n. 2
0
        public List<ClientsIndustry> GetClientIndustry(string agentid, string clientid)
        {
            if (ClientIndustryList.ContainsKey(clientid))
            {
                return ClientIndustryList[clientid];
            }

            List<ClientsIndustry> list = new List<ClientsIndustry>();
            DataTable dt = SystemDAL.BaseProvider.GetClientIndustry(clientid);
            foreach (DataRow dr in dt.Rows)
            {
                ClientsIndustry model = new ClientsIndustry();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid);
                list.Add(model);
            }
            ClientIndustryList.Add(clientid, list);
            return list;

        }