Example #1
0
        /// <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);
        }
Example #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);
        }
Example #3
0
        internal List <dynamic> Read(ADO ado, string glrCode = null, string glrName = null)
        {
            GeoLayer_ADO      gAdo = new GeoLayer_ADO(ado);
            GeoLayer_DTO_Read dto  = new GeoLayer_DTO_Read()
            {
                GlrCode = glrCode, GlrName = glrName
            };

            return(gAdo.Read(dto));
        }
Example #4
0
        internal List <dynamic> Read(ADO ado, GeoLayer_DTO_Read dto = null)
        {
            GeoLayer_ADO gAdo = new GeoLayer_ADO(ado);

            if (dto == null)
            {
                dto = new GeoLayer_DTO_Read();
            }
            return(gAdo.Read(dto));
        }
Example #5
0
        /// <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);
        }