private void GroupSelect_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.iSelectedGroup      = (ClsTerrain)this.GroupSelect.SelectedItem;
     this.PictureBox3.Image   = (Image)Art.GetLand((int)this.iSelectedGroup.TileID);
     this.Box_TileID.Text     = StringType.FromInteger((int)this.iSelectedGroup.TileID);
     this.Box_TileID_Hex.Text = string.Format("{0:X4}", (object)this.iSelectedGroup.TileID);
 }
示例#2
0
        public void Save(XmlTextWriter xmlInfo)
        {
            xmlInfo.WriteStartElement("Statics");
            xmlInfo.WriteAttributeString("Description", this.m_Description);
            xmlInfo.WriteAttributeString("Freq", StringType.FromInteger(this.m_Freq));

            IEnumerator enumerator = this.InnerList.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    RandomStatic randomStatic = (RandomStatic)enumerator.Current;
                    randomStatic.Save(xmlInfo);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
            xmlInfo.WriteEndElement();
        }
        public void Save(string iFileName)
        {
            XmlTextWriter xmlTextWriter = new XmlTextWriter(iFileName, Encoding.UTF8);

            xmlTextWriter.Indentation = 2;
            xmlTextWriter.Formatting  = Formatting.Indented;
            xmlTextWriter.WriteStartDocument();
            xmlTextWriter.WriteStartElement("RandomStatics");
            xmlTextWriter.WriteAttributeString("Chance", StringType.FromInteger(this.m_Freq));

            IEnumerator enumerator = this.InnerList.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    RandomStaticCollection randomStaticCollection = (RandomStaticCollection)enumerator.Current;
                    randomStaticCollection.Save(xmlTextWriter);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
            xmlTextWriter.WriteEndElement();
            xmlTextWriter.WriteEndDocument();
            xmlTextWriter.Close();
        }
示例#4
0
        /// <summary>
        /// ToolSettings.cs \\ Save map-unrelated user settings
        /// </summary>
        public void saveUserSettings()
        {
            if (!Variables.allowSaveLastMap)
            {
                return;
            }

            StreamWriter streamWriter = new StreamWriter((Stream) new FileStream(Variables.strWorkingDir + "CoD4CompileTools.settings", FileMode.Create));

            streamWriter.WriteLine("tree," + Variables.strTreePath);
            streamWriter.WriteLine("mapname," + Variables.selectedMap_Name);
            streamWriter.WriteLine("developer," + StringType.FromBoolean((bool)chkDeveloper.IsChecked));
            streamWriter.WriteLine("developerscript," + StringType.FromBoolean((bool)chkDeveloperScript.IsChecked));
            streamWriter.WriteLine("cheats," + StringType.FromBoolean((bool)chkCheats.IsChecked));
            streamWriter.WriteLine("tab," + StringType.FromInteger(compileTab.SelectedIndex));
            streamWriter.WriteLine("chkCustomCommandLine," + StringType.FromBoolean((bool)chkCustomCommandLine.IsChecked));
            streamWriter.WriteLine("txtCustomCommandLine," + txtCustomCommandLine.Text);
            streamWriter.WriteLine("moveToUsermaps," + StringType.FromBoolean(Variables.copyToUsermaps));
            streamWriter.WriteLine("exeGameMp," + Variables.strGameMpName);
            streamWriter.WriteLine("exeRadiant," + Variables.strRadiantName);

            // GLSL->HLSL Syntax Converter
            streamWriter.WriteLine("sgen_width," + StringType.FromDouble(Variables.SyntaxConverterWidth));
            streamWriter.WriteLine("sgen_height," + StringType.FromDouble(Variables.SyntaxConverterHeight));
            streamWriter.WriteLine("sgen_font," + StringType.FromDouble(Variables.SyntaxConverterFontSize));
            streamWriter.WriteLine("sgen_optimise," + StringType.FromBoolean(Variables.SyntaxConverterOptimise));

            streamWriter.Close();
        }
