예제 #1
0
        public List <VD_AREAS> getListAreas()
        {
            List <VD_AREAS> lstAreas = new List <VD_AREAS>();

            _DBAccess = new DBController();
            DataSet ds = new DataSet();

            ds = _DBAccess.GetEntityList("WEB_VD_GETLIST_AREAS");
            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        lstAreas.Add(new VD_AREAS
                        {
                            ID             = Convert.ToInt64(row["ID"]),
                            Name           = Convert.ToString(row["Name"]),
                            Descriptions   = Convert.ToString(row["Descriptions"]),
                            Quantity       = Convert.ToInt32(row["Quantity"]),
                            PersonRegister = _DBAccess.countPersonOnAreas("WEB_VD_COUNT_PERSON_AREAS", Convert.ToInt64(row["ID"])),
                            IsActive       = Convert.ToBoolean(row["IsActive"]),
                            zIndex         = Convert.ToInt32(row["zIndex"])
                        });
                    }
                }
            }

            return(lstAreas);
        }
예제 #2
0
        public VD_AREAS getDetailsAreas(string AreasID)
        {
            VD_AREAS areas = new VD_AREAS();

            _DBAccess = new DBController();
            DataSet ds = new DataSet();

            ds = _DBAccess.GetEntityDetails("WEB_VD_GET_DETAILS_AREAS", AreasID);
            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    areas.ID             = Convert.ToInt64(ds.Tables[0].Rows[0]["ID"]);
                    areas.Name           = Convert.ToString(ds.Tables[0].Rows[0]["Name"]);
                    areas.Descriptions   = Convert.ToString(ds.Tables[0].Rows[0]["Descriptions"]);
                    areas.Quantity       = Convert.ToInt32(ds.Tables[0].Rows[0]["Quantity"]);
                    areas.PersonRegister = _DBAccess.countPersonOnAreas("WEB_VD_COUNT_PERSON_AREAS", Convert.ToInt64(ds.Tables[0].Rows[0]["ID"]));
                    areas.IsActive       = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsActive"]);
                    areas.zIndex         = Convert.ToInt32(ds.Tables[0].Rows[0]["zIndex"]);
                }
            }

            return(areas);
        }