/// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            GeoLayer_ADO gAdo = new GeoLayer_ADO(Ado);

            GeoLayer_BSO bso = new GeoLayer_BSO();

            var read = bso.Read(Ado, DTO.GlrCode);

            if (read?.Count == 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }

            //We can't delete a record that is already associated with a map
            if (read[0].GmpCount > 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }

            if (gAdo.Delete(DTO, SamAccountName) == 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }
            Response.data = JSONRPC.success;
            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            GeoLayer_ADO gAdo = new GeoLayer_ADO(Ado);

            GeoLayer_BSO bso = new GeoLayer_BSO();



            //We can't have duplicate GlrName
            if (bso.Read(Ado, null, DTO.GlrName).Count > 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }

            int records = gAdo.Create(DTO, SamAccountName);

            if (records == 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }

            Response.data = JSONRPC.success;
            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            GeoLayer_BSO bso  = new GeoLayer_BSO();
            var          list = bso.Read(Ado, DTO);

            Response.data = list;

            return(true);
        }
        /// <summary>
        /// Execute
        /// </summary>
        /// <returns></returns>
        protected override bool Execute()
        {
            GeoLayer_ADO gAdo = new GeoLayer_ADO(Ado);

            GeoLayer_BSO bso = new GeoLayer_BSO();

            //Check if the GeoLayer exists
            if (bso.Read(Ado, DTO.GlrCode).Count == 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }

            if (gAdo.Update(DTO, SamAccountName) == 0)
            {
                Response.error = Label.Get("error.create");
                return(false);
            }
            Response.data = JSONRPC.success;
            return(true);
        }