示例#5
0
 public void Save(XmlTextWriter xmlInfo)
 {
     xmlInfo.WriteStartElement("StaticTile");
     xmlInfo.WriteAttributeString("TileID", StringType.FromInteger((int)this.m_TileID));
     xmlInfo.WriteAttributeString("AltIDMod", StringType.FromInteger((int)this.m_AltIDMod));
     xmlInfo.WriteEndElement();
 }
        private void Panel1_Paint(object sender, PaintEventArgs e)
        {
            Point point;

            System.Drawing.Font font       = new System.Drawing.Font("Arial", 10f, FontStyle.Regular);
            SolidBrush          solidBrush = new SolidBrush(Color.Black);
            Graphics            graphics   = e.Graphics;

            graphics.DrawString(StringType.FromInteger(this.TileID.Value), font, solidBrush, 51f, 5f);
            switch (this.ViewTiles)
            {
            case false:
            {
                if (Art.GetLand(this.TileID.Value) != null)
                {
                    Bitmap land = Art.GetLand(this.TileID.Value);
                    point = new Point(5, 5);
                    graphics.DrawImage(land, point);
                }
                break;
            }

            case true:
            {
                if (Art.GetStatic(this.TileID.Value) != null)
                {
                    Bitmap @static = Art.GetStatic(this.TileID.Value);
                    point = new Point(5, 5);
                    graphics.DrawImage(@static, point);
                }
                break;
            }
            }
            graphics = null;
        }
        public void Save(string iFileName)
        {
            XmlTextWriter xmlInfo = new XmlTextWriter(iFileName, Encoding.UTF8);

            xmlInfo.Indentation = 2;
            xmlInfo.Formatting  = Formatting.Indented;
            xmlInfo.WriteStartDocument();
            ((XmlWriter)xmlInfo).WriteStartElement("RandomStatics");
            xmlInfo.WriteAttributeString("Chance", StringType.FromInteger(this.m_Freq));
            try
            {
                foreach (RandomStaticCollection staticCollection in this.InnerList)
                {
                    staticCollection.Save(xmlInfo);
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
            xmlInfo.WriteEndElement();
            xmlInfo.WriteEndDocument();
            xmlInfo.Close();
        }
 public void Save(XmlTextWriter xmlInfo)
 {
     ((XmlWriter)xmlInfo).WriteStartElement("HoxCode");
     xmlInfo.WriteAttributeString("GroupID", StringType.FromInteger(this.m_GroupID));
     xmlInfo.WriteAttributeString("Alt", StringType.FromByte(this.m_AltitudeID));
     xmlInfo.WriteAttributeString("Terrain", StringType.FromByte(this.m_TerrainID));
     xmlInfo.WriteEndElement();
 }
示例#9
0
 public void Save(XmlTextWriter xmlInfo)
 {
     xmlInfo.WriteStartElement("Static");
     xmlInfo.WriteAttributeString("TileID", StringType.FromInteger((int)this.m_TileID));
     xmlInfo.WriteAttributeString("X", StringType.FromInteger((int)this.m_XMod));
     xmlInfo.WriteAttributeString("Y", StringType.FromInteger((int)this.m_YMod));
     xmlInfo.WriteAttributeString("Z", StringType.FromInteger((int)this.m_ZMod));
     xmlInfo.WriteAttributeString("Hue", StringType.FromInteger((int)this.m_HueMod));
     xmlInfo.WriteEndElement();
 }
示例#10
0
 public void Save(XmlTextWriter xmlInfo)
 {
     xmlInfo.WriteStartElement("Altitude");
     xmlInfo.WriteAttributeString("Key", StringType.FromInteger(this.m_Key));
     xmlInfo.WriteAttributeString("Type", this.m_Type);
     xmlInfo.WriteAttributeString("Altitude", StringType.FromInteger(this.m_Alt));
     xmlInfo.WriteAttributeString("R", StringType.FromByte(this.m_AltColor.R));
     xmlInfo.WriteAttributeString("G", StringType.FromByte(this.m_AltColor.G));
     xmlInfo.WriteAttributeString("B", StringType.FromByte(this.m_AltColor.B));
     xmlInfo.WriteEndElement();
 }
示例#11
0
 public void Save(XmlTextWriter xmlInfo)
 {
     ((XmlWriter)xmlInfo).WriteStartElement("Terrain");
     xmlInfo.WriteAttributeString("Name", this.m_Name);
     xmlInfo.WriteAttributeString("ID", StringType.FromInteger(this.m_GroupID));
     xmlInfo.WriteAttributeString("TileID", StringType.FromInteger((int)this.m_TileID));
     xmlInfo.WriteAttributeString("R", StringType.FromByte(this.m_Color.R));
     xmlInfo.WriteAttributeString("G", StringType.FromByte(this.m_Color.G));
     xmlInfo.WriteAttributeString("B", StringType.FromByte(this.m_Color.B));
     xmlInfo.WriteAttributeString("Base", StringType.FromByte(this.m_BaseAlt));
     xmlInfo.WriteAttributeString("Random", StringType.FromBoolean(this.m_RandAlt));
     xmlInfo.WriteEndElement();
 }
示例#12
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            BusquedaCliente busquedaCliente = new BusquedaCliente(true, true, false, false, "", (byte)0, false, false, false);

            if (((Form)busquedaCliente).ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (busquedaCliente.Cliente != 0)
            {
                ((TextBox)this.txtCliente).Text = StringType.FromInteger(busquedaCliente.Cliente);
                this.BuscarCliente();
                this.ActiveControl = (Control)this.dtpFInicio;
            }
            else
            {
                this.ActiveControl = (Control)this.txtCliente;
            }
        }
 private void BuscarCliente()
 {
     this.Cursor = Cursors.WaitCursor;
     Catalogo.cCliente cCliente = new Catalogo.cCliente(2, this._Cliente);
     if (((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader).Read())
     {
         this.lblNombre.Text  = StringType.FromObject(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[1]);
         this.lblCliente.Text = StringType.FromInteger(this._Cliente);
         ((ComboBase)this.cboZonaEconomica).PosicionaCombo((int)ShortType.FromObject(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[2]));
         ((ComboBase)this.cboRuta).PosicionaCombo((int)ShortType.FromObject(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[3]));
         ((TextBox)this.txtClientePortatil).Text = "";
         this.lblNombrePortatil.Text             = "";
         if (!Information.IsDBNull(RuntimeHelpers.GetObjectValue(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[4])))
         {
             ((TextBox)this.txtClientePortatil).Text = StringType.FromObject(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[4]);
             this.lblNombrePortatil.Text             = StringType.FromObject(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[5]);
         }
     }
     this.Cursor = Cursors.Default;
 }
示例#14
0
        protected internal float SSIncomeLimit(int intTaxYear)
        {
            //OleDbCommand command1 = new OleDbCommand();
            //command1.Connection = this.mcnnTaxTables;
            float single1 = 0f;
            //string text1 = ("SELECT TOP 1 [TAXYEAR],*  FROM TR6  Where [TR124] = 'SS' And [TaxYear]<=" + StringType.FromInteger(intTaxYear)) + "  Order by [TaxYear] DESC";
            string text1 = "[TR124] = 'SS' And [TaxYear]<=" + StringType.FromInteger(intTaxYear);

            //command1.CommandText = text1;
            //OleDbDataReader reader1 = command1.ExecuteReader();
            DataRow[] Rows = GlobalClass.TaxTable.Tables["TR6"].Select(text1);
            //while (reader1.Read())
            {
                //single1 = SingleType.FromObject(reader1["TR127"]);
                single1 = SingleType.FromObject(Rows[0]["TR127"]);
            }
            //reader1.Close();
            //command1.Dispose();
            return(single1);
        }
示例#15
0
        private void ListBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            RandomStatic selectedItem = (RandomStatic)this.ListBox2.SelectedItem;

            if (selectedItem != null)
            {
                RandomStatic randomStatic = selectedItem;
                this.VScrollBar1.Value = randomStatic.TileID;
                if (Art.GetStatic(randomStatic.TileID) != null)
                {
                    this.PictureBox1.Image            = Art.GetStatic(randomStatic.TileID);
                    this.PropertyGrid1.SelectedObject = TileData.ItemTable[randomStatic.TileID];
                }
                this.TileID.Text = StringType.FromInteger(randomStatic.TileID);
                this.Xaxis.Value = new decimal(randomStatic.X);
                this.Yaxis.Value = new decimal(randomStatic.Y);
                this.Zaxis.Value = new decimal(randomStatic.Z);
                this.HueID.Text  = StringType.FromInteger(randomStatic.Hue);
                randomStatic     = null;
            }
        }
 public void Save(XmlTextWriter xmlInfo)
 {
     ((XmlWriter)xmlInfo).WriteStartElement("Statics");
     xmlInfo.WriteAttributeString("Description", this.m_Description);
     xmlInfo.WriteAttributeString("Freq", StringType.FromInteger(this.m_Freq));
     try
     {
         foreach (RandomStatic randomStatic in this.InnerList)
         {
             randomStatic.Save(xmlInfo);
         }
     }
     finally
     {
         IEnumerator enumerator;
         if (enumerator is IDisposable)
         {
             ((IDisposable)enumerator).Dispose();
         }
     }
     xmlInfo.WriteEndElement();
 }
示例#17
0
        public static string IntToWord(string numb)
        {
            int    num1;
            string text2 = string.Empty;
            string text3 = string.Empty;
            bool   flag2 = false;

            if (Strings.InStr(numb, ".", CompareMethod.Binary) > 0)
            {
                text3 = Strings.Mid(numb, Strings.InStr(numb, ".", CompareMethod.Binary) + 1);
                numb  = Strings.Left(numb, Strings.InStr(numb, ".", CompareMethod.Binary) - 1);
                flag2 = true;
            }
Label_0043:
            if (StringType.StrCmp(numb, "0", false) == 0)
            {
                return(StringType.FromInteger(0));
            }
            if (StringType.StrCmp(Strings.Left(numb, 1), "0", false) == 0)
            {
                numb = Strings.Mid(numb, 2);
                goto Label_0043;
            }
            if (StringType.StrCmp(Strings.Left(numb, 1), "-", false) == 0)
            {
                numb  = Strings.Mid(numb, 2);
                text2 = "negative ";
            }
            if (Strings.Len(numb) == 1)
            {
                text2 = text2 + word3(numb);
            }
            else if (Strings.Len(numb) == 2)
            {
                text2 = text2 + word3(numb);
            }
            else if (Strings.Len(numb) == 3)
            {
                text2 = text2 + word3(numb);
            }
            else
            {
                int num2 = 0;
                if ((Strings.Len(numb) % 3) == 0)
                {
                    num2 = 3;
                }
                if ((Strings.Len(numb) % 3) == 1)
                {
                    num2 = 1;
                }
                if ((Strings.Len(numb) % 3) == 2)
                {
                    num2 = 2;
                }
                bool flag1 = true;
                int  num5  = Strings.Len(numb) - 3;
                for (num1 = 1; num1 <= num5; num1 += 3)
                {
                    string text5 = string.Empty;
                    if (flag1)
                    {
                        text5 = Strings.Mid(numb, 1, num2);
                        flag1 = false;
                    }
                    else
                    {
                        switch (num2)
                        {
                        case 1:
                            text5 = Strings.Mid(numb, num1 - 2, 3);
                            break;

                        case 2:
                            text5 = Strings.Mid(numb, num1 - 1, 3);
                            break;

                        case 3:
                            text5 = Strings.Mid(numb, num1, 3);
                            break;
                        }
                    }
                    int num3 = (Strings.Len(numb) - num1) + 1;
                    text2 = text2 + word2(text5, word4(num3));
                }
                text2 = text2 + word3(Strings.Right(numb, 3));
                text2 = Strings.RTrim(Strings.LTrim(text2));
            }
            if (flag2)
            {
                numb  = text3;
                text2 = text2 + " point ";
                int num4 = Strings.Len(numb);
                for (num1 = 1; num1 <= num4; num1++)
                {
                    text2 = text2 + Word(Strings.Mid(numb, num1, 1)) + " ";
                }
            }
            return(Strings.RTrim(Strings.LTrim(text2)));
        }
示例#18
0
        private void ParseQ1(string q1Result)
        {
            string q1Dados = q1Result; // modVariaveis.Q1Dados;

            NobreakInfo.TensaoEntrada               = !(StringType.StrCmp(Strings.Mid(q1Dados, 2, 3), "@@@", false) != 0 & StringType.StrCmp(Strings.Mid(q1Dados, 6, 1), "@", false) != 0) ? -1.0 : Conversion.Val(Strings.Mid(q1Dados, 2, 3)) + Conversion.Val(Strings.Mid(q1Dados, 6, 1)) / 10.0;
            NobreakInfo.TensaoEntrada2              = !(StringType.StrCmp(Strings.Mid(q1Dados, 8, 3), "@@@", false) != 0 & StringType.StrCmp(Strings.Mid(q1Dados, 12, 1), "@", false) != 0) ? -1.0 : Conversion.Val(Strings.Mid(q1Dados, 8, 3)) + Conversion.Val(Strings.Mid(q1Dados, 12, 1)) / 10.0;
            NobreakInfo.TensaoSaida                 = !(StringType.StrCmp(Strings.Mid(q1Dados, 14, 3), "@@@", false) != 0 & StringType.StrCmp(Strings.Mid(q1Dados, 18, 1), "@", false) != 0) ? -1.0 : Conversion.Val(Strings.Mid(q1Dados, 14, 3)) + Conversion.Val(Strings.Mid(q1Dados, 18, 1)) / 10.0;
            NobreakInfo.Carga                       = StringType.StrCmp(Strings.Mid(q1Dados, 20, 3), "@@@", false) == 0 ? -1L : checked ((long)Math.Round(Conversion.Val(Strings.Mid(q1Dados, 20, 3))));
            NobreakInfo.Frequencia                  = !(StringType.StrCmp(Strings.Mid(q1Dados, 24, 2), "@@", false) != 0 & StringType.StrCmp(Strings.Mid(StringType.FromInteger(27), 1), "@", false) != 0) ? -1.0 : Conversion.Val(Strings.Mid(q1Dados, 24, 2)) + Conversion.Val(Strings.Mid(q1Dados, 27, 1)) / 10.0;
            NobreakInfo.TensaoBateria               = !(StringType.StrCmp(Strings.Mid(q1Dados, 29, 2), "@@", false) != 0 & StringType.StrCmp(Strings.Mid(q1Dados, 32, 1), "@", false) != 0) ? -1.0 : Conversion.Val(Strings.Mid(q1Dados, 29, 2)) + Conversion.Val(Strings.Mid(q1Dados, 32, 1)) / 10.0;
            NobreakInfo.Temperatura                 = !(StringType.StrCmp(Strings.Mid(q1Dados, 34, 2), "@@", false) != 0 & StringType.StrCmp(Strings.Mid(q1Dados, 37, 1), "@", false) != 0) ? -1.0 : Conversion.Val(Strings.Mid(q1Dados, 34, 2)) + Conversion.Val(Strings.Mid(q1Dados, 37, 1)) / 10.0;
            NobreakInfo.StatusUtilityFail           = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 39, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusBateriaBaixa          = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 40, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusBypassBoostBuckActive = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 41, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusFalhaUps              = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 42, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusUpsStandBy            = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 43, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusTesteEmProgresso      = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 44, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusShutdownAtivo         = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 45, 1), "1", false) == 0, (object)true, (object)false));
            NobreakInfo.StatusBeepLigado            = BooleanType.FromObject(Interaction.IIf(StringType.StrCmp(Strings.Mid(q1Dados, 46, 1), "1", false) == 0, (object)true, (object)false));
        }
