Пример #1
0
        public string UpdateZone(string strDivision, string strIdZone, string strCveZone, string strZone, string strObservations)
        {
            Boolean bRespost = false;
            string  sResp    = "";


            if (!ExistZonaCveID(strDivision, strIdZone, strCveZone, strZone))
            {
                Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
                clsCatZone.strDivision    = strDivision;
                clsCatZone.intIdZone      = int.Parse(strIdZone);
                clsCatZone.strCveZone     = strCveZone;
                clsCatZone.strZone        = strZone;
                clsCatZone.strObservation = strObservations;
                clsCatZone.intActivo      = 1;
                bRespost = clsCatZone.UpdateZone();

                if (bRespost)
                {
                    sResp = "1-La información se guardo exitosamente!";
                }
                else
                {
                    sResp = "0-Ocurrio un error al intentar guardar la información de la zona!";
                }
            }
            else
            {
                sResp = "0-La descripción o clave ya existen para otra zona!";
            }
            return(sResp);
        }
Пример #2
0
        public string NewZone(string strdivision, string strNewCveZone, string strNewZone, string strNewObservations)
        {
            Boolean bRespost = false;
            string  sResp    = "";

            if (!ExistZonaCve(strdivision, strNewCveZone, strNewZone))
            {
                Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
                clsCatZone.strDivision    = strdivision;
                clsCatZone.strZone        = strNewZone;
                clsCatZone.strCveZone     = strNewCveZone;
                clsCatZone.strObservation = strNewObservations;
                bRespost = clsCatZone.NewZone();

                if (bRespost)
                {
                    sResp = "1-La información se guardo exitosamente!";
                }
                else
                {
                    sResp = "0-Ocurrio un error al intentar guardar la zona!";
                }
            }
            else
            {
                sResp = "0-El código o descripción ya existe para otra zona!";
            }
            //return bRespost;
            return(sResp);
        }
Пример #3
0
        public StringBuilder ReturnHTMLDivision(DataTable dtG)
        {
            StringBuilder strDiv = new StringBuilder();

            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
            clsCatZone.dtZone = dtG;
            strDiv            = clsCatZone.CreateTableHTML();
            return(strDiv);
        }
Пример #4
0
        /// <summary>
        /// Return all data from table Zone
        /// </summary>
        /// <returns></returns>
        public DataTable dtGetAllZone()
        {
            DataTable dtAllZo;

            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
            clsCatZone.intActivo = 1;
            dtAllZo = clsCatZone.GetAllZone();

            return(dtAllZo);
        }
Пример #5
0
        public Boolean DeleteZone(string strDivision, string strZone)
        {
            Boolean bRespost = false;

            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
            clsCatZone.strDivision = strDivision;
            clsCatZone.strZone     = strZone;
            clsCatZone.intActivo   = 0;
            bRespost = clsCatZone.DeleteZone();
            return(bRespost);
        }
Пример #6
0
        private DataTable dtGetZoneByDivisionAndZone(string strDivision, string strCveZone, string strZone) //
        {
            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
            DataTable dtZBDZ;

            clsCatZone.intActivo   = 1;
            clsCatZone.strDivision = strDivision;
            clsCatZone.strCveZone  = strCveZone;
            clsCatZone.strZone     = strZone;
            dtZBDZ = clsCatZone.GetAllZoneByDivisionAndZone();
            return(dtZBDZ);
        }
Пример #7
0
        public DataTable dtGetZoneByDivision_Dll(string strDivision)
        {
            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
            DataTable dtZBD;

            clsCatZone.intActivo   = 1;
            clsCatZone.strDivision = strDivision;

            dtZBD = clsCatZone.GetAllZoneByDivision_DDL();

            return(dtZBD);
        }
Пример #8
0
        public Boolean NewZoneByDiv(string strdivision, string strNewCveZone, string strNewZone, string strNewObservations)
        {
            Boolean bRespost = false;

            if (!string.IsNullOrEmpty(strNewZone))
            {
                Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
                clsCatZone.strDivision    = strdivision;
                clsCatZone.strZone        = strNewZone;
                clsCatZone.strCveZone     = strNewCveZone;
                clsCatZone.strObservation = strNewObservations;
                bRespost = clsCatZone.NewZoneByDiv();
            }
            return(bRespost);
        }
Пример #9
0
        /// <summary>
        /// Function to return all datat from table Zone filtering by division
        /// </summary>
        /// <param name="strDivision"></param>
        /// <returns></returns>
        public DataTable dtGetZoneByDivision(string strDivision)
        {
            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();
            DataTable dtZBD;

            clsCatZone.intActivo   = 1;
            clsCatZone.strDivision = strDivision;
            if (strDivision == "-- TODOS --")
            {
                dtZBD = clsCatZone.GetAllZone();
            }
            else
            {
                dtZBD = clsCatZone.GetAllZoneByDivision();
            }
            return(dtZBD);
        }
Пример #10
0
        /// <summary>
        /// Function to validate the filters and return the data according it
        /// </summary>
        /// <param name="strDivision"></param>
        /// <param name="strZone"></param>
        /// <returns></returns>
        public DataTable ValidateFilters(string strDivision, string strZone)
        {
            Class.Catalogos.CatZone clsCatZone = new Class.Catalogos.CatZone();

            if (string.IsNullOrEmpty(strDivision) && string.IsNullOrEmpty(strZone) || strDivision == "-- TODOS --")
            {
                //Return all data
                dtResponseFilters = dtGetAllZone();
            }
            else if (!string.IsNullOrEmpty(strDivision) && string.IsNullOrEmpty(strZone) || strZone == "-- TODOS --")
            {
                dtResponseFilters = dtGetZoneByDivision(strDivision);
            }
            else if (!string.IsNullOrEmpty(strDivision) && !string.IsNullOrEmpty(strZone))
            {
                dtResponseFilters = dtGetZoneByDivisionAndZone(strDivision, "", strZone);
            }
            return(dtResponseFilters);
        }