Beispiel #1
0
        public IEnumerable <ChatLine> GetChatLineByUser(string id)
        {
            var account = _Account.GetById(id);

            if (account.IsMain == true)
            {
                return(_ChatLine.GetAll().Where(x => x.ID_Customer == account.ID_Customer));
            }
            else
            {
                IEnumerable <SqlParameter> Params = new List <SqlParameter> {
                    new SqlParameter {
                        ParameterName = "@idcus", Value = account.ID_Customer
                    },
                    new SqlParameter {
                        ParameterName = "@idagent", Value = id
                    }
                };

                var x = _StoreProduce.Run <ChatLine>(new StoreProduceModel {
                    NameProduce = "SelectChatLine", Params = Params
                });
                return(x);
            }
        }
Beispiel #2
0
 public string GetRoles(string ID)
 {
     return(_StoreProduce.Run <string>(new StoreProduceModel {
         NameProduce = "GetRolesByID", Params = new List <SqlParameter> {
             new SqlParameter {
                 ParameterName = "@ID", Value = ID
             }
         }
     }).FirstOrDefault());
 }