Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="clientid"></param>
 public Lookup(string clientid)
 {
     c           = new ClientServer(clientid);
     ClientID    = clientid;
     LookupID    = "";
     Name        = "";
     LookupItems = new List <LookupItem>();
     dataLookup  = new Data.Component.LookUp(c.GetServer().Connection());
 }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="clientid"></param>
 /// <param name="lookupid"></param>
 public Lookup(string clientid, string lookupid)
 {
     ClientID    = clientid;
     c           = new ClientServer(clientid);
     LookupID    = lookupid;
     LookupItems = new List <LookupItem>();
     dataLookup  = new Data.Component.LookUp(c.GetServer().Connection());
     Load();
 }
Beispiel #3
0
        public bool Save(string conn)
        {
            var dataLookup = new Data.Component.LookUp(conn);

            if (dataLookup.Save(this.ClientID,
                                this.Label, this.ShortLabel,
                                this.Description,
                                this.ParentID,
                                this.LookUpID,
                                this.Order,
                                this.IsActive, this.Value) != "")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="clientid"></param>
        /// <returns></returns>
        public static List <Lookup> GetLookUps(string clientid, string lookupIds = "")
        {
            ClientServer  c          = new ClientServer(clientid);
            var           dataLookup = new Data.Component.LookUp(c.GetServer().Connection());
            DataTable     dt         = dataLookup.GetLookUpList(clientid, lookupIds);
            List <Lookup> lup        = new List <Lookup>();

            foreach (DataRow dr in dt.Rows)
            {
                Lookup l = new Lookup(clientid);
                l.Name        = dr["Name"] == null ? "" : dr["Name"].ToString();
                l.IsCore      = DBNull.Value.Equals(dr["IsCore"]) == true ? false : Convert.ToBoolean(dr["IsCore"]);
                l.Description = DBNull.Value.Equals(dr["Description"]) == true ? "" : dr["Description"].ToString();
                l.CreatedOn   = DBNull.Value.Equals(dr["CreatedOn"]) == true ? DateTime.Now : Convert.ToDateTime(dr["LastUPD"]);
                l.LastUPD     = DBNull.Value.Equals(dr["LastUPD"]) == true ? DateTime.Now : Convert.ToDateTime(dr["LastUPD"]);
                l.LookupID    = dr["LookUpID"] == null? "": dr["LookUpID"].ToString();
                //     l.Value = DBNull.Value.Equals(dr["Value"]) == true ? "" : (string)(dr["Value"]);
                lup.Add(l);
            }
            return(lup);
        }
Beispiel #5
0
        public bool ChangeOrder(string conn, int order)
        {
            var dataLookup = new Data.Component.LookUp(conn);

            return(dataLookup.UpdateOrder(this.ClientID, this.LookUpItemID, order));
        }
Beispiel #6
0
        public bool ChangeActive(string conn, bool isActive)
        {
            var dataLookup = new Data.Component.LookUp(conn);

            return(dataLookup.UpateActive(this.ClientID, this.LookUpItemID, isActive));
        }
Beispiel #7
0
        public bool Remove(string conn)
        {
            var dataLookup = new Data.Component.LookUp(conn);

            return(dataLookup.RemoveLookupItems(this.ClientID, this.LookUpItemID, this.LookUpID));
        }