示例#19
0
        private void CrystalReportViewer1_ReportRefresh(object source, ViewerEventArgs e)
        {
            SqlDataAdapter adapter3;
            SqlCommand     command;
            DataRow        row;
            DataRow        row2;
            long           num;
            long           num2;
            SqlDataReader  reader;
            int            num3;
            SqlCommand     command3;
            SqlCommand     command5;
            string         str5;
            DataSet        dataSet = new DataSet();

            this.cmbSalir.Enabled = false;
            this.Informe.Close();
            string        connectionString = "data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096";
            SqlConnection connection       = new SqlConnection(connectionString);
            string        str9             = "data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096";
            SqlConnection connection2      = new SqlConnection(str9);

            connection2.Open();
            if ((Variables.gCodEstado == 1) | (Variables.gCodEstado == 4))
            {
                command5 = new SqlCommand("delete " + Variables.gTermi + "TmpOVPend", connection2);
                num3     = command5.ExecuteNonQuery();
                string str = "SELECT SL01001,SL01002,SL01060,SL01075,OR01001,OR01015,OR01016,OR01091,OR01018,OR01072,OR03005,OR03006,OR03007,OR03011,OR03012,sum(SC03003) as SC03003,sum(SC03004+SC03005) as StkComp,OR010100.OR01079 FROM dbo.SL010100,dbo.OR010100,dbo.OR030100,dbo.SC030100 where OR010100.OR01002<>6 and OR03011-OR03012<>0 ";
                command3 = new SqlCommand(((str + "and SC03002='01' and OR01050='01'") + " and OR01001='" + Variables.gNroOV + "'") + " and OR01001=OR03001 and OR01004=SL01001 and OR03005=SC03001" + " group by SL01001,SL01002,SL01060,SL01075,OR01001,OR01015,OR01016,OR01091,OR01018,OR01072,OR03005,OR03006,OR03007,OR03011,OR03012,OR010100.OR01079", connection);
                command3.CommandTimeout = 500;
                SqlDataAdapter adapter5 = new SqlDataAdapter();
                adapter5.SelectCommand = command3;
                connection.Open();
                adapter5.Fill(dataSet, "SC030100");
                long num10 = dataSet.Tables["SC030100"].Rows.Count - 1;
                for (num = 0L; num <= num10; num += 1L)
                {
                    row = dataSet.Tables["SC030100"].Rows[(int)num];
                    if (ObjectType.ObjTst(row["StkComp"], row["SC03003"], false) > 0)
                    {
                        command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT PC03043,PC03044,PC03016 FROM dbo.PC030100 where PC03005='", row["OR03005"]), "' and PC03043<PC03044 and PC03029=1 ")) + "and PC03035='01' order by PC03016", connection);
                        reader  = command.ExecuteReader();
                        if (reader.Read())
                        {
                            str5 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpOVPend (Cliente,NomCli,EntBloq,ExcLimCre,NroOV,FechaOV,FechaEnt,Reserva,RefCli,OCompra,CodProd,Desc1,Desc2,Cantidad,StockFisico,StockComp,FechaOC,CantOC,EntParc) values ('", row["SL01001"]), "','"), row["SL01002"]), "','"), row["SL01060"]), "','"), row["SL01075"]), "','"), row["OR01001"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01015"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "',"), row["OR01091"]), ",'"), row["OR01018"]), "','"), row["OR01072"]), "','"), row["OR03005"]), "','"), row["OR03006"]), "','"), row["OR03007"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ","), row["SC03003"]), ","), row["StkComp"]), ",'"), Strings.Format(RuntimeHelpers.GetObjectValue(reader["PC03016"]), "MM/dd/yyyy")), "',"), ObjectType.SubObj(reader["PC03044"], reader["PC03043"])), ",'"), row["OR01079"]), "')"));
                            reader.Close();
                            command5 = new SqlCommand(str5, connection2);
                        }
                        else
                        {
                            reader.Close();
                            command5 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpOVPend (Cliente,NomCli,EntBloq,ExcLimCre,NroOV,FechaOV,FechaEnt,Reserva,RefCli,OCompra,CodProd,Desc1,Desc2,Cantidad,StockFisico,StockComp,EntParc) values ('", row["SL01001"]), "','"), row["SL01002"]), "','"), row["SL01060"]), "','"), row["SL01075"]), "','"), row["OR01001"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01015"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "',"), row["OR01091"]), ",'"), row["OR01018"]), "','"), row["OR01072"]), "','"), row["OR03005"]), "','"), row["OR03006"]), "','"), row["OR03007"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ","), row["SC03003"]), ","), row["StkComp"]), ",'"), row["OR01079"]), "')")), connection2);
                        }
                    }
                    else if (ObjectType.ObjTst(row["StkComp"], row["SC03003"], false) == 0)
                    {
                        command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT OR010100.OR01016,OR030100.OR03011,OR030100.OR03012 FROM dbo.OR030100,OR010100 where OR03005='", row["OR03005"]), "' and OR03012<OR03011 and OR01002=6 and OR03001=OR01001 order by OR01016")), connection);
                        reader  = command.ExecuteReader();
                        if (reader.Read())
                        {
                            str5 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpOVPend (Cliente,NomCli,EntBloq,ExcLimCre,NroOV,FechaOV,FechaEnt,Reserva,RefCli,OCompra,CodProd,Desc1,Desc2,Cantidad,StockFisico,StockComp,FechaOC,CantOC,EntParc) values ('", row["SL01001"]), "','"), row["SL01002"]), "','"), row["SL01060"]), "','"), row["SL01075"]), "','"), row["OR01001"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01015"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "',"), row["OR01091"]), ",'"), row["OR01018"]), "','"), row["OR01072"]), "','"), row["OR03005"]), "','"), row["OR03006"]), "','"), row["OR03007"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ","), row["SC03003"]), ","), row["StkComp"]), ",'"), Strings.Format(RuntimeHelpers.GetObjectValue(reader["OR01016"]), "MM/dd/yyyy")), "',"), ObjectType.SubObj(reader["OR03011"], reader["OR03012"])), ",'"), row["OR01079"]), "')"));
                            reader.Close();
                            command5 = new SqlCommand(str5, connection2);
                        }
                        else
                        {
                            reader.Close();
                            command5 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpOVPend (Cliente,NomCli,EntBloq,ExcLimCre,NroOV,FechaOV,FechaEnt,Reserva,RefCli,OCompra,CodProd,Desc1,Desc2,Cantidad,StockFisico,StockComp,EntParc) values ('", row["SL01001"]), "','"), row["SL01002"]), "','"), row["SL01060"]), "','"), row["SL01075"]), "','"), row["OR01001"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01015"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "',"), row["OR01091"]), ",'"), row["OR01018"]), "','"), row["OR01072"]), "','"), row["OR03005"]), "','"), row["OR03006"]), "','"), row["OR03007"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ","), row["SC03003"]), ","), row["StkComp"]), ",'"), row["OR01079"]), "')")), connection2);
                        }
                    }
                    else
                    {
                        command5 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpOVPend (Cliente,NomCli,EntBloq,ExcLimCre,NroOV,FechaOV,FechaEnt,Reserva,RefCli,OCompra,CodProd,Desc1,Desc2,Cantidad,StockFisico,StockComp,EntParc) values ('", row["SL01001"]), "','"), row["SL01002"]), "','"), row["SL01060"]), "','"), row["SL01075"]), "','"), row["OR01001"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01015"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "',"), row["OR01091"]), ",'"), row["OR01018"]), "','"), row["OR01072"]), "','"), row["OR03005"]), "','"), row["OR03006"]), "','"), row["OR03007"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ","), row["SC03003"]), ","), row["StkComp"]), ",'"), row["OR01079"]), "')")), connection2);
                    }
                    try
                    {
                        num3 = command5.ExecuteNonQuery();
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, 0, null);
                        connection.Close();
                        connection2.Close();
                        this.Close();
                        ProjectData.ClearProjectError();
                    }
                }
                connection.Close();
                connection2.Close();
                try
                {
                    connectionString = "data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096";
                    connection       = new SqlConnection(connectionString);
                    connection.Open();
                    command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpOVPend as PC1TmpOVPend", connection);
                    command3.CommandTimeout     = 500;
                    this.AdapOR01               = new SqlDataAdapter();
                    this.AdapOR01.SelectCommand = command3;
                    dataSet.Clear();
                    this.AdapOR01.Fill(dataSet, "PC1TmpOVPend");
                    this.Informe.Load(Application.StartupPath + @"\ConsultaOVPendEnt.rpt");
                    this.Informe.SetDataSource(dataSet);
                    connection.Close();
                    FormulaFieldDefinition definition = this.Informe.get_DataDefinition().get_FormulaFields().get_Item("Titulo");
                    if (Variables.gCodEstado == 1)
                    {
                        definition.set_Text("'Consulta Ordenes de Venta - Estado Pendiente de Entrega'");
                    }
                    else
                    {
                        definition.set_Text("'Consulta Ordenes de Venta - Estado Preparado pend.imp.doc.exp.'");
                    }
                    this.CrystalReportViewer1.set_ReportSource(this.Informe);
                    this.CrystalReportViewer1.Refresh();
                    this.cmbSalir.Enabled = true;
                }
                catch (Exception exception7)
                {
                    ProjectData.SetProjectError(exception7);
                    Exception exception2 = exception7;
                    Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, 0, null);
                    ProjectData.ClearProjectError();
                }
            }
            if (Variables.gCodEstado == 2)
            {
                if (Variables.gCodEstado == 2)
                {
                    SqlCommand     command2;
                    SqlDataAdapter adapter2 = new SqlDataAdapter("select * from PrepPed where NroOV='" + Variables.gNroOV + "' and Expedicion='N' and NroRemito is null", str9);
                    adapter2.Fill(dataSet, "PrepPed");
                    if (dataSet.Tables["PrepPed"].Rows.Count != 0)
                    {
                        long num9 = dataSet.Tables["PrepPed"].Rows.Count - 1;
                        for (num = 0L; num <= num9; num += 1L)
                        {
                            row      = dataSet.Tables["PrepPed"].Rows[(int)num];
                            adapter3 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR19012 from OR190100 where OR19001='", row["NroOV"]), "' and OR19002='"), row["NroLinea"]), "' and OR19003='"), row["EstLinea"]), "' and OR19011='"), Strings.Format(RuntimeHelpers.GetObjectValue(row["FechaPrep"]), "MM/dd/yyyy")), "' and OR19012<>'' order by OR19012")), connectionString);
                            this.DS19.Clear();
                            adapter3.Fill(this.DS19, "OR190100");
                            if (this.DS19.Tables["OR190100"].Rows.Count != 0)
                            {
                                long num8 = this.DS19.Tables["OR190100"].Rows.Count - 1;
                                num2 = 0L;
                                while (num2 <= num8)
                                {
                                    row2    = this.DS19.Tables["OR190100"].Rows[(int)num2];
                                    command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("Select NroRemito from PrepPed where NroOV='", row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and EstLinea='"), row["EstLinea"]), "' and NroRemito='"), row2["OR19012"]), "'")), connection2);
                                    reader  = command.ExecuteReader();
                                    if (reader.Read())
                                    {
                                        reader.Close();
                                    }
                                    else
                                    {
                                        reader.Close();
                                        try
                                        {
                                            command2 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("update PrepPed set NroRemito='", row2["OR19012"]), "' where NroOV='"), row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and TipoLinea="), row["TipoLinea"]), " and EstLinea='"), row["EstLinea"]), "' and NroRemito is null")), connection2);
                                            num3     = command2.ExecuteNonQuery();
                                        }
                                        catch (Exception exception8)
                                        {
                                            ProjectData.SetProjectError(exception8);
                                            Exception exception3 = exception8;
                                            Interaction.MsgBox("Se ha producido el siguiente error:" + exception3.Message, 0, null);
                                            connection.Close();
                                            connection2.Close();
                                            this.Close();
                                            ProjectData.ClearProjectError();
                                        }
                                        goto Label_167A;
                                    }
                                    num2 += 1L;
                                }
                            }
                            else
                            {
                                adapter3 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR23012 from OR230100 where OR23001='", row["NroOV"]), "' and OR23002='"), row["NroLinea"]), "' and OR23003='"), row["EstLinea"]), "' and OR23011='"), Strings.Format(RuntimeHelpers.GetObjectValue(row["FechaPrep"]), "MM/dd/yyyy")), "' and OR23012<>'' order by OR23012")), connectionString);
                                this.DS20.Clear();
                                adapter3.Fill(this.DS20, "OR230100");
                                if (this.DS20.Tables["OR230100"].Rows.Count != 0)
                                {
                                    long num7 = this.DS20.Tables["OR230100"].Rows.Count - 1;
                                    num2 = 0L;
                                    while (num2 <= num7)
                                    {
                                        row2    = this.DS20.Tables["OR230100"].Rows[(int)num2];
                                        command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("Select NroRemito from PrepPed where NroOV='", row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and TipoLinea="), row["TipoLinea"]), " and EstLinea='"), row["EstLinea"]), "' and NroRemito='"), row2["OR23012"]), "'")), connection2);
                                        reader  = command.ExecuteReader();
                                        if (reader.Read())
                                        {
                                            reader.Close();
                                        }
                                        else
                                        {
                                            reader.Close();
                                            try
                                            {
                                                command2 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("update PrepPed set NroRemito='", row2["OR23012"]), "' where NroOV='"), row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and TipoLinea="), row["TipoLinea"]), " and EstLinea='"), row["EstLinea"]), "' and NroRemito is null")), connection2);
                                                num3     = command2.ExecuteNonQuery();
                                            }
                                            catch (Exception exception9)
                                            {
                                                ProjectData.SetProjectError(exception9);
                                                Exception exception4 = exception9;
                                                Interaction.MsgBox("Se ha producido el siguiente error:" + exception4.Message, 0, null);
                                                connection.Close();
                                                connection2.Close();
                                                this.Close();
                                                ProjectData.ClearProjectError();
                                            }
                                            goto Label_167A;
                                        }
                                        num2 += 1L;
                                    }
                                }
                            }
                            Label_167A :;
                        }
                    }
                    new SqlDataAdapter("select NroOV from PrepPed where NroOV='" + Variables.gNroOV + "' and Expedicion='N' and Producto=0 group by NroOV", str9).Fill(dataSet, "PrepPed");
                    if (dataSet.Tables["PrepPed"].Rows.Count != 0)
                    {
                        long num6 = dataSet.Tables["PrepPed"].Rows.Count - 1;
                        for (num = 0L; num <= num6; num += 1L)
                        {
                            row      = dataSet.Tables["PrepPed"].Rows[(int)num];
                            adapter3 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR01015,OR01072 from OR010100 where OR01001='", row["NroOV"]), "'")), connectionString);
                            this.DS19.Clear();
                            adapter3.Fill(this.DS19, "OR190100");
                            if (this.DS19.Tables["OR190100"].Rows.Count != 0)
                            {
                                row2 = this.DS19.Tables["OR190100"].Rows[0];
                                try
                                {
                                    command2 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("update PrepPed set OCompra='", row2["OR01072"]), "',FechaOV='"), Strings.Format(RuntimeHelpers.GetObjectValue(row2["OR01015"]), "MM/dd/yyyy")), "' where NroOV='"), row["NroOV"]), "'")), connection2);
                                    num3     = command2.ExecuteNonQuery();
                                }
                                catch (Exception exception10)
                                {
                                    ProjectData.SetProjectError(exception10);
                                    Exception exception5 = exception10;
                                    Interaction.MsgBox("Se ha producido el siguiente error:" + exception5.Message, 0, null);
                                    connection.Close();
                                    connection2.Close();
                                    this.Close();
                                    ProjectData.ClearProjectError();
                                }
                            }
                            else
                            {
                                adapter3 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR20015,OR20072 from OR200100 where OR20001='", row["NroOV"]), "'")), connectionString);
                                this.DS20.Clear();
                                adapter3.Fill(this.DS20, "OR230100");
                                if (this.DS20.Tables["OR230100"].Rows.Count != 0)
                                {
                                    row2 = this.DS20.Tables["OR230100"].Rows[0];
                                    try
                                    {
                                        num3 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("update PrepPed set OCompra='", row2["OR20072"]), "',FechaOV='"), Strings.Format(RuntimeHelpers.GetObjectValue(row2["OR20015"]), "MM/dd/yyyy")), "' where NroOV='"), row["NroOV"]), "'")), connection2).ExecuteNonQuery();
                                    }
                                    catch (Exception exception11)
                                    {
                                        ProjectData.SetProjectError(exception11);
                                        Exception exception6 = exception11;
                                        Interaction.MsgBox("Se ha producido el siguiente error:" + exception6.Message, 0, null);
                                        connection.Close();
                                        connection2.Close();
                                        this.Close();
                                        ProjectData.ClearProjectError();
                                    }
                                }
                            }
                        }
                    }
                }
                connection.Close();
                connection2.Close();
                this.AdapProdPend = new SqlDataAdapter("Select NroOV,NroLinea,EstLinea,Codigo,Desc1,Desc2,CantOrden,CantPrep,FechaPrep,NroRemito,Cliente,NomCli,OCompra,FechaOV from PrepPed where NroOV='" + Variables.gNroOV + "' and Expedicion='N' and Producto=0", connectionString);
                this.AdapProdPend.Fill(dataSet, "PrepPed");
                this.Informe.Load(Application.StartupPath + @"\ConsultaOVPendExp.rpt");
                this.Informe.SetDataSource(dataSet);
                this.CrystalReportViewer1.set_ReportSource(this.Informe);
                this.CrystalReportViewer1.Refresh();
                this.cmbSalir.Enabled = true;
            }
            if ((Variables.gCodEstado == 3) | (Variables.gCodEstado == 5))
            {
                command5 = new SqlCommand("delete " + Variables.gTermi + "TmpOVExped", connection2);
                num3     = command5.ExecuteNonQuery();
                reader   = new SqlCommand("Select Fecha from RecConfCliOV where NroOV='" + Variables.gNroOV + "'", connection2).ExecuteReader();
                if (reader.Read())
                {
                    Variables.gFechaRecConfCli = StringType.FromObject(reader["Fecha"]);
                    reader.Close();
                }
                else
                {
                    Variables.gFechaRecConfCli = "";
                    reader.Close();
                }
                adapter3 = new SqlDataAdapter("select OR19012,OR19034,OR01057,OR01058,OR01059,OR01060,OR03005,OR03006,OR03007,OR19030 from OR190100,OR010100,OR030100 where OR19001=OR01001 and OR19001=OR03001 AND OR19002=OR03002 AND OR19003=OR03003 and OR19001='" + Variables.gNroOV + "' and OR01002='" + StringType.FromInteger(Variables.gTipoOV) + "' and OR19011='" + Strings.Format(DateType.FromString(Variables.gFechaPrep), "MM/dd/yyyy") + "' and OR19012<>''", connectionString);
                this.DS19.Clear();
                adapter3.Fill(this.DS19, "OR190100");
                if (this.DS19.Tables["OR190100"].Rows.Count != 0)
                {
                    long num5 = this.DS19.Tables["OR190100"].Rows.Count - 1;
                    for (num2 = 0L; num2 <= num5; num2 += 1L)
                    {
                        row2 = this.DS19.Tables["OR190100"].Rows[(int)num2];
                        str5 = ((((((((("insert into " + Variables.gTermi + "TmpOVExped (NroOV,TipoOV,Cliente,NomCli,OCompra,CodMetEnt,DescMetEnt,LugarEnt,FechaOV,FechaEnt,FechaPrep,FechaExp,FechaRecConfCli,NroRemito,NroFactura,PesoNeto,PesoBruto,Volumen,Bultos,CodProd,Desc1,Desc2,Cantidad) values ('" + Variables.gNroOV + "'," + StringType.FromInteger(Variables.gTipoOV)) + ",'" + Variables.gCliente) + "','" + Variables.gNomCli) + "','" + Variables.gNroOC + "'," + Variables.gCodMetEnt) + ",'" + Variables.gDescMetEnt) + "','" + Variables.gLugarEnt) + "','" + Strings.Format(Variables.gFechaOV, "MM/dd/yyyy")) + "','" + Strings.Format(DateType.FromString(Variables.gFechaEntOV), "MM/dd/yyyy")) + "','" + Strings.Format(DateType.FromString(Variables.gFechaPrep), "MM/dd/yyyy")) + "','" + Strings.Format(DateType.FromString(Variables.gFechaExp), "MM/dd/yyyy") + "',";
                        if (StringType.StrCmp(Variables.gFechaRecConfCli, Strings.Space(0), false) != 0)
                        {
                            str5 = str5 + "'" + Strings.Format(DateType.FromString(Variables.gFechaRecConfCli), "MM/dd/yyyy") + "',";
                        }
                        else
                        {
                            str5 = str5 + "Null,";
                        }
                        str5 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(str5 + "'", row2["OR19012"]), "','"), row2["OR19034"]), "',"), row2["OR01057"]), ","), row2["OR01058"]), ","), row2["OR01059"]), ","), row2["OR01060"]), ",'"), row2["OR03005"]), "','"), row2["OR03006"]), "','"), row2["OR03007"]), "',"), row2["OR19030"]), ")"));
                        reader.Close();
                        command5 = new SqlCommand(str5, connection2);
                        num3     = command5.ExecuteNonQuery();
                    }
                }
                else
                {
                    adapter3 = new SqlDataAdapter("select OR23012,OR23034,OR20057,OR20058,OR20059,OR20060,OR21005,OR21006,OR21007,OR23030 from OR230100,OR200100,OR210100 where OR23001=OR20001 and OR23001=OR21001 AND OR23002=OR21002 AND OR23003=OR21003 and OR23001='" + Variables.gNroOV + "' and OR20002='" + StringType.FromInteger(Variables.gTipoOV) + "' and OR23011='" + Strings.Format(DateType.FromString(Variables.gFechaPrep), "MM/dd/yyyy") + "' and OR23012<>''", connectionString);
                    this.DS20.Clear();
                    adapter3.Fill(this.DS20, "OR200100");
                    if (this.DS20.Tables["OR200100"].Rows.Count != 0)
                    {
                        long num4 = this.DS20.Tables["OR200100"].Rows.Count - 1;
                        for (num2 = 0L; num2 <= num4; num2 += 1L)
                        {
                            row2 = this.DS20.Tables["OR200100"].Rows[(int)num2];
                            str5 = ((((((((("insert into " + Variables.gTermi + "TmpOVExped (NroOV,TipoOV,Cliente,NomCli,OCompra,CodMetEnt,DescMetEnt,LugarEnt,FechaOV,FechaEnt,FechaPrep,FechaExp,FechaRecConfCli,NroRemito,NroFactura,PesoNeto,PesoBruto,Volumen,Bultos,CodProd,Desc1,Desc2,Cantidad) values ('" + Variables.gNroOV + "'," + StringType.FromInteger(Variables.gTipoOV)) + ",'" + Variables.gCliente) + "','" + Variables.gNomCli) + "','" + Variables.gNroOC + "'," + Variables.gCodMetEnt) + ",'" + Variables.gDescMetEnt) + "','" + Variables.gLugarEnt) + "','" + Strings.Format(Variables.gFechaOV, "MM/dd/yyyy")) + "','" + Strings.Format(DateType.FromString(Variables.gFechaEntOV), "MM/dd/yyyy")) + "','" + Strings.Format(DateType.FromString(Variables.gFechaPrep), "MM/dd/yyyy")) + "','" + Strings.Format(DateType.FromString(Variables.gFechaExp), "MM/dd/yyyy") + "',";
                            if (StringType.StrCmp(Variables.gFechaRecConfCli, Strings.Space(0), false) != 0)
                            {
                                str5 = str5 + "'" + Strings.Format(DateType.FromString(Variables.gFechaRecConfCli), "MM/dd/yyyy") + "',";
                            }
                            else
                            {
                                str5 = str5 + "Null,";
                            }
                            str5 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(str5 + "'", row2["OR23012"]), "','"), row2["OR23034"]), "',"), row2["OR20057"]), ","), row2["OR20058"]), ","), row2["OR20059"]), ","), row2["OR20060"]), ",'"), row2["OR21005"]), "','"), row2["OR21006"]), "','"), row2["OR21007"]), "',"), row2["OR23030"]), ")"));
                            reader.Close();
                            num3 = new SqlCommand(str5, connection2).ExecuteNonQuery();
                        }
                    }
                }
                connection.Close();
                connection2.Close();
                command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpOVExped as PC1TmpOVExped", connection);
                command3.CommandTimeout     = 500;
                this.AdapOR01               = new SqlDataAdapter();
                this.AdapOR01.SelectCommand = command3;
                dataSet.Clear();
                this.AdapOR01.Fill(dataSet, "PC1TmpOVExped");
                this.Informe.Load(Application.StartupPath + @"\ConsultaOVExped.rpt");
                this.Informe.SetDataSource(dataSet);
                connection.Close();
                FormulaFieldDefinition definition2 = this.Informe.get_DataDefinition().get_FormulaFields().get_Item("Titulo");
                if (Variables.gCodEstado == 3)
                {
                    definition2.set_Text("'Consulta Ordenes de Venta - Estado Expedido'");
                }
                else
                {
                    definition2.set_Text("'Consulta Ordenes de Venta - Estado Recepci\x00f3n Conformada'");
                }
                this.CrystalReportViewer1.set_ReportSource(this.Informe);
                this.CrystalReportViewer1.Refresh();
                this.cmbSalir.Enabled = true;
            }
        }
