示例#1
0
        protected void Generar_CODIGO_CONTRATO()
        {
            LblNumero.Text = DDLCamp.SelectedItem.Text[0].ToString();
            for (int i = 1; i < DDLCamp.SelectedItem.Text.Count(); i++)
            {
                if (DDLCamp.SelectedItem.Text[i].ToString() == " ")
                {
                    LblNumero.Text = LblNumero.Text + DDLCamp.SelectedItem.Text[i + 3].ToString() + DDLCamp.SelectedItem.Text[i + 4].ToString();
                }
                if (DDLCamp.SelectedItem.Text[i].ToString() == "-")
                {
                    LblNumero.Text = LblNumero.Text + "/" + DDLCamp.SelectedItem.Text[i + 3].ToString() + DDLCamp.SelectedItem.Text[i + 4].ToString();
                }
            }
            /************* CONTRUCCION DE CODIFICACION **************/
            DB_Codificacion cont = new DB_Codificacion();
            int             num  = cont.DB_Codigo_INFORME();
            string          dep  = "";

            switch (DDLRegional.SelectedItem.Text)
            {
            case "SANTA CRUZ":
                dep = "SC";
                break;

            case "BENI":
                dep = "BN";
                break;

            case "COCHABAMBA":
                dep = "CB";
                break;

            case "TARIJA":
                dep = "TJ";
                break;

            case "POTOSI":
                dep = "PT";
                break;

            case "CHUQUISACA":
                dep = "CH";
                break;

            case "ORURO":
                dep = "OR";
                break;

            case "LA PAZ":
                dep = "LP";
                break;
            }
            LblNumero.Text = LblNumero.Text + DDLPrograma.SelectedItem.Text[0].ToString() + "-" + num.ToString() + " " + dep;
        }
        protected void Generar_CODIGO_CONTRATO()
        {
            switch (DDLTipoInf.SelectedValue)
            {
            case "1":
                LblNumero.Text = ((Label)contEncabezado11.FindControl("LblCampanhia")).Text[0].ToString();
                for (int i = 1; i < ((Label)contEncabezado11.FindControl("LblCampanhia")).Text.Count(); i++)
                {
                    if (((Label)contEncabezado11.FindControl("LblCampanhia")).Text[i].ToString() == " ")
                    {
                        LblNumero.Text = LblNumero.Text + ((Label)contEncabezado11.FindControl("LblCampanhia")).Text[i + 3].ToString() + ((Label)contEncabezado11.FindControl("LblCampanhia")).Text[i + 4].ToString();
                    }
                    if (((Label)contEncabezado11.FindControl("LblCampanhia")).Text[i].ToString() == "-")
                    {
                        LblNumero.Text = LblNumero.Text + "/" + ((Label)contEncabezado11.FindControl("LblCampanhia")).Text[i + 3].ToString() + ((Label)contEncabezado11.FindControl("LblCampanhia")).Text[i + 4].ToString();
                    }
                }
                /************* CONTRUCCION DE CODIFICACION **************/
                DB_Codificacion cont = new DB_Codificacion();
                int             num  = cont.DB_Codigo_INFORME();
                string          dep  = "";
                switch (((Label)contEncabezado11.FindControl("LblRegional")).Text)
                {
                case "SANTA CRUZ":
                    dep = "SC";
                    break;

                case "BENI":
                    dep = "BN";
                    break;

                case "COCHABAMBA":
                    dep = "CB";
                    break;

                case "TARIJA":
                    dep = "TJ";
                    break;

                case "POTOSI":
                    dep = "PT";
                    break;

                case "CHUQUISACA":
                    dep = "CH";
                    break;

                case "ORURO":
                    dep = "OR";
                    break;

                case "LA PAZ":
                    dep = "LP";
                    break;
                }
                LblNumero.Text = LblNumero.Text + ((Label)contEncabezado11.FindControl("LblPrograma")).Text[0].ToString() + "-" + num.ToString() + " " + dep;
                break;

            case "2":
                break;
            }
        }