示例#20
0
        private void Actualiza()
        {
            int           num;
            SqlConnection connection = new SqlConnection("data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=True;packet size=4096");

            connection.Open();
            SqlCommand command = new SqlCommand("insert into ImpEAPrePed (NroOV,TipoOV) values ('" + Variables.gNroOV + "'," + StringType.FromInteger(Variables.gTipoOV) + ")", connection);

            try
            {
                num = command.ExecuteNonQuery();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, MsgBoxStyle.OKOnly, null);
                connection.Close();
                ProjectData.ClearProjectError();
                return;

                ProjectData.ClearProjectError();
            }
            command = new SqlCommand("update " + Variables.gTermi + "TmpEAPrepPed set Impreso='S' where NroOV='" + Variables.gNroOV + "' and TipoOV=" + StringType.FromInteger(Variables.gTipoOV), connection);
            try
            {
                num = command.ExecuteNonQuery();
            }
            catch (Exception exception3)
            {
                ProjectData.SetProjectError(exception3);
                Exception exception2 = exception3;
                Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, MsgBoxStyle.OKOnly, null);
                connection.Close();
                ProjectData.ClearProjectError();
                return;

                ProjectData.ClearProjectError();
            }
            connection.Close();
        }
示例#21
0
 public void FromInteger(int value, string expected)
 {
     Assert.Equal(expected, StringType.FromInteger(value));
 }
示例#22
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     Variables.gCodCli = StringType.FromInteger(0);
     Variables.gNomCli = "";
     this.Close();
 }
 private void BuscarClientePortatil(int ClientePortatil)
 {
     this.Cursor = Cursors.WaitCursor;
     if (this._CargarCliente)
     {
         Catalogo.cCliente cCliente = new Catalogo.cCliente(6, ClientePortatil);
         if (((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader).Read())
         {
             int num1 = this.ExisteClientePortatil();
             if (num1 == 0)
             {
                 this.lblNombrePortatil.Text = StringType.FromObject(((SqlDataReader)((Catalogo.ConsultaBase)cCliente).drReader)[1]);
             }
             else
             {
                 this.lblNombrePortatil.Text             = "";
                 ((TextBox)this.txtClientePortatil).Text = "";
                 int num2 = (int)MessageBox.Show("El cliente portátil ya esta relacionado con el cliente estacionario: " + StringType.FromInteger(num1), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
         }
         else
         {
             this.lblNombrePortatil.Text             = "";
             ((TextBox)this.txtClientePortatil).Text = "";
         }
         this._CargarCliente = false;
     }
     this.Cursor = Cursors.Default;
 }