public frmRepOCPend1() { string str; base.Closed += new EventHandler(this.frmRepOCPend1_Closed); base.Load += new EventHandler(this.frmRepOCPend1_Load); this.DS = new DataSet(); this.DS1 = new DataSet(); this.DSTmp = new DataSet(); this.Informe = new ReportDocument(); this.InitializeComponent(); bool flag = false; string selectConnectionString = "data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096"; if (StringType.StrCmp(Variables.gDesde, Strings.Space(0), false) == 0) { str = "Select PC03001,PC03002,PC03005,PC03006,PC03007,PC03010,PC03011,PC03016 from PC030100 where PC03010-PC03011<>0 and PC03010<>0"; if (StringType.StrCmp(Variables.gAlmacen1, Strings.Space(0), false) != 0) { str = str + " and PC03035='" + Strings.Mid(Variables.gAlmacen1, 1, 2) + "'"; if (StringType.StrCmp(Variables.gAlmacen2, Strings.Space(0), false) != 0) { str = str + " and PC03035='" + Strings.Mid(Variables.gAlmacen2, 1, 2) + "'"; } } else if (StringType.StrCmp(Variables.gAlmacen2, Strings.Space(0), false) != 0) { str = str + " and PC03035='" + Strings.Mid(Variables.gAlmacen2, 1, 2) + "'"; } if (StringType.StrCmp(Variables.gCodProd, "", false) != 0) { str = str + " and PC03005='" + Variables.gCodProd + "'"; } str = str + " order by PC03001,PC03016,PC03002"; } else { str = "Select PC03001,PC03002,PC03005,PC03006,PC03007,PC03010,PC03011,PC03016 from PC030100 where PC03010-PC03011<>0 and PC03010<>0 and PC03016>='" + Strings.Format(DateType.FromString(Variables.gDesde), "MM/dd/yyyy") + "' and PC03016<='" + Strings.Format(DateType.FromString(Variables.gHasta), "MM/dd/yyyy") + "'"; if (StringType.StrCmp(Variables.gAlmacen1, Strings.Space(0), false) != 0) { if (StringType.StrCmp(Variables.gAlmacen2, Strings.Space(0), false) != 0) { str = (str + " and (PC03035='" + Strings.Mid(Variables.gAlmacen1, 1, 2) + "'") + " or PC03035='" + Strings.Mid(Variables.gAlmacen2, 1, 2) + "')"; } else { str = str + " and PC03035='" + Strings.Mid(Variables.gAlmacen1, 1, 2) + "'"; } } else if (StringType.StrCmp(Variables.gAlmacen2, Strings.Space(0), false) != 0) { str = str + " and PC03035='" + Strings.Mid(Variables.gAlmacen2, 1, 2) + "'"; } if (StringType.StrCmp(Variables.gCodProd, "", false) != 0) { str = str + " and PC03005='" + Variables.gCodProd + "'"; } str = str + " order by PC03001,PC03016,PC03002"; } this.DS.Clear(); this.AdapOCPend = new SqlDataAdapter(str, selectConnectionString); this.AdapOCPend.Fill(this.DS, "PC030100"); string str3 = "data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=edibar;persist security info=False;packet size=4096"; str = "Select distinct detdes.colnb,detdes.ordnb,detdes.lignb,detdes.datexp,detinv.invno,detinv.stamp,detinv.desqty,hdrdes.trind from detdes left outer join detinv on detdes.ordnb=detinv.purno and detdes.lignb=detinv.purlin inner join hdrdes on detdes.packlist=hdrdes.packlist where detdes.cntqty=0"; if (StringType.StrCmp(Variables.gCodProd, "", false) != 0) { str = str + " and detdes.itnbr='" + Variables.gCodProd + "'"; } this.AdapDetDes = new SqlDataAdapter(str, str3); this.DS1.Clear(); this.AdapDetDes.Fill(this.DS1, "detdes"); string connectionString = "data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"; SqlConnection connection = new SqlConnection(connectionString); connection.Open(); flag = true; SqlCommand command = new SqlCommand("delete " + Variables.gTermi + "TmpDetDes", connection); int num2 = command.ExecuteNonQuery(); int num3 = this.DS1.Tables["detdes"].Rows.Count - 1; for (int i = 0; i <= num3; i++) { DataRow row = this.DS1.Tables["detdes"].Rows[i]; str = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj((("insert into " + Variables.gTermi + "TmpDetDes (NroOC,NroLinea,NroBulto,PackList,FechaPL,NroFC,FechaFC,EnTransito) values ('" + Strings.Format(RuntimeHelpers.GetObjectValue(row["ordnb"]), "0000000000")) + "','" + Strings.Format(RuntimeHelpers.GetObjectValue(row["lignb"]), "000000")) + "','", row["colnb"]), "','"), row["trind"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["datexp"]), "MM/dd/yyyy")), "',")); if (Information.IsDBNull(RuntimeHelpers.GetObjectValue(row["invno"]))) { str = str + "'',"; } else { str = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str + "'", row["invno"]), "',")); } if (Information.IsDBNull(RuntimeHelpers.GetObjectValue(row["stamp"]))) { str = str + "'',"; } else { str = str + "'" + Strings.Format(DateType.FromString(Strings.Mid(StringType.FromObject(row["stamp"]), 1, 10)), "MM/dd/yyyy") + "',"; } if (Information.IsDBNull(RuntimeHelpers.GetObjectValue(row["desqty"]))) { str = str + "0)"; } else { str = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str, row["desqty"]), ")")); } command = new SqlCommand(str, connection); try { command.ExecuteNonQuery(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, MsgBoxStyle.OKOnly, null); if (flag) { connection.Close(); flag = false; } ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } str = "select * from " + Variables.gTermi + "TmpDetDes as PC1TmpDetDes"; this.AdapTmp = new SqlDataAdapter(str, connectionString); this.AdapTmp.Fill(this.DS, "PC1TmpDetDes"); if (Variables.gOrdenList == 1) { this.Informe.Load(Application.StartupPath + @"\repocpend.rpt"); } else { this.Informe.Load(Application.StartupPath + @"\repocpend1.rpt"); } this.Informe.SetDataSource(this.DS); connection.Close(); flag = false; FormulaFieldDefinitions formulaFields = this.Informe.DataDefinition.FormulaFields; FormulaFieldDefinition definition = formulaFields["desde"]; if (StringType.StrCmp(Variables.gDesde, Strings.Space(0), false) == 0) { definition.Text = "'" + Variables.gDesde + "'"; } else { definition.Text = "'" + Strings.Format(DateType.FromString(Variables.gDesde), "dd/MM/yyyy") + "'"; } FormulaFieldDefinition definition2 = formulaFields["hasta"]; if (StringType.StrCmp(Variables.gHasta, Strings.Space(0), false) == 0) { definition2.Text = "'" + Variables.gHasta + "'"; } else { definition2.Text = "'" + Strings.Format(DateType.FromString(Variables.gHasta), "dd/MM/yyyy") + "'"; } FormulaFieldDefinition definition3 = formulaFields["almacen"]; if (StringType.StrCmp(Variables.gAlmacen1, Strings.Space(0), false) != 0) { if (StringType.StrCmp(Variables.gAlmacen2, Strings.Space(0), false) != 0) { definition3.Text = "'Almacenes: " + Strings.Trim(Variables.gAlmacen1) + "-" + Strings.Trim(Variables.gAlmacen2) + "'"; } else { definition3.Text = "'Almacen: " + Strings.Trim(Variables.gAlmacen1) + "'"; } } else if (StringType.StrCmp(Variables.gAlmacen2, Strings.Space(0), false) != 0) { definition3.Text = "'Almacen: " + Strings.Trim(Variables.gAlmacen2) + "'"; } else { definition3.Text = "'Todos los almacenes'"; } this.CrystalReportViewer1.ReportSource = this.Informe; }
private void Button3_Click(object sender, EventArgs e) { int num; int num9; object obj; try { IL_01: ProjectData.ClearProjectError(); num = -2; IL_09: int num2 = 2; long num3 = Conversions.ToLong(this.DataGridView1.Rows[0].Cells[0].Value); IL_32: num2 = 3; checked { num3 -= 1L; IL_40: num2 = 4; if (num3 != 0L) { goto IL_5C; } IL_50: num2 = 5; num3 = -1L; IL_5C: num2 = 7; short num4 = 0; short num5 = (short)(this.DataGridView1.RowCount - 1); short num6 = num4; for (;;) { short num7 = num6; short num8 = num5; if (num7 > num8) { break; } IL_7B: num2 = 8; this.DataGridView1.Rows[(int)num6].Cells[0].Value = num3; IL_A5: num2 = 9; num3 += 1L; IL_B4: num2 = 10; if (num3 == 0L) { IL_C5: num2 = 11; num3 = 1L; } IL_D2: num2 = 13; unchecked { num6 += 1; } } IL_DE: goto IL_16C; IL_E3: goto IL_176; IL_E8: num9 = num2; if (num <= -2) { goto IL_FF; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); goto IL_147; IL_FF :; } int num10 = num9 + 1; num9 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num10); IL_147: goto IL_176; } catch when(endfilter(obj is Exception & num != 0 & num9 == 0)) { Exception ex = (Exception)obj2; goto IL_E8; } IL_16C: if (num9 != 0) { ProjectData.ClearProjectError(); } return; IL_176: throw ProjectData.CreateProjectError(-2146828237); }
private string WriteAndReadFromUPS(string Comando, bool NaoEsperaResposta = false) { if (!Conectado()) { throw new NobreakNotConnectedException(); } FileIOApiDeclarations.SECURITY_ATTRIBUTES lpSecurityAttributes = new FileIOApiDeclarations.SECURITY_ATTRIBUTES(); MyHID.Capabilities = MyHID.GetDeviceCapabilities(HIDHandle); WriteHandle = FileIOApiDeclarations.CreateFile(MyDevicePathName, 1073741824, 3, ref lpSecurityAttributes, 3, 0, 0); ReadHandle = FileIOApiDeclarations.CreateFile(MyDevicePathName, int.MinValue, 3, ref lpSecurityAttributes, 3, 1073741824, 0); string str = "Str"; try { bool flag = false; if (ReadHandle != -1 & WriteHandle != -1) { if ((int)MyHID.Capabilities.OutputReportByteLength > 0) { byte[] reportBuffer = new byte[checked ((int)MyHID.Capabilities.OutputReportByteLength - 1 + 1)]; reportBuffer[0] = (byte)0; if (Information.UBound((Array)reportBuffer, 1) > 1) { reportBuffer[1] = checked ((byte)Strings.Len(Comando)); int num1 = 1; int num2 = Strings.Len(Comando); int Start = num1; while (Start <= num2) { reportBuffer[checked (Start + 1)] = checked ((byte)Strings.Asc(Strings.Mid(Comando, Start, 1))); checked { ++Start; } } } flag = myOutputReport.Write(reportBuffer, WriteHandle); if (!flag) { MyDeviceDetected = false; } } string Expression1 = "Expression 1"; if (!NaoEsperaResposta & flag) { Expression1 = ""; int num1 = 0; bool success; do { success = false; if ((int)MyHID.Capabilities.InputReportByteLength > 0) { byte[] readBuffer = new byte[checked ((int)MyHID.Capabilities.InputReportByteLength - 1 + 1)]; myInputReport.Read(ReadHandle, HIDHandle, WriteHandle, ref MyDeviceDetected, ref readBuffer, ref success); if (success) { string Expression2 = Expression1; int num2 = 1; int num3 = (int)readBuffer[1]; int num4 = num2; while (num4 <= num3) { if ((int)readBuffer[checked (num4 + 1)] != 0) { Expression1 += StringType.FromChar(Strings.Chr((int)readBuffer[checked (num4 + 1)])); } checked { ++num4; } } if (Strings.Len(Expression1) == Strings.Len(Expression2) | Strings.Len(Expression1) == 47 & StringType.StrCmp(Comando, "Q1\r", false) == 0 | Strings.Len(Expression1) == 22 & StringType.StrCmp(Comando, "F\r", false) == 0) { checked { ++num1; } } else { num1 = 0; } } else { MyDeviceDetected = false; } } }while (success & num1 < 1); } str = Expression1; } } catch (NobreakNotConnectedException) { Debug.WriteLine("Nobreak nao conectado para executar COMANDO"); } catch (Exception ex) { ProjectData.SetProjectError(ex); //frmMonitor.HandleException(Name, ex); ProjectData.ClearProjectError(); Console.WriteLine("ERRO> " + ex.Message); } return(str); }
private void Make() { short altID = 0; string str; byte num = 0; int num1; int num2; int num3; int num4; IEnumerator enumerator = null; TransitionTable transitionTable = new TransitionTable(); DateTime now = DateTime.Now; this.iLogger.StartTask(); this.iLogger.LogMessage("Loading Terrain Image."); try { str = string.Format("{0}\\{1}", this.ProjectPath.Text, this.TerrainFile.Text); this.iLogger.LogMessage(str); this.i_Terrain = new Bitmap(str); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; this.iLogger.LogMessage("Problem with Loading Terrain Image."); this.iLogger.LogMessage(exception.Message); ProjectData.ClearProjectError(); return; } this.iLogger.LogMessage("Loading Altitude Image."); try { str = string.Format("{0}\\{1}", this.ProjectPath.Text, this.AltitudeFile.Text); this.iLogger.LogMessage(str); this.i_Altitude = new Bitmap(str); } catch (Exception exception3) { ProjectData.SetProjectError(exception3); Exception exception2 = exception3; this.iLogger.LogMessage("Problem with Loading Altitude Image."); this.iLogger.LogMessage(exception2.Message); ProjectData.ClearProjectError(); return; } //this.iLogger.EndTask(); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Preparing Image Files."); this.iLogger.StartTask(); int width = this.i_Terrain.Width; int height = this.i_Terrain.Height; Rectangle rectangle = new Rectangle(0, 0, width, height); BitmapData bitmapDatum = this.i_Terrain.LockBits(rectangle, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed); IntPtr scan0 = bitmapDatum.Scan0; int width1 = checked (bitmapDatum.Width * bitmapDatum.Height); byte[] numArray = new byte[checked (checked (width1 - 1) + 1)]; Marshal.Copy(scan0, numArray, 0, width1); BitmapData bitmapDatum1 = this.i_Altitude.LockBits(rectangle, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed); IntPtr intPtr = bitmapDatum1.Scan0; int width2 = checked (bitmapDatum1.Width * bitmapDatum1.Height); byte[] numArray1 = new byte[checked (checked (width2 - 1) + 1)]; Marshal.Copy(intPtr, numArray1, 0, width2); //this.iLogger.EndTask(); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Creating Master Terrian Table."); this.iLogger.StartTask(); MapCell[,] mapCell = new MapCell[checked (width + 1), checked (height + 1)]; ClsAltitudeTable clsAltitudeTable = new ClsAltitudeTable(); clsAltitudeTable.Load(); try { int num5 = checked (width - 1); for (int i = 0; i <= num5; i++) { int num6 = checked (height - 1); for (int j = 0; j <= num6; j++) { int num7 = checked (checked (j * width) + i); ClsAltitude getAltitude = clsAltitudeTable.GetAltitude(numArray1[num7]); mapCell[i, j] = new MapCell(numArray[num7], getAltitude.GetAltitude); } } } catch (Exception exception4) { ProjectData.SetProjectError(exception4); this.iLogger.LogMessage("Altitude image needs to be rebuilt"); ProjectData.ClearProjectError(); return; } this.i_Terrain.Dispose(); this.i_Altitude.Dispose(); this.iLogger.LogTimeStamp(); width--; height--; int num8 = checked ((int)Math.Round((double)width / 8 - 1)); int num9 = checked ((int)Math.Round((double)height / 8 - 1)); this.iLogger.LogMessage("Load Transition Tables."); this.iLogger.StartTask(); string baseDirectory = AppDomain.CurrentDomain.BaseDirectory; #region Data Directory Modification baseDirectory = string.Concat(baseDirectory, "Data\\Engine\\Transitions\\"); #endregion if (Directory.Exists(baseDirectory)) { transitionTable.MassLoad(baseDirectory); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Preparing Static Tables"); Collection[,] collections = new Collection[checked (num8 + 1), checked (num9 + 1)]; int num10 = num8; for (int k = 0; k <= num10; k++) { int num11 = num9; for (int l = 0; l <= num11; l++) { collections[k, l] = new Collection(); } } this.iLogger.LogMessage("Applying Transition Tables."); this.iLogger.StartTask(); this.ProgressBar1.Maximum = width; ClsTerrainTable clsTerrainTable = new ClsTerrainTable(); clsTerrainTable.Load(); MapTile mapTile = new MapTile(); Transition.Transition transition = new Transition.Transition(); short[] numArray2 = new short[16]; short num12 = checked ((short)width); for (short m = 0; m <= num12; m = checked ((short)(m + 1))) { num1 = (m != 0 ? checked (m - 1) : width); num2 = (m != width ? checked (m + 1) : 0); short num13 = checked ((short)height); for (short n = 0; n <= num13; n = checked ((short)(n + 1))) { num4 = (n != 0 ? checked (n - 1) : height); num3 = (n != height ? checked (n + 1) : 0); object[] groupID = new object[] { mapCell[num1, num4].GroupID, mapCell[m, num4].GroupID, mapCell[num2, num4].GroupID, mapCell[num1, n].GroupID, mapCell[m, n].GroupID, mapCell[num2, n].GroupID, mapCell[num1, num3].GroupID, mapCell[m, num3].GroupID, mapCell[num2, num3].GroupID }; string str1 = string.Format("{0:X2}{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}", groupID); try { transition = (Transition.Transition)(transitionTable.GetTransitionTable[str1]); if (transition == null) { ClsTerrain terrianGroup = clsTerrainTable.TerrianGroup(mapCell[m, n].GroupID); mapCell[m, n].TileID = terrianGroup.TileID; mapCell[m, n].AltID = altID; terrianGroup = null; } else { altID = mapCell[m, n].AltID; mapTile = transition.GetRandomMapTile(); if (mapTile == null) { ClsTerrain clsTerrain = clsTerrainTable.TerrianGroup(mapCell[m, n].GroupID); mapCell[m, n].TileID = clsTerrain.TileID; mapCell[m, n].ChangeAltID((short)clsTerrain.AltID); clsTerrain = null; } else { MapTile mapTile1 = mapTile; mapCell[m, n].TileID = mapTile1.TileID; mapCell[m, n].ChangeAltID(mapTile1.AltIDMod); mapTile1 = null; } transition.GetRandomStaticTiles(m, n, altID, collections, this.i_RandomStatic); } if (mapCell[m, n].GroupID == 254) { mapCell[m, n].TileID = 1078; mapCell[m, n].AltID = 0; } } catch (Exception exception6) { ProjectData.SetProjectError(exception6); Exception exception5 = exception6; LoggerForm loggerForm = this.iLogger; groupID = new object[] { m, n, altID, str1 }; loggerForm.LogMessage(string.Format("\r\nLocation: X:{0}, Y:{1}, Z:{2} Hkey:{3}", groupID)); this.iLogger.LogMessage(exception5.ToString()); ProjectData.ClearProjectError(); return; } } this.ProgressBar1.Value = m; } this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Second Pass."); this.iLogger.StartTask(); short[] altID1 = new short[9]; RoughEdge roughEdge = new RoughEdge(); short num14 = checked ((short)width); for (short o = 0; o <= num14; o = checked ((short)(o + 1))) { num1 = (o != 0 ? checked (o - 1) : width); num2 = (o != width ? checked (o + 1) : 0); short num15 = checked ((short)height); for (short p = 0; p <= num15; p = checked ((short)(p + 1))) { num4 = (p != 0 ? checked (p - 1) : height); num3 = (p != height ? checked (p + 1) : 0); mapCell[o, p].ChangeAltID(roughEdge.CheckCorner(mapCell[num1, num4].TileID)); mapCell[o, p].ChangeAltID(roughEdge.CheckLeft(mapCell[num1, p].TileID)); mapCell[o, p].ChangeAltID(roughEdge.CheckTop(mapCell[o, num4].TileID)); if (mapCell[o, p].GroupID == 20) { altID1[0] = mapCell[num1, num4].AltID; altID1[1] = mapCell[o, num4].AltID; altID1[2] = mapCell[num2, num4].AltID; altID1[3] = mapCell[num1, p].AltID; altID1[4] = mapCell[o, p].AltID; altID1[5] = mapCell[num2, p].AltID; altID1[6] = mapCell[num1, num3].AltID; altID1[7] = mapCell[o, num3].AltID; altID1[8] = mapCell[num2, num3].AltID; Array.Sort(altID1); float single = 10f * VBMath.Rnd(); if (single == 0f) { mapCell[o, p].AltID = checked ((short)(checked (altID1[8] - 4))); } else if (single >= 1f && single <= 2f) { mapCell[o, p].AltID = checked ((short)(checked (altID1[8] - 2))); } else if (single >= 3f && single <= 7f) { mapCell[o, p].AltID = altID1[8]; } else if (single >= 8f && single <= 9f) { mapCell[o, p].AltID = checked ((short)(checked (altID1[8] + 2))); } else if (single == 10f) { mapCell[o, p].AltID = checked ((short)(checked (altID1[8] + 4))); } } if (clsTerrainTable.TerrianGroup(mapCell[o, p].GroupID).RandAlt) { float single1 = 10f * VBMath.Rnd(); if (single1 == 0f) { mapCell[o, p].ChangeAltID(-4); } else if (single1 >= 1f && single1 <= 2f) { mapCell[o, p].ChangeAltID(-2); } else if (single1 >= 8f && single1 <= 9f) { mapCell[o, p].ChangeAltID(2); } else if (single1 == 10f) { mapCell[o, p].ChangeAltID(4); } } } this.ProgressBar1.Value = o; } this.iLogger.LogTimeStamp(); int num16 = 1; int num17 = width; if (num17 == 6143) { num = 0; } else if (num17 == 2303) { num = 2; } else if (num17 == 2559) { num = 3; } this.iLogger.LogMessage("\r\n"); this.iLogger.LogMessage("Load . . . . . Import Tiles."); this.iLogger.StartTask(); ImportTiles importTile = new ImportTiles(collections, this.ProjectPath.Text); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("\r\n"); this.iLogger.LogMessage("Write Mul Files."); this.iLogger.StartTask(); str = string.Format("{0}/Map{1}.mul", this.ProjectPath.Text, num); this.iLogger.LogMessage(str); FileStream fileStream = new FileStream(str, FileMode.Create); BinaryWriter binaryWriter = new BinaryWriter(fileStream); int num18 = width; for (int q = 0; q <= num18; q = checked (q + 8)) { int num19 = height; for (int r = 0; r <= num19; r = checked (r + 8)) { binaryWriter.Write(num16); int num20 = 0; do { int num21 = 0; do { mapCell[checked (q + num21), checked (r + num20)].WriteMapMul(binaryWriter); num21++; }while (num21 <= 7); num20++; }while (num20 <= 7); } } binaryWriter.Close(); fileStream.Close(); str = string.Format("{0}/StaIdx{1}.mul", this.ProjectPath.Text, num); FileStream fileStream1 = new FileStream(str, FileMode.Create); this.iLogger.LogMessage(str); str = string.Format("{0}/Statics{1}.mul", this.ProjectPath.Text, num); FileStream fileStream2 = new FileStream(str, FileMode.Create); this.iLogger.LogMessage(str); BinaryWriter binaryWriter1 = new BinaryWriter(fileStream1); BinaryWriter binaryWriter2 = new BinaryWriter(fileStream2); int num22 = num8; for (int s = 0; s <= num22; s++) { int num23 = num9; for (int t = 0; t <= num23; t++) { int num24 = 0; int position = checked ((int)binaryWriter2.BaseStream.Position); try { enumerator = collections[s, t].GetEnumerator(); while (enumerator.MoveNext()) { ((StaticCell)enumerator.Current).Write(binaryWriter2); num24 = checked (num24 + 7); } } finally { if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } if (num24 == 0) { position = -1; } binaryWriter1.Write(position); binaryWriter1.Write(num24); binaryWriter1.Write(num16); } } binaryWriter2.Close(); binaryWriter1.Close(); fileStream2.Close(); fileStream1.Close(); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Done."); } else { this.iLogger.LogMessage("Unable to find Transition Data files in the following path: "); this.iLogger.LogMessage(baseDirectory); } }
public void TcQGJ_X() { int num; int num8; object obj2; try { IL_01: ProjectData.ClearProjectError(); num = -2; IL_09: int num2 = 2; Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; IL_16: num2 = 3; Database database = mdiActiveDocument.Database; IL_1F: num2 = 4; using (Transaction transaction = database.TransactionManager.StartTransaction()) { TypedValue[] array = new TypedValue[1]; Array array2 = array; TypedValue typedValue; typedValue..ctor(0, "LWPOLYLINE"); array2.SetValue(typedValue, 0); SelectionFilter selectionFilter = new SelectionFilter(array); PromptSelectionResult selection = mdiActiveDocument.Editor.GetSelection(selectionFilter); if (selection.Status == 5100) { SelectionSet value = selection.Value; Entity e = (Entity)transaction.GetObject(value[0].ObjectId, 0); Point3d entCenter = CAD.GetEntCenter(e); double num3 = entCenter.X; double num4 = entCenter.Y; double num5 = entCenter.X; double num6 = entCenter.Y; IEnumerator enumerator = value.GetEnumerator(); while (enumerator.MoveNext()) { object obj = enumerator.Current; SelectedObject selectedObject = (SelectedObject)obj; e = (Entity)transaction.GetObject(selectedObject.ObjectId, 0); entCenter = CAD.GetEntCenter(e); num3 = Math.Min(entCenter.X, num3); num4 = Math.Min(entCenter.Y, num4); num5 = Math.Max(entCenter.X, num5); num6 = Math.Max(entCenter.Y, num6); } if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } Point3d point3d_; point3d_..ctor(num3, num4, 0.0); Point3d point3d_2; point3d_2..ctor(num5, num6, 0.0); Class36.smethod_14(point3d_, point3d_2, Class36.double_0 / 2.0); } transaction.Commit(); } IL_1C7: num2 = 6; if (Information.Err().Number <= 0) { goto IL_1EC; } IL_1D8: num2 = 7; Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null); IL_1EC: goto IL_268; IL_1EE: int num7 = num8 + 1; num8 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num7); IL_222: goto IL_25D; IL_224: num8 = num2; if (num <= -2) { goto IL_1EE; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); IL_23A :; } catch when(endfilter(obj2 is Exception & num != 0 & num8 == 0)) { Exception ex = (Exception)obj3; goto IL_224; } IL_25D: throw ProjectData.CreateProjectError(-2146828237); IL_268: if (num8 != 0) { ProjectData.ClearProjectError(); } }
public void TcDDYZ2() { int num; int num9; object obj; try { IL_01: ProjectData.ClearProjectError(); num = -2; IL_09: int num2 = 2; CAD.CreateLayer("Y_引注", 4, "continuous", -3, false, true); IL_20: num2 = 3; CAD.CreateLayer("Y_引线", 5, "continuous", 13, false, true); IL_37: num2 = 4; this.double_0 = CAD.GetScale(); IL_44: num2 = 5; DBText dbtext = new DBText(); IL_4D: num2 = 6; dbtext.Height = 300.0 * this.double_0; IL_66: num2 = 7; dbtext.Rotation = 1.5707963267948966; IL_78: num2 = 8; dbtext.WidthFactor = 0.7; IL_8A: num2 = 9; this.string_0 = Clipboard.GetText(); IL_98: num2 = 10; if (Operators.CompareString(this.string_0, "", false) != 0) { goto IL_BF; } IL_B1: num2 = 11; this.string_0 = "%%1328@200"; IL_BF: num2 = 13; if (this.string_0.Length <= 50) { goto IL_F4; } IL_D3: num2 = 14; this.string_0 = this.string_0.Substring(0, 40) + "……"; IL_F4: num2 = 16; dbtext.TextString = this.string_0; IL_104: num2 = 17; this.double_1 = dbtext.GeometricExtents.MaxPoint.Y - dbtext.GeometricExtents.MinPoint.Y; IL_140: num2 = 18; bool flag = false; IL_146: num2 = 19; this.entity_0 = new Entity[3]; IL_155: num2 = 22; Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; IL_164: num2 = 23; PromptPointOptions promptPointOptions = new PromptPointOptions("插入点:"); IL_173: num2 = 24; PromptPointResult point = mdiActiveDocument.Editor.GetPoint(promptPointOptions); IL_186: num2 = 25; if (point.Status != 5100) { goto IL_268; } IL_19C: num2 = 26; this.point3d_2 = point.Value; IL_1AC: num2 = 27; PromptResult promptResult = mdiActiveDocument.Editor.Drag(this); IL_1BE: num2 = 28; if (promptResult.Status != 5100) { goto IL_268; } IL_1D4: num2 = 29; ObjectId[] array; short num5; short num6; checked { short num3 = (short)(this.entity_0.Length - 1); IL_1E4: num2 = 30; if (num3 != 0) { goto IL_201; } IL_1EE: num2 = 31; CAD.AddEnt(this.entity_0[0]); goto IL_268; IL_201: num2 = 33; IL_204: num2 = 34; array = new ObjectId[(int)(num3 + 1)]; IL_211: num2 = 35; short num4 = 0; num5 = (short)(this.entity_0.Length - 1); num6 = num4; } for (;;) { short num7 = num6; short num8 = num5; if (num7 > num8) { break; } IL_225: num2 = 36; array[(int)num6] = CAD.AddEnt(this.entity_0[(int)num6]).ObjectId; IL_246: num2 = 37; num6 += 1; } IL_257: num2 = 38; if (!flag) { goto IL_268; } IL_25E: num2 = 39; Class36.smethod_55(array); IL_268: goto IL_378; IL_26D: goto IL_383; IL_272: num9 = num2; if (num <= -2) { goto IL_28D; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); goto IL_352; IL_28D: int num10 = num9 + 1; num9 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num10); IL_352: goto IL_383; } catch when(endfilter(obj is Exception & num != 0 & num9 == 0)) { Exception ex = (Exception)obj2; goto IL_272; } IL_378: if (num9 != 0) { ProjectData.ClearProjectError(); } return; IL_383: throw ProjectData.CreateProjectError(-2146828237); }
private void RefreshData() { try { this.m_bLoaded = false; this.dvCriteria = new DataView(this.dtCriteria); this.CritListView.View = View.List; try { foreach (DataRow row1 in this.dtCriteria.Rows) { ListViewItem listViewItem = new ListViewItem(); listViewItem.Text = Conversions.ToString(row1["Criteria"]); DataRow dataRow; object[] objArray; bool[] flagArray; NewLateBinding.LateCall((object)listViewItem.SubItems, (System.Type)null, "Add", objArray = new object[1] { (dataRow = row1)["ID"] }, (string[])null, (System.Type[])null, flagArray = new bool[1] { true }, true); if (flagArray[0]) { dataRow["ID"] = RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(objArray[0])); } listViewItem.SubItems.Add(this.SubCompLink); if (mdUtility.get_MstrTable("SelectedSSCCrit") != null && mdUtility.get_MstrTable("SelectedSSCCrit").Rows.Count > 0) { try { foreach (DataRow row2 in mdUtility.get_MstrTable("SelectedSSCCrit").Rows) { if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(row2["SSC_CRITERION_LINK"], row1["ID"], false)) { listViewItem.Checked = true; break; } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } if (mdUtility.get_MstrTable("SelectedCrit") != null && mdUtility.get_MstrTable("SelectedCrit").Rows.Count > 0) { try { foreach (DataRow row2 in mdUtility.get_MstrTable("SelectedCrit").Rows) { if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.AndObject(Microsoft.VisualBasic.CompilerServices.Operators.AndObject(Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual(row2["ID"], (object)listViewItem.SubItems[1].Text, false), Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual(row2["subcomplink"], (object)listViewItem.SubItems[2].Text, false)), Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual(row2["CritStatus"], (object)"N", false)))) { listViewItem.Checked = true; break; } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } this.CritListView.Items.Add(listViewItem); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } this.CritListView.Visible = true; this.FormatGrid(); this.m_bLoaded = true; } catch (Exception ex) { ProjectData.SetProjectError(ex); mdUtility.Errorhandler(ex, nameof(frmCriteria), nameof(RefreshData)); ProjectData.ClearProjectError(); } }
private void cmbAceptar_Click(object sender, EventArgs e) { DataSet dataSet = new DataSet(); if (!this.dtpDesdeFechaEnt.Checked & this.dtpHastaFechaEnt.Checked) { Interaction.MsgBox("Debe ingresar desde fecha entrega", 0x10, "Operador"); this.dtpDesdeFechaEnt.Checked = true; } else if (this.dtpDesdeFechaEnt.Checked & !this.dtpHastaFechaEnt.Checked) { Interaction.MsgBox("Debe ingresar hasta fecha entrega", 0x10, "Operador"); this.dtpHastaFechaEnt.Checked = true; } else { DataRow row; long num; SqlDataReader reader; string str4; this.dtpDesdeFechaEnt.Enabled = false; this.dtpHastaFechaEnt.Enabled = false; this.cmbAceptar.Enabled = false; this.cmbSalir.Enabled = false; if (this.dtpDesdeFechaEnt.Checked) { Variables.gDesdeFechaEnt = StringType.FromDate(this.dtpDesdeFechaEnt.Value); } else { Variables.gDesdeFechaEnt = ""; } if (this.dtpHastaFechaEnt.Checked) { Variables.gHastaFechaEnt = StringType.FromDate(this.dtpHastaFechaEnt.Value); } else { Variables.gHastaFechaEnt = ""; } SqlConnection connection = new SqlConnection("data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096"); SqlConnection connection2 = new SqlConnection("data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"); connection2.Open(); SqlCommand command4 = new SqlCommand("delete " + Variables.gTermi + "TmpRegPedExp", connection2); int num2 = command4.ExecuteNonQuery(); string str = "SELECT OR01001,OR01004,OR01016,OR01024,OR01072,OR03019,sum((OR03011-OR03012)*OR03008) as ImpAFac,OR04005,SL01002,PL23004,SY14002 FROM dbo.OR010100 inner join OR030100 on OR010100.OR01001=OR030100.OR03001 inner join OR040100 on OR010100.OR01001=OR040100.OR04001 inner join SL010100 on OR010100.OR01004=SL010100.SL01001 inner join PL230100 on OR010100.OR01014=convert(int,PL230100.PL23003) inner join SY140100 on OR010100.OR01028=SY140100.SY14001 where OR010100.OR01002<>6 and OR03011-OR03012<>0 and ((OR01004>='600000' and OR01004<='699000') or OR01004='00WARREXPO')"; if (this.dtpDesdeFechaEnt.Checked & this.dtpHastaFechaEnt.Checked) { str = str + " and OR03019>='" + Strings.Format(DateType.FromString(Variables.gDesdeFechaEnt), "MM/dd/yyyy") + "' and OR03019<='" + Strings.Format(DateType.FromString(Variables.gHastaFechaEnt), "MM/dd/yyyy") + "'"; } SqlCommand command2 = new SqlCommand(str + " and PL23001='2' and PL23002='00'" + " group by OR01001,OR01004,OR01016,OR01024,OR01072,OR03019,OR04005,SL01002,PL23004,SY14002", connection); command2.CommandTimeout = 500; SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = command2; connection.Open(); adapter.Fill(dataSet, "OR010100"); long num4 = dataSet.Tables["OR010100"].Rows.Count - 1; for (num = 0L; num <= num4; num += 1L) { row = dataSet.Tables["OR010100"].Rows[(int)num]; SqlCommand command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT PC01001,PL01002 FROM dbo.PC010100 inner join PL010100 on PC010100.PC01003=PL010100.PL01001 where PC01017='ORDEN VENT", row["OR01001"]), "'")), connection); reader = command.ExecuteReader(); if (reader.Read()) { str4 = 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("insert into " + Variables.gTermi + "TmpRegPedExp (Tipo,Cliente,NomCli,OCCliente,NroOV,NroOCProv,NomProv,FEntPed,FEntConf,PaisDest,Moneda,MontoOV,ImpAFac,FormaDesp) values (1,'", row["OR01004"]), "','"), row["SL01002"]), "','"), row["OR01072"]), "','"), row["OR01001"]), "','"), reader["PC01001"]), "','"), reader["PL01002"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR03019"]), "MM/dd/yyyy")), "','"), row["OR04005"]), "','"), row["SY14002"]), "',"), row["OR01024"]), ","), row["ImpAFac"]), ",'"), row["PL23004"]), "')")); reader.Close(); command4 = new SqlCommand(str4, connection2); } else { reader.Close(); command4 = 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("insert into " + Variables.gTermi + "TmpRegPedExp (Tipo,Cliente,NomCli,OCCliente,NroOV,NroOCProv,NomProv,FEntPed,FEntConf,PaisDest,Moneda,MontoOV,ImpAFac,FormaDesp) values (1,'", row["OR01004"]), "','"), row["SL01002"]), "','"), row["OR01072"]), "','"), row["OR01001"]), "','','','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR01016"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR03019"]), "MM/dd/yyyy")), "','"), row["OR04005"]), "','"), row["SY14002"]), "',"), row["OR01024"]), ","), row["ImpAFac"]), ",'"), row["PL23004"]), "')")), connection2); } try { num2 = command4.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.dtpDesdeFechaEnt.Enabled = true; this.dtpHastaFechaEnt.Enabled = true; this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } str = "SELECT OR20001,OR20004,OR20016,OR20024,OR20072,OR21019,sum((OR21011-OR21012)*OR21008) as ImpAFac,OR22005,SL01002,PL23004,SY14002 FROM dbo.OR200100 inner join OR210100 on OR200100.OR20001=OR210100.OR21001 inner join OR220100 on OR200100.OR20001=OR220100.OR22001 inner join SL010100 on OR200100.OR20004=SL010100.SL01001 inner join PL230100 on OR200100.OR20014=convert(int,PL230100.PL23003) inner join SY140100 on OR200100.OR20028=SY140100.SY14001 where OR200100.OR20002<>6 and OR21011-OR21012<>0 and ((OR20004>='600000' and OR20004<='699000') or OR20004='00WARREXPO')"; if (this.dtpDesdeFechaEnt.Checked & this.dtpHastaFechaEnt.Checked) { str = str + " and OR21019>='" + Strings.Format(DateType.FromString(Variables.gDesdeFechaEnt), "MM/dd/yyyy") + "' and OR21019<='" + Strings.Format(DateType.FromString(Variables.gHastaFechaEnt), "MM/dd/yyyy") + "'"; } command2 = new SqlCommand(str + " and PL23001='2' and PL23002='00'" + " group by OR20001,OR20004,OR20016,OR20024,OR20072,OR21019,OR22005,SL01002,PL23004,SY14002", connection); command2.CommandTimeout = 500; SqlDataAdapter adapter2 = new SqlDataAdapter(); adapter2.SelectCommand = command2; adapter2.Fill(dataSet, "OR200100"); long num3 = dataSet.Tables["OR200100"].Rows.Count - 1; for (num = 0L; num <= num3; num += 1L) { row = dataSet.Tables["OR200100"].Rows[(int)num]; reader = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT PC01001,PL01002 FROM dbo.PC010100 inner join PL010100 on PC010100.PC01003=PL010100.PL01001 where PC01017='ORDEN VENT", row["OR20001"]), "'")), connection).ExecuteReader(); if (reader.Read()) { str4 = 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("insert into " + Variables.gTermi + "TmpRegPedExp (Tipo,Cliente,NomCli,OCCliente,NroOV,NroOCProv,NomProv,FEntPed,FEntConf,PaisDest,Moneda,MontoOV,ImpAFac,FormaDesp) values (2,'", row["OR20004"]), "','"), row["SL01002"]), "','"), row["OR20072"]), "','"), row["OR20001"]), "','"), reader["PC01001"]), "','"), reader["PL01002"]), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR20016"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR21019"]), "MM/dd/yyyy")), "','"), row["OR22005"]), "','"), row["SY14002"]), "',"), row["OR20024"]), ","), row["ImpAFac"]), ",'"), row["PL23004"]), "')")); reader.Close(); command4 = new SqlCommand(str4, connection2); } else { reader.Close(); command4 = 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("insert into " + Variables.gTermi + "TmpRegPedExp (Tipo,Cliente,NomCli,OCCliente,NroOV,NroOCProv,NomProv,FEntPed,FEntConf,PaisDest,Moneda,MontoOV,ImpAFac,FormaDesp) values (2,'", row["OR20004"]), "','"), row["SL01002"]), "','"), row["OR20072"]), "','"), row["OR20001"]), "','','','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR20016"]), "MM/dd/yyyy")), "','"), Strings.Format(RuntimeHelpers.GetObjectValue(row["OR21019"]), "MM/dd/yyyy")), "','"), row["OR22005"]), "','"), row["SY14002"]), "',"), row["OR20024"]), ","), row["ImpAFac"]), ",'"), row["PL23004"]), "')")), connection2); } try { num2 = command4.ExecuteNonQuery(); } catch (Exception exception3) { ProjectData.SetProjectError(exception3); Exception exception2 = exception3; Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, 0, null); connection.Close(); connection2.Close(); this.dtpDesdeFechaEnt.Enabled = true; this.dtpHastaFechaEnt.Enabled = true; this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } connection.Close(); connection2.Close(); frmRepRegPedExp1 exp = new frmRepRegPedExp1(); this.Hide(); exp.Show(); } }
private void MenuTerrain_Click(object sender, EventArgs e) { byte altID; byte groupID; MapInfo selectedItem = (MapInfo)this.ComboBox2.SelectedItem; if (selectedItem == null) { this.iLogger.LogMessage("Error: Select a Map Type."); } else if (StringType.StrCmp(this.ProjectName.Text, string.Empty, false) != 0) { string str = string.Format("{0}/{1}/Map{2}", this.ProjectPath.Text, this.ProjectName.Text, selectedItem.MapNumber); if (!Directory.Exists(str)) { Directory.CreateDirectory(str); } if (this.ComboBox1.SelectedItem != null) { ClsTerrain clsTerrain = (ClsTerrain)this.ComboBox1.SelectedItem; groupID = checked ((byte)clsTerrain.GroupID); altID = clsTerrain.AltID; } else { groupID = 9; altID = 66; } this.iLogger.LogMessage("Creating Terrain Image."); this.iLogger.StartTask(); try { string str1 = string.Format("{0}/{1}", str, this.TerrainFile.Text); Bitmap palette = this.MakeTerrainMap(selectedItem.XSize, selectedItem.YSize, groupID, this.Dungeon.Checked); palette.Palette = this.iTerrain.GetPalette(); palette.Save(str1, ImageFormat.Bmp); palette.Dispose(); } catch (Exception exception) { ProjectData.SetProjectError(exception); this.iLogger.LogMessage("Error: Problem creating Terrain Image."); ProjectData.ClearProjectError(); } //this.iLogger.EndTask(); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Creating Altitude Image."); this.iLogger.StartTask(); try { string str2 = string.Format("{0}/{1}", str, this.AltitudeFile.Text); Bitmap altPalette = this.MakeAltMap(selectedItem.XSize, selectedItem.YSize, altID, this.Dungeon.Checked); altPalette.Palette = this.iAltitude.GetAltPalette(); altPalette.Save(str2, ImageFormat.Bmp); altPalette.Dispose(); } catch (Exception exception2) { ProjectData.SetProjectError(exception2); Exception exception1 = exception2; this.iLogger.LogMessage("Error: Problem creating Altitude Image."); this.iLogger.LogMessage(exception1.Message); ProjectData.ClearProjectError(); } //this.iLogger.EndTask(); this.iLogger.LogTimeStamp(); this.iLogger.LogMessage("Done."); } else { this.iLogger.LogMessage("Error: Enter a project Name."); } }
public static void get_jre_uninstallers() { MyProject.Forms.UI.JREObjectList.Clear(); List <RegistryKey> list = new List <RegistryKey> { Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"), Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall") }; if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "AMD64") { list.Add(Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall")); } try { List <RegistryKey> .Enumerator enumerator; try { enumerator = list.GetEnumerator(); while (enumerator.MoveNext()) { RegistryKey key3 = enumerator.Current; string[] subKeyNames = key3.GetSubKeyNames(); int num3 = subKeyNames.Length - 1; for (int i = 0; i <= num3; i++) { RegistryKey key = key3.OpenSubKey(subKeyNames[i]); if (key.GetValue("DisplayName") != null) { string str2; string str3; string name = Conversions.ToString(key.GetValue("DisplayName")); if (key.GetValue("DisplayVersion") != null) { str3 = Conversions.ToString(key.GetValue("DisplayVersion")); } else { str3 = routines_locales.get_string("Data Unavailable"); } if (key.GetValue("UninstallString") == null) { str2 = ""; } else { str2 = Conversions.ToString(key.GetValue("UninstallString")); } if (name.StartsWith("Java(TM) 6") | name.ToString().StartsWith("Java 6 Update")) { MyProject.Forms.UI.JREObjectList.Add(new JREInstallObject(name, str3, str2)); } if (name.StartsWith("Java(TM) 7") | name.ToString().StartsWith("Java 7 Update")) { MyProject.Forms.UI.JREObjectList.Add(new JREInstallObject(name, str3, str2)); } if (name.StartsWith("Java(TM) 8") | name.ToString().StartsWith("Java 8 Update")) { MyProject.Forms.UI.JREObjectList.Add(new JREInstallObject(name, str3, str2)); } } } } } finally { enumerator.Dispose(); } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; Functions.write_error(exception); ProjectData.ClearProjectError(); } }
private void cmbAceptar_Click(object sender, EventArgs e) { if ((((!this.rbArticulo.Checked & !this.rbNroOV.Checked) & !this.rbCliente.Checked) & !this.rbFechaOV.Checked) & !this.rbNroRemito.Checked) { Interaction.MsgBox("Debe indicar ordenamiento del reporte", 0x10, "Operador"); this.rbArticulo.Focus(); } else { SqlDataAdapter adapter2; SqlCommand command2; DataRow row; DataRow row2; int num; int num3; this.cmbAceptar.Enabled = false; this.cmbSalir.Enabled = false; if (this.rbArticulo.Checked) { Variables.gOrdenProdPend = 1; } else if (this.rbNroOV.Checked) { Variables.gOrdenProdPend = 2; } else if (this.rbCliente.Checked) { Variables.gOrdenProdPend = 3; } else if (this.rbFechaOV.Checked) { Variables.gOrdenProdPend = 4; } else if (this.rbNroRemito.Checked) { Variables.gOrdenProdPend = 5; } string connectionString = "data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"; SqlConnection connection2 = new SqlConnection(connectionString); connection2.Open(); string str6 = "data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096"; SqlConnection connection = new SqlConnection(str6); connection.Open(); string selectCommandText = "select * from PrepPed where ContFinal='S' and NroRemito is null"; SqlDataAdapter adapter = new SqlDataAdapter(selectCommandText, connectionString); adapter.Fill(this.DS, "PrepPed"); if (this.DS.Tables["PrepPed"].Rows.Count != 0) { int num7 = this.DS.Tables["PrepPed"].Rows.Count - 1; for (num = 0; num <= num7; num++) { SqlCommand command; int num2; SqlDataReader reader; row = this.DS.Tables["PrepPed"].Rows[num]; adapter2 = 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")), str6); this.DS19.Clear(); adapter2.Fill(this.DS19, "OR190100"); if (this.DS19.Tables["OR190100"].Rows.Count != 0) { int num6 = this.DS19.Tables["OR190100"].Rows.Count - 1; num2 = 0; while (num2 <= num6) { row2 = this.DS19.Tables["OR190100"].Rows[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 exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, 0, null); this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; connection2.Close(); this.cmbAceptar.Focus(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } num2++; } } else { string str2; if (ObjectType.ObjTst(row["Producto"], 1, false) == 0) { command = new SqlCommand(StringType.FromObject(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<>'000' and OR19011='"), Strings.Format(RuntimeHelpers.GetObjectValue(row["FechaPrep"]), "MM/dd/yyyy")), "' and OR19012<>'' order by OR19012")), connection); reader = command.ExecuteReader(); if (reader.Read()) { try { str2 = 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='", reader["OR19012"]), "' where NroOV='"), row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and TipoLinea="), row["TipoLinea"]), " and EstLinea='"), row["EstLinea"]), "' and NroRemito is null")); reader.Close(); command2 = new SqlCommand(str2, connection2); num3 = command2.ExecuteNonQuery(); } catch (Exception exception7) { ProjectData.SetProjectError(exception7); Exception exception2 = exception7; Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, 0, null); this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; connection2.Close(); this.cmbAceptar.Focus(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } else { reader.Close(); } } else { adapter2 = 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")), str6); this.DS20.Clear(); adapter2.Fill(this.DS20, "OR230100"); if (this.DS20.Tables["OR230100"].Rows.Count != 0) { int num5 = this.DS20.Tables["OR230100"].Rows.Count - 1; for (num2 = 0; num2 <= num5; num2++) { row2 = this.DS20.Tables["OR230100"].Rows[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 exception8) { ProjectData.SetProjectError(exception8); Exception exception3 = exception8; Interaction.MsgBox("Se ha producido el siguiente error:" + exception3.Message, 0, null); this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; connection2.Close(); this.cmbAceptar.Focus(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } } } else if (ObjectType.ObjTst(row["Producto"], 1, false) == 0) { reader = new SqlCommand(StringType.FromObject(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<>'000' and OR23011='"), Strings.Format(RuntimeHelpers.GetObjectValue(row["FechaPrep"]), "MM/dd/yyyy")), "' and OR23012<>'' order by OR23012")), connection).ExecuteReader(); if (reader.Read()) { try { str2 = 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='", reader["OR23012"]), "' where NroOV='"), row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and TipoLinea="), row["TipoLinea"]), " and EstLinea='"), row["EstLinea"]), "' and NroRemito is null")); reader.Close(); command2 = new SqlCommand(str2, 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); this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; connection2.Close(); this.cmbAceptar.Focus(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } else { reader.Close(); } } } } } } selectCommandText = "select NroOV from PrepPed where ContFinal='S' and Expedicion='N' group by NroOV"; new SqlDataAdapter(selectCommandText, connectionString).Fill(this.DS, "PrepPed"); if (this.DS.Tables["PrepPed"].Rows.Count != 0) { int num4 = this.DS.Tables["PrepPed"].Rows.Count - 1; for (num = 0; num <= num4; num++) { row = this.DS.Tables["PrepPed"].Rows[num]; adapter2 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR01015,OR01072 from OR010100 where OR01001='", row["NroOV"]), "'")), str6); this.DS19.Clear(); adapter2.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); this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; connection2.Close(); this.cmbAceptar.Focus(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } else { adapter2 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR20015,OR20072 from OR200100 where OR20001='", row["NroOV"]), "'")), str6); this.DS20.Clear(); adapter2.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); this.cmbAceptar.Enabled = true; this.cmbSalir.Enabled = true; connection2.Close(); this.cmbAceptar.Focus(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } } } } connection2.Close(); frmRepRMControlados1 controlados = new frmRepRMControlados1(); this.Hide(); controlados.Show(); } }
public static void delete_key(string key) { if (Functions.RegKeyExists(key)) { try { string oldValue = key.Remove(0, key.LastIndexOf(@"\")).Trim(new char[] { '\\' }); string str2 = "NULL"; string name = "NULL"; if (key.StartsWith(@"HKLM\")) { str2 = "HKLM"; name = key.Replace(@"HKLM\", "").Replace(oldValue, "").Trim(new char[] { '\\' }); } if (key.StartsWith(@"HKCR\")) { str2 = "HKCR"; name = key.Replace(@"HKCR\", "").Replace(oldValue, "").Trim(new char[] { '\\' }); } if (key.StartsWith(@"HKCU\")) { str2 = "HKCU"; name = key.Replace(@"HKCU\", "").Replace(oldValue, "").Trim(new char[] { '\\' }); } if (key.StartsWith(@"HKUS\")) { str2 = "HKUS"; name = key.Replace(@"HKUS\", "").Replace(oldValue, "").Trim(new char[] { '\\' }); } RegistryKey key2 = Registry.LocalMachine.OpenSubKey("NULL", true); switch (str2) { case "HKLM": key2 = Registry.LocalMachine.OpenSubKey(name, true); break; case "HKCR": key2 = Registry.ClassesRoot.OpenSubKey(name, true); break; case "HKCU": key2 = Registry.CurrentUser.OpenSubKey(name, true); break; case "HKUS": key2 = Registry.Users.OpenSubKey(name, true); break; } try { key2.DeleteSubKey(oldValue, true); Functions.write_log(routines_locales.get_string("Removed registry subkey:") + " " + oldValue); MyProject.Forms.UI.removal_count++; } catch (InvalidOperationException exception1) { ProjectData.SetProjectError(exception1); InvalidOperationException exception = exception1; key2.DeleteSubKeyTree(oldValue); Functions.write_log(routines_locales.get_string("Removed registry subkey tree:") + " " + oldValue); MyProject.Forms.UI.removal_count++; ProjectData.ClearProjectError(); } key2.Close(); } catch (Exception exception3) { ProjectData.SetProjectError(exception3); Exception exception2 = exception3; Functions.write_error(exception2); ProjectData.ClearProjectError(); } } }
public static void delete_jre_startup_entries() { int num2; try { int num; int num3; Label_0000: num3 = 1; List <string> list = new List <string>(); Label_0009: num3 = 2; list.Add("jusched-Java Quick Start"); Label_0017: num3 = 3; list.Add("SunJavaUpdateSched"); Label_0025: num3 = 4; list.Add("Java(tm) Plug-In 2 SSV Helper"); Label_0033: num3 = 5; List <string> .Enumerator enumerator = list.GetEnumerator(); while (enumerator.MoveNext()) { string current = enumerator.Current; Label_004A: ProjectData.ClearProjectError(); num = 1; Label_0051: num3 = 7; MyProject.Computer.Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true).DeleteValue(current); Label_0074: ProjectData.ClearProjectError(); num = 1; Label_007B: num3 = 9; MyProject.Computer.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true).DeleteValue(current); Label_009F: ProjectData.ClearProjectError(); num = 1; Label_00A6: num3 = 11; MyProject.Computer.Registry.LocalMachine.OpenSubKey(@"Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run", true).DeleteValue(current); Label_00CA: ProjectData.ClearProjectError(); num = 1; Label_00D1: num3 = 13; MyProject.Computer.Registry.CurrentUser.OpenSubKey(@"Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run", true).DeleteValue(current); Label_00F5: num3 = 14; } enumerator.Dispose(); goto Label_01A5; Label_0117: num2 = 0; switch ((num2 + 1)) { case 1: goto Label_0000; case 2: goto Label_0009; case 3: goto Label_0017; case 4: goto Label_0025; case 5: goto Label_0033; case 6: goto Label_004A; case 7: goto Label_0051; case 8: goto Label_0074; case 9: goto Label_007B; case 10: goto Label_009F; case 11: goto Label_00A6; case 12: goto Label_00CA; case 13: goto Label_00D1; case 14: goto Label_00F5; case 15: goto Label_01A5; default: goto Label_019A; } Label_0165: num2 = num3; switch (num) { case 0: goto Label_019A; case 1: goto Label_0117; } } catch (Exception exception1) when(?) { ProjectData.SetProjectError(exception1); goto Label_0165; } Label_019A: throw ProjectData.CreateProjectError(-2146828237); Label_01A5: if (num2 != 0) { ProjectData.ClearProjectError(); } }
public static void UploadTo_MySQL() { try { string str1 = _INI.LoadINI("SQL", "txtDB_Host"); string str2 = _INI.LoadINI("SQL", "txtDB_User"); string str3 = _INI.LoadINI("SQL", "txtDB_Password"); string str4 = _INI.LoadINI("SQL", "txtDB_Name"); string str5 = _INI.LoadINI("SQL", "txtTableStorage"); _INI.LoadINI("SQL", "txtTableBackup"); MySqlConnection mySqlConnection = new MySqlConnection("Server=" + str1 + ";User id=" + str2 + ";password="******";database=" + str4 + "; character set=utf8"); _FUNCTION.clsTXT fn1 = _FUNCTION.FN; string sText1 = "MySQL: Connect..."; fn1.TXT(ref sText1); mySqlConnection.Open(); _FUNCTION.clsTXT fn2 = _FUNCTION.FN; string sText2 = "MySQL: Connected - OK"; fn2.TXT(ref sText2); int num1 = -(MyProject.Forms.frmSQL.chIgnoreSaleID.Checked ? 1 : 0); MySqlCommand mySqlCommand = new MySqlCommand(); mySqlCommand.Connection = mySqlConnection; Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); int num2 = 0; string str6 = DateAndTime.Now.ToString(); byte num3 = 0; MyProject.Forms.frmSQL.PB.Maximum = Information.UBound((Array)_VARIABLES.MailInfo, 1); MyProject.Forms.frmSQL.PB.Value = 0; StringBuilder stringBuilder = new StringBuilder(); int num4 = 1; int num5 = Information.UBound((Array)_VARIABLES.MailInfo, 1); int index = num4; while (index <= num5) { if (index % 500 == 0) { MyProject.Forms.frmSQL.PB.Value = index; Application.DoEvents(); } if ((_VARIABLES.MailInfo[index].ID == 0 || num1 != 0) && ((int)_VARIABLES.MailInfo[index].Registered == 2 || (int)_VARIABLES.MailInfo[index].Registered == 3)) { checked { ++num2; } _VARIABLES.MailInfo[index].ID = 1; stringBuilder.Append("INSERT INTO `" + str5 + "` (`ID`, `login`, `domain`, `password`, `Registered`, `RegUserData_Name`, `RegUserData_LastName`, `RegUserData_City`, `RegUserData_BirthDay`, `RegUserData_BirthMonth`, `RegUserData_BirthYear`, `RegUserData_SecretQuestion`, `RegUserData_SecretAnswer`, `RegUserData_ItsSecretQuestion`, `RegUserData_Sex`, `MailAmount`, `DataCreateBox`, `comment`, `DomainID`, `SaleID`, `DateAdd`, `DateSale`) VALUES (NULL , '" + _VARIABLES.MailInfo[index].login + "', '" + _VARIABLES.MailInfo[index].domain + "', '" + _VARIABLES.MailInfo[index].password + "', '" + Conversions.ToString((int)_VARIABLES.MailInfo[index].Registered) + "', '" + _VARIABLES.MailInfo[index].RegUserData.Name + "', '" + _VARIABLES.MailInfo[index].RegUserData.LastName + "', '" + _VARIABLES.MailInfo[index].RegUserData.City + "', '" + _VARIABLES.MailInfo[index].RegUserData.BirthDay + "', '" + _VARIABLES.MailInfo[index].RegUserData.BirthMonth + "', '" + _VARIABLES.MailInfo[index].RegUserData.BirthYear + "', '" + _VARIABLES.MailInfo[index].RegUserData.SecretQuestion + "', '" + _VARIABLES.MailInfo[index].RegUserData.SecretAnswer + "', '" + _VARIABLES.MailInfo[index].RegUserData.ItsSecretQuestion + "', '" + Conversions.ToString((int)_VARIABLES.MailInfo[index].RegUserData.Sex) + "', '" + Conversions.ToString(_VARIABLES.MailInfo[index].MailAmount) + "', '" + _VARIABLES.MailInfo[index].DataCreateBox + "', '" + _VARIABLES.MailInfo[index].comment + "', '" + Conversions.ToString((int)_VARIABLES.MailInfo[index].DomainID) + "', '" + Conversions.ToString(num3) + "', '" + str6 + "', '" + string.Empty + "');"); if (stringBuilder.Length > 900000) { mySqlCommand.CommandText = stringBuilder.ToString(); mySqlCommand.ExecuteNonQuery(); stringBuilder = new StringBuilder(); } } checked { ++index; } } if (stringBuilder.Length > 0) { mySqlCommand.CommandText = stringBuilder.ToString(); mySqlCommand.ExecuteNonQuery(); } MyProject.Forms.frmSQL.PB.Value = 0; mySqlConnection.Close(); stopwatch.Stop(); _LOADSAVE.SaveALL_MailInfo(); MyProject.Forms.frmSQL.PB.Value = Information.UBound((Array)_VARIABLES.MailInfo, 1); _FUNCTION.clsTXT fn3 = _FUNCTION.FN; string sText3 = "MySQL: Uploaded - OK " + Conversions.ToString(num2) + " accounts [" + Conversions.ToString(stopwatch.ElapsedMilliseconds) + "ms]"; fn3.TXT(ref sText3); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception exception = ex; _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Ex MySQL Upload: " + exception.Message; fn.TXT(ref sText); ProjectData.ClearProjectError(); } }
public static void Load_HttpLoadProxy() { try { string FullPath = Application.StartupPath + "\\data\\HttpLoadProxy_URL.txt"; md_HttpLoadProxy.HttpLoadProxy.VALUE = new md_HttpLoadProxy.myValue_HttpLoadProxy[1]; string str1 = _LOADSAVE.FileLoad(ref FullPath); if (str1.Length == 0) { return; } string[] strArray = str1.Replace("\r", "").Split('\n'); md_HttpLoadProxy.HttpLoadProxy.VALUE = new md_HttpLoadProxy.myValue_HttpLoadProxy[checked (Information.UBound((Array)strArray, 1) + 1 + 1)]; string str2 = "HTTP"; int index1 = 0; int num1 = 0; int num2 = Information.UBound((Array)strArray, 1); int index2 = num1; while (index2 <= num2) { strArray[index2] = strArray[index2].Replace(" ", ""); strArray[index2] = strArray[index2].Replace("\t", ""); int num3 = Strings.InStr(strArray[index2], "'", CompareMethod.Binary); if (num3 > 0) { strArray[index2] = Strings.Left(strArray[index2], checked (num3 - 1)); } if (strArray[index2].Length != 0) { if (Operators.CompareString(Strings.Left(strArray[index2].ToLower(), 9), "protocol=", false) == 0) { str2 = Strings.Right(strArray[index2], checked (strArray[index2].Length - 9)); } else { checked { ++index1; } md_HttpLoadProxy.HttpLoadProxy.VALUE[index1].URL = strArray[index2]; md_HttpLoadProxy.HttpLoadProxy.VALUE[index1].Protocol = str2; } } checked { ++index2; } } md_HttpLoadProxy.HttpLoadProxy.VALUE = (md_HttpLoadProxy.myValue_HttpLoadProxy[])Utils.CopyArray((Array)md_HttpLoadProxy.HttpLoadProxy.VALUE, (Array) new md_HttpLoadProxy.myValue_HttpLoadProxy[checked (index1 + 1)]); MyProject.Forms.frmOptions.lblHttpLoadProxy_UrlCount.Text = Conversions.ToString(index1); if (index1 == 0) { return; } MyProject.Forms.frmOptions.cmbHttpLoadProxy.Items.Clear(); int num4 = 1; int num5 = index1; int index3 = num4; while (index3 <= num5) { MyProject.Forms.frmOptions.cmbHttpLoadProxy.Items.Add((object)md_HttpLoadProxy.HttpLoadProxy.VALUE[index3].URL); checked { ++index3; } } MyProject.Forms.frmOptions.cmbHttpLoadProxy.SelectedIndex = 0; } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception exception = ex; _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Ошибка загрузки HttpLoadProxy_URL.txt: " + exception.Message; fn.TXT(ref sText); ProjectData.ClearProjectError(); } }
public static string Method1(StringBuilder stringBuilder_0) { string str = (string)null; try { byte[] bytes = Encoding.UTF8.GetBytes(stringBuilder_0.ToString()); HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(api.String14 + "accounts/login/"); httpWebRequest.AutomaticDecompression = DecompressionMethods.GZip; httpWebRequest.Method = "POST"; httpWebRequest.Host = api.String8; httpWebRequest.UserAgent = api.String10; httpWebRequest.Headers.Add("Accept-Language", "en;q=0.9"); httpWebRequest.KeepAlive = true; httpWebRequest.Proxy = (IWebProxy)null; httpWebRequest.ContentType = "multipart/form-data; boundary=" + api.String15; httpWebRequest.ContentLength = (long)bytes.Length; httpWebRequest.CookieContainer = api.cookieContainer_0; Stream requestStream = httpWebRequest.GetRequestStream(); requestStream.Write(bytes, 0, bytes.Length); requestStream.Close(); HttpWebResponse response = (HttpWebResponse)httpWebRequest.GetResponse(); using (StreamReader streamReader = new StreamReader(response.GetResponseStream())) str = streamReader.ReadToEnd(); try { try { try { IEnumerator enumerator; try { enumerator = response.Cookies.GetEnumerator(); while (enumerator.MoveNext()) { object objectValue = RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(enumerator.Current)))))))))))))))))))); api.String13 = api.String13 + objectValue.ToString() + ";"; } } finally { // if (enumerator is IDisposable) // (enumerator as IDisposable).Dispose(); } } finally { //IEnumerator enumerator; //if (api.GetEnumerator(enumerator) is IDisposable) // (enumerator as IDisposable).Dispose(); } } finally { IEnumerator enumerator; //if (enumerator is IDisposable) // (enumerator as IDisposable).Dispose(); } } finally { } response.Close(); } catch (WebException ex) { ProjectData.SetProjectError((Exception)ex); using (StreamReader streamReader = new StreamReader(ex.Response.GetResponseStream())) { str = streamReader.ReadToEnd(); streamReader.Close(); } ProjectData.ClearProjectError(); } return(str); }
bool ParseClasses(string iFileName) { int num1 = 0; StreamReader iStream; try { iStream = new StreamReader(iFileName); } catch (Exception ex) { ProjectData.SetProjectError(ex); int num2 = (int)Interaction.MsgBox(ex.Message, MsgBoxStyle.Critical, "Powerset CSV Not Opened"); ProjectData.ClearProjectError(); return(false); } int num3 = 0; int num4 = 0; ImportBuffer = new PowersetData[0]; int num5 = 0; try { string iString; do { iString = FileIO.ReadLineUnlimited(iStream, char.MinValue); if (iString == null || iString.StartsWith("#")) { continue; } ++num5; if (num5 >= 100) { BusyMsg(Strings.Format(num3, "###,##0") + " records parsed."); num5 = 0; } ImportBuffer = (PowersetData[])Utils.CopyArray(ImportBuffer, new PowersetData[ImportBuffer.Length + 1]); ImportBuffer[ImportBuffer.Length - 1] = new PowersetData(iString); ++num3; if (ImportBuffer[ImportBuffer.Length - 1].IsValid) { ++num1; } else { ++num4; } }while (iString != null); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception exception = ex; iStream.Close(); int num2 = (int)Interaction.MsgBox(exception.Message, MsgBoxStyle.Critical, "Powerset Class CSV Parse Error"); ProjectData.ClearProjectError(); return(false); } iStream.Close(); int num6 = (int)Interaction.MsgBox(("Parse Completed!\r\nTotal Records: " + Convert.ToString(num3) + "\r\nGood: " + Convert.ToString(num1) + "\r\nRejected: " + Convert.ToString(num4)), MsgBoxStyle.Information, "File Parsed"); return(true); }
public int CreateCharacter(string Account, string Name, byte Race, byte Classe, byte Gender, byte Skin, byte Face, byte HairStyle, byte HairColor, byte FacialHair, byte OutfitID) { WS_PlayerData.CharacterObject Character = new WS_PlayerData.CharacterObject(); DataTable MySQLQuery = new DataTable(); Character.Name = WorldServiceLocator._Functions.CapitalizeName(ref Name); Character.Race = (Races)Race; Character.Classe = (Classes)Classe; Character.Gender = (Genders)Gender; Character.Skin = Skin; Character.Face = Face; Character.HairStyle = HairStyle; Character.HairColor = HairColor; Character.FacialHair = FacialHair; WorldServiceLocator._WorldServer.AccountDatabase.Query($"SELECT id, gmlevel FROM account WHERE username = \"{Account}\";", ref MySQLQuery); int Account_ID = MySQLQuery.Rows[0].As <int>("id"); AccessLevel Account_Access = (Character.Access = (AccessLevel)MySQLQuery.Rows[0].As <byte>("gmlevel")); if (!WorldServiceLocator._Functions.ValidateName(Character.Name)) { return(70); } try { MySQLQuery.Clear(); WorldServiceLocator._WorldServer.CharacterDatabase.Query($"SELECT char_name FROM characters WHERE char_name = \"{Character.Name}\";", ref MySQLQuery); if (MySQLQuery.Rows.Count > 0) { return(49); } } catch (Exception projectError) { ProjectData.SetProjectError(projectError); int CreateCharacter = 48; ProjectData.ClearProjectError(); return(CreateCharacter); } checked { if (WorldServiceLocator._Global_Constants.SERVER_CONFIG_DISABLED_CLASSES[(int)Character.Classe - 1] || (WorldServiceLocator._Global_Constants.SERVER_CONFIG_DISABLED_RACES[(int)Character.Race - 1] && Account_Access < AccessLevel.GameMaster)) { return(50); } if (Account_Access <= AccessLevel.Player) { MySQLQuery.Clear(); WorldServiceLocator._WorldServer.CharacterDatabase.Query($"SELECT char_race FROM characters WHERE account_id = \"{Account_ID}\" LIMIT 1;", ref MySQLQuery); if (MySQLQuery.Rows.Count > 0 && Character.IsHorde != WorldServiceLocator._Functions.GetCharacterSide(MySQLQuery.Rows[0].As <byte>("char_race"))) { return(51); } } MySQLQuery.Clear(); WorldServiceLocator._WorldServer.CharacterDatabase.Query($"SELECT char_name FROM characters WHERE account_id = \"{Account_ID}\";", ref MySQLQuery); if (MySQLQuery.Rows.Count >= 10) { return(52); } MySQLQuery.Clear(); WorldServiceLocator._WorldServer.CharacterDatabase.Query($"SELECT char_name FROM characters WHERE account_id = \"{Account_ID}\";", ref MySQLQuery); if (MySQLQuery.Rows.Count >= 10) { return(53); } try { WorldServiceLocator._WS_Player_Initializator.InitializeReputations(ref Character); CreateCharacter(ref Character); Character.SaveAsNewCharacter(Account_ID); CreateCharacterSpells(ref Character); CreateCharacterItems(ref Character); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception err = ex; WorldServiceLocator._WorldServer.Log.WriteLine(LogType.FAILED, "Error initializing character! {0} {1}", Environment.NewLine, err.ToString()); int CreateCharacter = 48; ProjectData.ClearProjectError(); return(CreateCharacter); } finally { Character.Dispose(); } return(46); } }
private void Button1_Click(object sender, EventArgs e) { int num2; int num11; object obj; try { IL_01: int num = 1; Class36.SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle); IL_1D: num = 2; DocumentLock documentLock = Application.DocumentManager.MdiActiveDocument.LockDocument(); IL_30: ProjectData.ClearProjectError(); num2 = -2; IL_39: num = 4; double scale = CAD.GetScale(); IL_42: num = 5; if (!this.RadioButton1.Checked) { goto IL_433; } IL_54: num = 6; string text = this.TextBox1.Text; IL_63: num = 7; text = Strings.Replace(text, "\r\n", "&", 1, -1, CompareMethod.Binary); IL_7B: num = 8; string[] array = new string[1]; IL_85: num = 9; string s = text; string text2 = "&"; NF.Str2Arr(s, ref array, ref text2); IL_9A: num = 10; ObjectId[] array2; Point3d point3d; short num5; short num6; checked { short num3 = (short)Information.UBound(array, 1); IL_A8: num = 11; array2 = new ObjectId[(int)(num3 + 1 + 1)]; IL_B8: num = 12; point3d..ctor(0.0, 0.0, 0.0); IL_DD: num = 13; array2[0] = Class36.smethod_81(point3d, (int)this.short_0, scale).ObjectId; IL_101: num = 14; short num4 = 0; num5 = num3; num6 = num4; } for (;;) { short num7 = num6; short num8 = num5; if (num7 > num8) { break; } IL_118: num = 15; if (Operators.CompareString(array[(int)num6], "0.00", false) == 0 | Operators.CompareString(array[(int)num6], "0.000", false) == 0) { IL_144: num = 16; array[(int)num6] = "%%p0.000"; } IL_151: num = 18; if (num6 >= 1) { IL_15E: num = 19; array[(int)num6] = "(" + array[(int)num6] + ")"; } IL_17A: num = 21; if (this.short_0 == 1) { IL_18B: num = 22; Point3d pointXY = CAD.GetPointXY(point3d, 300.0 * scale, 300.0 * scale); IL_1AF: num = 23; array2[(int)(checked (num6 + 1))] = Class36.smethod_57(array[(int)num6], CAD.GetPointXY(pointXY, 800.0 * scale, (double)(checked (400 * num6 + 100)) * scale), 300.0 * scale, 2, 0, "STANDARD", 0.0); } else { IL_20F: num = 25; if (this.short_0 == 2) { IL_220: num = 26; Point3d pointXY = CAD.GetPointXY(point3d, -300.0 * scale, 300.0 * scale); IL_244: num = 27; array2[(int)(checked (num6 + 1))] = Class36.smethod_57(array[(int)num6], CAD.GetPointXY(pointXY, -800.0 * scale, (double)(checked (400 * num6 + 100)) * scale), 300.0 * scale, 0, 0, "STANDARD", 0.0); } else { IL_2A4: num = 29; if (this.short_0 == 3) { IL_2B5: num = 30; Point3d pointXY = CAD.GetPointXY(point3d, -300.0 * scale, -300.0 * scale); IL_2D9: num = 31; array2[(int)(checked (num6 + 1))] = Class36.smethod_57(array[(int)num6], CAD.GetPointXY(pointXY, -800.0 * scale, (double)(checked (0 - (400 * num6 + 100 + 300))) * scale), 300.0 * scale, 0, 0, "STANDARD", 0.0); } else { IL_341: num = 33; if (this.short_0 == 4) { IL_352: num = 34; Point3d pointXY = CAD.GetPointXY(point3d, 300.0 * scale, -300.0 * scale); IL_376: num = 35; array2[(int)(checked (num6 + 1))] = Class36.smethod_57(array[(int)num6], CAD.GetPointXY(pointXY, 800.0 * scale, (double)(checked (0 - (400 * num6 + 100 + 300))) * scale), 300.0 * scale, 2, 0, "STANDARD", 0.0); } } } } IL_3D9: num = 37; num6 += 1; } IL_3E8: num = 38; JigEntIDs jigEntIDs = new JigEntIDs(); IL_3F2: num = 39; JigEntIDs jigEntIDs2 = jigEntIDs; ObjectId[] entIDs = array2; Point3d basePoint; basePoint..ctor(0.0, 0.0, 0.0); jigEntIDs2.method_0(entIDs, basePoint); IL_423: num = 40; Class36.smethod_55(array2); goto IL_77A; IL_433: num = 42; IL_436: num = 43; string text3 = this.TextBox1.Text; IL_446: num = 44; double num9 = Conversion.Val(text3); IL_452: num = 45; ObjectId[] array3 = new ObjectId[2]; IL_45C: num = 46; Point3d point = CAD.GetPoint("选择插入点: "); IL_46B: num = 47; Point3d point3d2; if (!(point != point3d2)) { goto IL_7B0; } IL_47C: num = 48; bool flag = true; for (;;) { IL_75E: num = 53; bool flag2; Point3d point3d_; if (flag2) { IL_743: num = 54; flag = (Class36.smethod_29(point3d_, ref point, "选择下一点: ") != 0); } else { IL_487: num = 56; if (!flag2) { IL_491: num = 57; point3d_ = point; } } IL_498: num = 59; if (!flag) { break; } IL_4A2: num = 60; array3[0] = Class36.smethod_81(point, (int)this.short_0, scale).ObjectId; IL_4C5: num = 61; num9 += (point.Y - point3d_.Y) / 1000.0; IL_4E6: num = 62; string string_; if (num9 == 0.0) { IL_4F8: num = 63; string_ = "%%p0.000"; } else { IL_503: num = 65; IL_506: num = 66; string_ = string.Format("{0:0.000}", num9); } IL_51B: num = 68; if (this.short_0 == 1) { IL_529: num = 69; Point3d pointXY2 = CAD.GetPointXY(point, 300.0 * scale, 300.0 * scale); IL_54C: num = 70; array3[1] = Class36.smethod_57(string_, CAD.GetPointXY(pointXY2, 800.0 * scale, 100.0 * scale), 300.0 * scale, 2, 0, "STANDARD", 0.0); } else { IL_5A0: num = 72; if (this.short_0 == 2) { IL_5AE: num = 73; Point3d pointXY2 = CAD.GetPointXY(point, -300.0 * scale, 300.0 * scale); IL_5D1: num = 74; array3[1] = Class36.smethod_57(string_, CAD.GetPointXY(pointXY2, -800.0 * scale, 100.0 * scale), 300.0 * scale, 0, 0, "STANDARD", 0.0); } else { IL_625: num = 76; if (this.short_0 == 3) { IL_633: num = 77; Point3d pointXY2 = CAD.GetPointXY(point, -300.0 * scale, -300.0 * scale); IL_656: num = 78; array3[1] = Class36.smethod_57(string_, CAD.GetPointXY(pointXY2, -800.0 * scale, -400.0 * scale), 300.0 * scale, 0, 0, "STANDARD", 0.0); } else { IL_6AA: num = 80; if (this.short_0 == 4) { IL_6B8: num = 81; Point3d pointXY2 = CAD.GetPointXY(point, 300.0 * scale, -300.0 * scale); IL_6DB: num = 82; array3[1] = Class36.smethod_57(string_, CAD.GetPointXY(pointXY2, 800.0 * scale, -400.0 * scale), 300.0 * scale, 2, 0, "STANDARD", 0.0); } } } } IL_72A: num = 84; Class36.smethod_55(array3); IL_734: num = 85; point3d_ = point; IL_73B: num = 86; flag2 = true; } IL_76A: num = 89; IL_76D: num = 90; Information.Err().Clear(); goto IL_77A; IL_7B0: num = 50; IL_7B3: goto IL_99C; IL_77A: num = 94; if (Information.Err().Number <= 0) { goto IL_7A1; } IL_78C: num = 95; Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null); IL_7A1: num = 97; documentLock.Dispose(); IL_7AB: goto IL_99C; IL_7B8: int num10 = num11 + 1; num11 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num10); IL_950: goto IL_991; IL_952: num11 = num; if (num2 <= -2) { goto IL_7B8; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num2); IL_96D :; } catch when(endfilter(obj is Exception & num2 != 0 & num11 == 0)) { Exception ex = (Exception)obj2; goto IL_952; } IL_991: throw ProjectData.CreateProjectError(-2146828237); IL_99C: if (num11 != 0) { ProjectData.ClearProjectError(); } }
private void ActTmp() { DataRow row; long num; SqlDataReader reader; DateTime time2; DateTime time3; string str4; DataSet dataSet = new DataSet(); DataSet set2 = new DataSet(); this.cmbSalir.Enabled = false; this.cmbVolver.Enabled = false; SqlConnection connection = new SqlConnection("data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096"); connection.Open(); SqlConnection connection2 = new SqlConnection("data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"); connection2.Open(); int num4 = new SqlCommand("delete " + Variables.gTermi + "TmpCalendario", connection2).ExecuteNonQuery(); SqlCommand command4 = new SqlCommand("delete " + Variables.gTermi + "TmpCalendarioStkComp", connection2); num4 = command4.ExecuteNonQuery(); string str = "SELECT OR01001,OR01004,OR01016,OR01050,OR03002,OR03005,OR03006,OR03007,OR03011,OR03012,OR03051,OR04002,OR04003,OR04004,OR04005,OR04008 FROM dbo.OR010100 inner join OR030100 on OR010100.OR01001=OR030100.OR03001 inner join OR040100 on OR010100.OR01001=OR040100.OR04001 where OR010100.OR01002=6 and OR010100.OR01091=0 and OR03011-OR03012<>0 and OR03034=1 and ("; if (Variables.gIntr01) { str = str + "OR01004='INTR01' "; if (Variables.gIntr02) { str = str + "or OR01004='INTR02' "; } if (Variables.gIntr03) { str = str + "or OR01004='INTR03' "; } if (Variables.gIntr04) { str = str + "or OR01004='INTR04' "; } } else if (Variables.gIntr02) { str = str + "OR01004='INTR02' "; if (Variables.gIntr03) { str = str + "or OR01004='INTR03' "; } if (Variables.gIntr04) { str = str + "or OR01004='INTR04' "; } } else if (Variables.gIntr03) { str = str + "OR01004='INTR03' "; if (Variables.gIntr04) { str = str + "or OR01004='INTR04' "; } } else if (Variables.gIntr04) { str = str + "OR01004='INTR04' "; } SqlCommand command3 = new SqlCommand(str + ") order by OR010100.OR01016", connection); command3.CommandTimeout = 900; dataSet.Clear(); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = command3; adapter.Fill(dataSet, "OR010100"); long num9 = dataSet.Tables["OR010100"].Rows.Count - 1; for (num = 0L; num <= num9; num += 1L) { row = dataSet.Tables["OR010100"].Rows[(int)num]; str4 = "insert into " + Variables.gTermi + "TmpCalendario (FechaEnt,Cliente,ListaRec,NroOA,NroLinea,Codigo,Descripcion,Almacen,Cantidad,AsignadoA,Observaciones,ReqEsp,Horas,SinStock,Obs) values ("; CalcDates dates = new CalcDatesClass(); short daysToDue = 0; DataRow row3 = row; string str9 = "OR01016"; DateTime currentDate = DateType.FromObject(row3[str9]); string dayCountType = "H"; string company = "01"; dates.WeekDate(ref daysToDue, ref currentDate, ref dayCountType, ref company); row3[str9] = currentDate; str4 = 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((str4 + "'" + Strings.Format(dates.MidDate, "MM/dd/yyyy")) + "','", row["OR01004"]), "','"), row["OR03051"]), "','"), row["OR01001"]), "','"), row["OR03002"]), "','"), row["OR03005"]), "','"), row["OR03006"]), " "), row["OR03007"]), "','"), row["OR01050"]), "',"), ObjectType.SubObj(row["OR03011"], row["OR03012"])), ",")); if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04002"])), "0", false) == 0) { str4 = str4 + "'',"; } else { str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04002"]), "',")); } if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04003"])), "0", false) == 0) { if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04004"])), "0", false) == 0) { str4 = str4 + "'',"; } else { str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04004"]), "',")); } } else if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04004"])), "0", false) == 0) { str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04003"]), "',")); } else { str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04003"]), " "), row["OR04004"]), "',")); } if (StringType.StrCmp(Strings.Trim(StringType.FromObject(row["OR04005"])), "0", false) == 0) { str4 = str4 + "'',"; } else { str4 = StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04005"]), "',")); } command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(str4 + "'", row["OR04008"]), "',0,0)")), connection2); try { num4 = command4.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.cmbSalir.Enabled = true; this.cmbVolver.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } command3 = new SqlCommand("SELECT distinct NroOA from " + Variables.gTermi + "TmpCalendario", connection2); command3.CommandTimeout = 900; dataSet.Clear(); adapter = new SqlDataAdapter(); adapter.SelectCommand = command3; adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario"); long num7 = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count - 1; for (num = 0L; num <= num7; num += 1L) { row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[(int)num]; SqlCommand command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT * from GesEnsObs where NroOE='", row["NroOA"]), "'")), connection2); reader = command.ExecuteReader(); if (reader.Read()) { reader.Close(); command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("update " + Variables.gTermi + "TmpCalendario set Obs=1 where NroOA='", row["NroOA"]), "'")), connection2); try { num4 = command4.ExecuteNonQuery(); } catch (Exception exception8) { ProjectData.SetProjectError(exception8); Exception exception2 = exception8; Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, 0, null); connection.Close(); connection2.Close(); this.cmbSalir.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } else { reader.Close(); } } command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpCalendario order by FechaEnt", connection2); command3.CommandTimeout = 900; dataSet.Clear(); adapter = new SqlDataAdapter(); adapter.SelectCommand = command3; adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario"); if (dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count != 0) { row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[0]; if (DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), 1) > 1) { time3 = DateAndTime.DateAdd(4, (double)((DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), 1) - 1) * -1), DateType.FromObject(row["FechaEnt"])); } else { time3 = DateType.FromObject(row["FechaEnt"]); } } command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpCalendario order by FechaEnt desc", connection2); command3.CommandTimeout = 900; dataSet.Clear(); adapter = new SqlDataAdapter(); adapter.SelectCommand = command3; adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario"); if (dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count != 0) { row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[0]; if (DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), 1) < 7) { time2 = DateAndTime.DateAdd(4, (double)(7 - DateAndTime.Weekday(DateType.FromObject(row["FechaEnt"]), 1)), DateType.FromObject(row["FechaEnt"])); } else { time2 = DateType.FromObject(row["FechaEnt"]); } } while (DateTime.Compare(time3, time2) <= 0) { SqlCommand command2 = new SqlCommand("SELECT * FROM " + Variables.gTermi + "TmpCalendario where FechaEnt='" + Strings.Format(time3, "MM/dd/yyyy") + "'", connection2); reader = command2.ExecuteReader(); if (reader.Read()) { reader.Close(); } else { reader.Close(); reader = new SqlCommand("SELECT * FROM dbo.SYHO0100 where SYHO001='" + Strings.Format(time3, "MM/dd/yyyy") + "'", connection).ExecuteReader(); if (reader.Read()) { command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj((("insert into " + Variables.gTermi + "TmpCalendario (FechaEnt,Observaciones) values (") + "'" + Strings.Format(time3, "MM/dd/yyyy") + "',") + "'", reader["SYHO002"]), "')")), connection2); reader.Close(); } else { command4 = new SqlCommand(("insert into " + Variables.gTermi + "TmpCalendario (FechaEnt) values (") + "'" + Strings.Format(time3, "MM/dd/yyyy") + "')", connection2); reader.Close(); } try { num4 = command4.ExecuteNonQuery(); } catch (Exception exception9) { ProjectData.SetProjectError(exception9); Exception exception3 = exception9; Interaction.MsgBox("Se ha producido el siguiente error:" + exception3.Message, 0, null); connection.Close(); connection2.Close(); this.cmbSalir.Enabled = true; this.cmbVolver.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } time3 = DateAndTime.DateAdd(4, 1.0, time3); } command3 = new SqlCommand("SELECT * from " + Variables.gTermi + "TmpCalendario where not Codigo is null order by NroOA,NroLinea", connection2); command3.CommandTimeout = 900; dataSet.Clear(); adapter = new SqlDataAdapter(); adapter.SelectCommand = command3; adapter.Fill(dataSet, Variables.gTermi + "TmpCalendario"); long num6 = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows.Count - 1; for (num = 0L; num <= num6; num += 1L) { row = dataSet.Tables[Variables.gTermi + "TmpCalendario"].Rows[(int)num]; command3 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT OR03005,OR03006,OR03007,OR03011,OR03012,SC03003,SC03004,SC03005 FROM dbo.OR030100 inner join SC030100 on OR030100.OR03005=SC030100.SC03001 where OR03001='", row["NroOA"]), "' and OR03002='"), row["NroLinea"]), "' and OR03003<>'000' and SC03002='"), row["Almacen"]), "'")), connection); command3.CommandTimeout = 900; set2.Clear(); SqlDataAdapter adapter2 = new SqlDataAdapter(); adapter2.SelectCommand = command3; adapter2.Fill(set2, "OR030100"); bool flag = false; long num5 = set2.Tables["OR030100"].Rows.Count - 1; for (long i = 0L; i <= num5; i += 1L) { DataRow row2 = set2.Tables["OR030100"].Rows[(int)i]; if (BooleanType.FromObject(ObjectType.BitOrObj(ObjectType.ObjTst(row2["SC03003"], 0, false) <= 0, ObjectType.ObjTst(ObjectType.AddObj(row2["SC03004"], row2["SC03005"]), row2["SC03003"], false) > 0))) { flag = true; } if (ObjectType.ObjTst(ObjectType.AddObj(row2["SC03004"], row2["SC03005"]), row2["SC03003"], false) > 0) { reader = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("SELECT PC03043,PC03044,PC03016 FROM dbo.PC030100 where PC03005='", row2["OR03005"]), "' and PC03043<PC03044 and PC03029=1 ")) + "and PC03035='", row["Almacen"]), "' order by PC03016")), connection).ExecuteReader(); if (reader.Read()) { str4 = 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("insert into " + Variables.gTermi + "TmpCalendarioStkComp (NroOA,NroLinea,CodComp,DescComp,Cantidad,StkFisico,StkComprometido,FechaOC,CantOC) values ('", row["NroOA"]), "','"), row["NroLinea"]), "','"), row2["OR03005"]), "','"), row2["OR03006"]), " "), row2["OR03007"]), "',"), ObjectType.SubObj(row2["OR03011"], row2["OR03012"])), ","), row2["SC03003"]), ","), ObjectType.AddObj(row2["SC03004"], row2["SC03005"])), ",'"), Strings.Format(RuntimeHelpers.GetObjectValue(reader["PC03016"]), "MM/dd/yyyy")), "',"), ObjectType.SubObj(reader["PC03044"], reader["PC03043"])), ")")); reader.Close(); command4 = new SqlCommand(str4, connection2); try { num4 = command4.ExecuteNonQuery(); } catch (Exception exception10) { ProjectData.SetProjectError(exception10); Exception exception4 = exception10; Interaction.MsgBox("Se ha producido el siguiente error:" + exception4.Message, 0, null); connection.Close(); connection2.Close(); this.cmbSalir.Enabled = true; this.cmbVolver.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } else { reader.Close(); command4 = 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("insert into " + Variables.gTermi + "TmpCalendarioStkComp (NroOA,NroLinea,CodComp,DescComp,Cantidad,StkFisico,StkComprometido) values ('", row["NroOA"]), "','"), row["NroLinea"]), "','"), row2["OR03005"]), "','"), row2["OR03006"]), " "), row2["OR03007"]), "',"), ObjectType.SubObj(row2["OR03011"], row2["OR03012"])), ","), row2["SC03003"]), ","), ObjectType.AddObj(row2["SC03004"], row2["SC03005"])), ")")), connection2); try { num4 = command4.ExecuteNonQuery(); } catch (Exception exception11) { ProjectData.SetProjectError(exception11); Exception exception5 = exception11; Interaction.MsgBox("Se ha producido el siguiente error:" + exception5.Message, 0, null); connection.Close(); connection2.Close(); this.cmbSalir.Enabled = true; this.cmbVolver.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } } else { command4 = 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("insert into " + Variables.gTermi + "TmpCalendarioStkComp (NroOA,NroLinea,CodComp,DescComp,Cantidad,StkFisico,StkComprometido) values ('", row["NroOA"]), "','"), row["NroLinea"]), "','"), row2["OR03005"]), "','"), row2["OR03006"]), " "), row2["OR03007"]), "',"), ObjectType.SubObj(row2["OR03011"], row2["OR03012"])), ","), row2["SC03003"]), ","), ObjectType.AddObj(row2["SC03004"], row2["SC03005"])), ")")), connection2); try { num4 = command4.ExecuteNonQuery(); } catch (Exception exception12) { ProjectData.SetProjectError(exception12); Exception exception6 = exception12; Interaction.MsgBox("Se ha producido el siguiente error:" + exception6.Message, 0, null); connection.Close(); connection2.Close(); this.cmbSalir.Enabled = true; this.cmbVolver.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } } if (flag) { command4 = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("update " + Variables.gTermi + "TmpCalendario set SinStock=1 where NroOA='", row["NroOA"]), "'")), connection2); try { num4 = command4.ExecuteNonQuery(); } catch (Exception exception13) { ProjectData.SetProjectError(exception13); Exception exception7 = exception13; Interaction.MsgBox("Se ha producido el siguiente error:" + exception7.Message, 0, null); connection.Close(); connection2.Close(); this.cmbSalir.Enabled = true; this.cmbVolver.Enabled = true; ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } } connection.Close(); connection2.Close(); }
private void CloseButton_Click(object eventSender, EventArgs eventArgs) { try { if (mdUtility.get_MstrTable("SelectedCrit") != null && mdUtility.get_MstrTable("SelectedCrit").Rows.Count > 0) { try { foreach (DataRow row in mdUtility.get_MstrTable("SelectedCrit").Rows) { if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(row["subcomplink"], (object)this.SubCompLink, false)) { row["CritStatus"] = (object)"D"; } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } mdUtility.get_MstrTable("SelectedCrit").AcceptChanges(); } else { mdUtility.LoadMstrTable("SelectedCrit", "SELECT 'ID' as ID, 'Criterion' as Criterion, 'subcomplink' as subcomplink, 'CritStatus' as CritStatus, 'SampSubCompID' as SampSubCompID"); } DataTable dataTable = mdUtility.get_MstrTable("SelectedCrit"); ListView.CheckedListViewItemCollection checkedItems = this.CritListView.CheckedItems; try { foreach (ListViewItem listViewItem in checkedItems) { DataRow row = dataTable.NewRow(); row["ID"] = (object)listViewItem.SubItems[1].Text; row["Criterion"] = (object)listViewItem.Text; row["subcomplink"] = (object)listViewItem.SubItems[2].Text; row["CritStatus"] = (object)"N"; row["SampSubCompID"] = (object)this.SampSubCompID; dataTable.Rows.Add(row); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } this.Close(); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); Exception ex2 = ex1; if (Information.Err().Number != -2147217842) { mdUtility.Errorhandler(ex2, nameof(frmCriteria), nameof(CloseButton_Click)); } ProjectData.ClearProjectError(); } }
// Methods public int Compare(object x, object y) { int num = 0; ListViewItem item = (ListViewItem)x; ListViewItem item2 = (ListViewItem)y; switch (this.mSortType) { case LVSortDataType.TextCaseSensitive: if (!this.mAscending) { return(string.Compare(item2.SubItems[this.mSortColumn].Text, item.SubItems[this.mSortColumn].Text)); } return(string.Compare(item.SubItems[this.mSortColumn].Text, item2.SubItems[this.mSortColumn].Text)); case LVSortDataType.TextIgnoreCase: if (!this.mAscending) { return(string.Compare(item2.SubItems[this.mSortColumn].Text, item.SubItems[this.mSortColumn].Text, true)); } return(string.Compare(item.SubItems[this.mSortColumn].Text, item2.SubItems[this.mSortColumn].Text, true)); case LVSortDataType.Numbers: try { if (this.mAscending) { return((int)Math.Round((double)(Conversions.ToDouble(item.SubItems[this.mSortColumn].Text) - Conversions.ToDouble(item2.SubItems[this.mSortColumn].Text)))); } num = (int)Math.Round((double)(Conversions.ToDouble(item2.SubItems[this.mSortColumn].Text) - Conversions.ToDouble(item.SubItems[this.mSortColumn].Text))); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; num = 0; ProjectData.ClearProjectError(); } return(num); case (LVSortDataType.Numbers | LVSortDataType.TextIgnoreCase): return(num); case LVSortDataType.Dates: try { if (this.mAscending) { return((int)DateAndTime.DateDiff(DateInterval.Day, Conversions.ToDate(item2.SubItems[this.mSortColumn].Text), Conversions.ToDate(item.SubItems[this.mSortColumn].Text), FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1)); } num = (int)DateAndTime.DateDiff(DateInterval.Day, Conversions.ToDate(item.SubItems[this.mSortColumn].Text), Conversions.ToDate(item2.SubItems[this.mSortColumn].Text), FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1); } catch (Exception exception3) { ProjectData.SetProjectError(exception3); Exception exception2 = exception3; num = 0; ProjectData.ClearProjectError(); } return(num); } return(num); }
public void TcQLJ() { int num; int num4; object obj; try { IL_01: ProjectData.ClearProjectError(); num = -2; IL_09: int num2 = 2; Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; IL_16: num2 = 3; Database database = mdiActiveDocument.Database; IL_1F: num2 = 4; using (Transaction transaction = database.TransactionManager.StartTransaction()) { TypedValue[] array = new TypedValue[1]; Array array2 = array; TypedValue typedValue; typedValue..ctor(0, "LWPOLYLINE"); array2.SetValue(typedValue, 0); SelectionFilter selectionFilter = new SelectionFilter(array); PromptSelectionResult selection = mdiActiveDocument.Editor.GetSelection(selectionFilter); if (selection.Status == 5100) { SelectionSet value = selection.Value; if (value.Count == 1) { goto IL_285; } Entity e = null; Entity e2 = null; if (value.Count > 2) { e = (Entity)transaction.GetObject(value[0].ObjectId, 0); e2 = (Entity)transaction.GetObject(value[checked (value.Count - 1)].ObjectId, 0); } else if (value.Count == 2) { e = (Entity)transaction.GetObject(value[0].ObjectId, 0); e2 = (Entity)transaction.GetObject(value[1].ObjectId, 0); } Point3d point3d = CAD.GetEntCenter(e); Point3d point3d2 = CAD.GetEntCenter(e2); if (point3d.X > point3d2.X) { Point3d point3d3 = point3d; point3d = point3d2; point3d2 = point3d3; } else if (point3d.X == point3d2.X & point3d.Y > point3d2.Y) { Point3d point3d4 = point3d; point3d = point3d2; point3d2 = point3d4; } if (Class36.double_0 == 0.0) { Class36.double_0 = 4.0; } Class36.smethod_13(point3d, point3d2, Class36.double_0 / 2.0); } transaction.Commit(); } IL_1E4: num2 = 6; if (Information.Err().Number <= 0) { goto IL_209; } IL_1F5: num2 = 7; Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null); IL_209: goto IL_285; IL_20B: int num3 = num4 + 1; num4 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3); IL_23F: goto IL_27A; IL_241: num4 = num2; if (num <= -2) { goto IL_20B; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); IL_257 :; } catch when(endfilter(obj is Exception & num != 0 & num4 == 0)) { Exception ex = (Exception)obj2; goto IL_241; } IL_27A: throw ProjectData.CreateProjectError(-2146828237); IL_285: if (num4 != 0) { ProjectData.ClearProjectError(); } }
private void Regenerate(object state) { if (RegenerationWorking) { WorldServiceLocator._WorldServer.Log.WriteLine(LogType.WARNING, "Update: Regenerator skipping update"); return; } RegenerationWorking = true; NextGroupUpdate = !NextGroupUpdate; checked { try { WorldServiceLocator._WorldServer.CHARACTERs_Lock.AcquireReaderLock(WorldServiceLocator._Global_Constants.DEFAULT_LOCK_TIMEOUT); foreach (KeyValuePair <ulong, WS_PlayerData.CharacterObject> Character in WorldServiceLocator._WorldServer.CHARACTERs) { if (Character.Value.DEAD || Character.Value.underWaterTimer != null || Character.Value.LogoutTimer != null || Character.Value.client == null) { continue; } WS_PlayerData.CharacterObject value = Character.Value; BaseMana = value.Mana.Current; BaseRage = value.Rage.Current; BaseEnergy = value.Energy.Current; BaseLife = value.Life.Current; _updateFlag = false; if (value.ManaType == ManaTypes.TYPE_RAGE) { switch (value.cUnitFlags & 0x80000) { case 0: if (value.Rage.Current > 0) { value.Rage.Current -= 25; } break; default: if (value.RageRegenBonus != 0) { value.Rage.Increment(value.RageRegenBonus); } break; } } if (value.ManaType == ManaTypes.TYPE_ENERGY && value.Energy.Current < value.Energy.Maximum) { value.Energy.Increment(20); } if (value.ManaRegen == 0) { value.UpdateManaRegen(); } if (value.spellCastManaRegeneration == 0) { if ((value.ManaType == ManaTypes.TYPE_MANA || value.Classe == Classes.CLASS_DRUID) && value.Mana.Current < value.Mana.Maximum) { value.Mana.Increment(value.ManaRegen * 2); } } else { if ((value.ManaType == ManaTypes.TYPE_MANA || value.Classe == Classes.CLASS_DRUID) && value.Mana.Current < value.Mana.Maximum) { value.Mana.Increment(value.ManaRegenInterrupt * 2); } if (value.spellCastManaRegeneration < 2) { value.spellCastManaRegeneration = 0; } else { value.spellCastManaRegeneration -= 2; } } if (value.Life.Current < value.Life.Maximum && (value.cUnitFlags & 0x80000) == 0) { switch (value.Classe) { case Classes.CLASS_MAGE: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.1 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_PRIEST: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.1 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_WARLOCK: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.11 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_DRUID: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.11 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_SHAMAN: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.11 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_ROGUE: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.5 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_WARRIOR: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.8 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_HUNTER: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.25 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; case Classes.CLASS_PALADIN: value.Life.Increment((int)Math.Round(value.Spirit.Base * 0.25 * value.LifeRegenerationModifier) + value.LifeRegenBonus); break; } } if (BaseMana != value.Mana.Current) { _updateFlag = true; value.GroupUpdateFlag |= 16u; value.SetUpdateFlag(23, value.Mana.Current); } if ((BaseRage != value.Rage.Current) | ((value.cUnitFlags & 0x80000) == 0x80000)) { _updateFlag = true; value.GroupUpdateFlag |= 16u; value.SetUpdateFlag(24, value.Rage.Current); } if (BaseEnergy != value.Energy.Current) { _updateFlag = true; value.GroupUpdateFlag |= 16u; value.SetUpdateFlag(26, value.Energy.Current); } if (BaseLife != value.Life.Current) { _updateFlag = true; value.SetUpdateFlag(22, value.Life.Current); value.GroupUpdateFlag |= 2u; } if (_updateFlag) { value.SendCharacterUpdate(); } if (value.DuelOutOfBounds != 11) { value.DuelOutOfBounds -= 2; if (value.DuelOutOfBounds == 0) { WorldServiceLocator._WS_Spells.DuelComplete(ref value.DuelPartner, ref value.client.Character); } } value.CheckCombat(); if (NextGroupUpdate) { value.GroupUpdate(); } if (value.guidsForRemoving.Count > 0) { value.SendOutOfRangeUpdate(); } value = null; } if (WorldServiceLocator._WorldServer.CHARACTERs_Lock.IsReaderLockHeld) { WorldServiceLocator._WorldServer.CHARACTERs_Lock.ReleaseReaderLock(); } } catch (Exception ex2) { ProjectData.SetProjectError(ex2); Exception ex = ex2; WorldServiceLocator._WorldServer.Log.WriteLine(LogType.WARNING, "Error at regenerate.{0}", Environment.NewLine + ex); ProjectData.ClearProjectError(); } RegenerationWorking = false; } }
private void CrystalReportViewer1_ReportRefresh(object source, ViewerEventArgs e) { SqlDataAdapter adapter2; SqlCommand command2; DataRow row; DataRow row2; int num; int num3; this.cmbSalir.Enabled = false; this.Informe.Close(); string connectionString = "data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"; SqlConnection connection2 = new SqlConnection(connectionString); connection2.Open(); string str6 = "data source=" + Variables.gServer + ";user id=scala;password=scala;initial catalog=scalaDB;persist security info=False;packet size=4096"; SqlConnection connection = new SqlConnection(str6); connection.Open(); this.DS.Clear(); string selectCommandText = "select * from PrepPed where ContFinal='S' and NroRemito is null"; new SqlDataAdapter(selectCommandText, connectionString).Fill(this.DS, "PrepPed"); if (this.DS.Tables["PrepPed"].Rows.Count != 0) { int num7 = this.DS.Tables["PrepPed"].Rows.Count - 1; for (num = 0; num <= num7; num++) { SqlCommand command; int num2; SqlDataReader reader; row = this.DS.Tables["PrepPed"].Rows[num]; adapter2 = 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")), str6); this.DS19.Clear(); adapter2.Fill(this.DS19, "OR190100"); if (this.DS19.Tables["OR190100"].Rows.Count != 0) { int num6 = this.DS19.Tables["OR190100"].Rows.Count - 1; num2 = 0; while (num2 <= num6) { row2 = this.DS19.Tables["OR190100"].Rows[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 exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, 0, null); connection2.Close(); connection.Close(); this.Close(); ProjectData.ClearProjectError(); } break; } num2++; } } else if (ObjectType.ObjTst(row["Producto"], 1, false) == 0) { command = new SqlCommand(StringType.FromObject(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<>'000' and OR19011='"), Strings.Format(RuntimeHelpers.GetObjectValue(row["FechaPrep"]), "MM/dd/yyyy")), "' and OR19012<>'' order by OR19012")), connection); reader = command.ExecuteReader(); if (reader.Read()) { try { string cmdText = 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='", reader["OR19012"]), "' where NroOV='"), row["NroOV"]), "' and NroLinea='"), row["NroLinea"]), "' and TipoLinea="), row["TipoLinea"]), " and EstLinea='"), row["EstLinea"]), "' and NroRemito is null")); reader.Close(); command2 = new SqlCommand(cmdText, connection2); num3 = command2.ExecuteNonQuery(); } catch (Exception exception6) { ProjectData.SetProjectError(exception6); Exception exception2 = exception6; Interaction.MsgBox("Se ha producido el siguiente error:" + exception2.Message, 0, null); this.cmbSalir.Enabled = true; connection2.Close(); connection.Close(); this.Close(); ProjectData.ClearProjectError(); } } else { reader.Close(); } } else { adapter2 = 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")), str6); this.DS20.Clear(); adapter2.Fill(this.DS20, "OR230100"); if (this.DS20.Tables["OR230100"].Rows.Count != 0) { int num5 = this.DS20.Tables["OR230100"].Rows.Count - 1; for (num2 = 0; num2 <= num5; num2++) { row2 = this.DS20.Tables["OR230100"].Rows[num2]; reader = 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).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 exception7) { ProjectData.SetProjectError(exception7); Exception exception3 = exception7; Interaction.MsgBox("Se ha producido el siguiente error:" + exception3.Message, 0, null); connection2.Close(); this.Close(); ProjectData.ClearProjectError(); } break; } } } } } } selectCommandText = "select NroOV from PrepPed where ContFinal='S' and Expedicion='N' group by NroOV"; new SqlDataAdapter(selectCommandText, connectionString).Fill(this.DS, "PrepPed"); if (this.DS.Tables["PrepPed"].Rows.Count != 0) { int num4 = this.DS.Tables["PrepPed"].Rows.Count - 1; for (num = 0; num <= num4; num++) { row = this.DS.Tables["PrepPed"].Rows[num]; adapter2 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR01015,OR01072 from OR010100 where OR01001='", row["NroOV"]), "'")), str6); this.DS19.Clear(); adapter2.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 exception8) { ProjectData.SetProjectError(exception8); Exception exception4 = exception8; Interaction.MsgBox("Se ha producido el siguiente error:" + exception4.Message, 0, null); connection2.Close(); this.Close(); ProjectData.ClearProjectError(); } } else { adapter2 = new SqlDataAdapter(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj("select OR20015,OR20072 from OR200100 where OR20001='", row["NroOV"]), "'")), str6); this.DS20.Clear(); adapter2.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 exception9) { ProjectData.SetProjectError(exception9); Exception exception5 = exception9; Interaction.MsgBox("Se ha producido el siguiente error:" + exception5.Message, 0, null); connection2.Close(); this.Close(); ProjectData.ClearProjectError(); } } } } } connection2.Close(); connectionString = "data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"; this.AdapProdPend = new SqlDataAdapter("Select NroOV,NroLinea,EstLinea,Codigo,Desc1,Desc2,CantOrden,CantPrep,FechaPrep,NroRemito,Cliente,NomCli,OCompra,FechaOV from PrepPed where ContFinal='S' and Expedicion='N'", connectionString); this.DS.Clear(); this.AdapProdPend.Fill(this.DS, "PrepPed"); if (Variables.gOrdenProdPend == 1) { this.CrystalReportViewer1.set_ShowGroupTreeButton(true); this.Informe.Load(Application.StartupPath + @"\reprmcont.rpt"); } else if (Variables.gOrdenProdPend == 2) { this.CrystalReportViewer1.set_ShowGroupTreeButton(false); this.Informe.Load(Application.StartupPath + @"\reprmcont2.rpt"); } else if (Variables.gOrdenProdPend == 3) { this.CrystalReportViewer1.set_ShowGroupTreeButton(true); this.Informe.Load(Application.StartupPath + @"\reprmcont3.rpt"); } else if (Variables.gOrdenProdPend == 4) { this.CrystalReportViewer1.set_ShowGroupTreeButton(false); this.Informe.Load(Application.StartupPath + @"\reprmcont4.rpt"); } else if (Variables.gOrdenProdPend == 5) { this.CrystalReportViewer1.set_ShowGroupTreeButton(false); this.Informe.Load(Application.StartupPath + @"\reprmcont5.rpt"); } this.Informe.SetDataSource(this.DS); this.CrystalReportViewer1.set_ReportSource(this.Informe); this.CrystalReportViewer1.Refresh(); this.cmbSalir.Enabled = true; }
public static void LoadAll_MailInfo() { try { string path = Application.StartupPath + "\\data\\baseMail.dat"; _VARIABLES.MailInfo = new _VARIABLES.meMailInfo[1]; if (!File.Exists(path)) { return; } BinaryReader binaryReader = new BinaryReader((Stream)File.Open(path, FileMode.Open)); binaryReader.BaseStream.Seek(0L, SeekOrigin.Begin); byte[] bytes = binaryReader.ReadBytes(checked ((int)binaryReader.BaseStream.Length)); binaryReader.Close(); if (bytes.Length == 0) { return; } string[] strArray1 = Encoding.Default.GetString(bytes, 0, bytes.Length).Split('\n'); _VARIABLES.MailInfo = new _VARIABLES.meMailInfo[checked (Information.UBound((Array)strArray1, 1) + 1)]; int num1 = 1; int num2 = Information.UBound((Array)strArray1, 1); int index = num1; int num3; while (index <= num2) { string[] strArray2 = strArray1[checked (index - 1)].Split('®'); _VARIABLES.MailInfo[index].login = strArray2[0]; _VARIABLES.MailInfo[index].domain = strArray2[1]; _VARIABLES.MailInfo[index].password = strArray2[2]; _VARIABLES.MailInfo[index].Registered = Conversions.ToShort(strArray2[3]); if ((int)_VARIABLES.MailInfo[index].Registered == 2 | (int)_VARIABLES.MailInfo[index].Registered == 3) { checked { ++num3; } } _VARIABLES.MailInfo[index].RegUserData.Name = strArray2[4]; _VARIABLES.MailInfo[index].RegUserData.LastName = strArray2[5]; _VARIABLES.MailInfo[index].RegUserData.City = strArray2[6]; _VARIABLES.MailInfo[index].RegUserData.BirthDay = strArray2[7]; _VARIABLES.MailInfo[index].RegUserData.BirthMonth = strArray2[8]; _VARIABLES.MailInfo[index].RegUserData.BirthYear = strArray2[9]; _VARIABLES.MailInfo[index].RegUserData.SecretQuestion = strArray2[10]; _VARIABLES.MailInfo[index].RegUserData.SecretAnswer = strArray2[11]; _VARIABLES.MailInfo[index].RegUserData.ItsSecretQuestion = strArray2[12]; _VARIABLES.MailInfo[index].RegUserData.Sex = Conversions.ToShort(strArray2[13]); _VARIABLES.MailInfo[index].MailAmount = checked ((int)Math.Round(Conversion.Val(strArray2[14]))); _VARIABLES.MailInfo[index].DataCreateBox = strArray2[15]; _VARIABLES.MailInfo[index].comment = strArray2[16]; _VARIABLES.MailInfo[index].DomainID = checked ((short)Math.Round(Conversion.Val(strArray2[17]))); _VARIABLES.MailInfo[index].ID = checked ((int)Math.Round(Conversion.Val(strArray2[18]))); checked { ++index; } } string sText; if (num3 > 0) { _FUNCTION.clsTXT fn = _FUNCTION.FN; sText = "Загружено: " + Conversions.ToString(num3) + " зарегистрированных e-mail."; fn.TXT(ref sText); } if (checked (Information.UBound((Array)strArray1, 1) - num3) <= 0) { return; } _FUNCTION.clsTXT fn1 = _FUNCTION.FN; sText = "Загружено: " + Conversions.ToString(checked (Information.UBound((Array)strArray1, 1) - num3)) + " заготовок для регистрации."; fn1.TXT(ref sText); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception exception = ex; _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Ошибка загрузки baseMail.dat: " + exception.Message; fn.TXT(ref sText); ProjectData.ClearProjectError(); } }
private void method_3(object sender, EventArgs e) { int num; int num10; object obj; try { IL_01: ProjectData.ClearProjectError(); num = -2; IL_09: int num2 = 2; this.DataGridView1.Rows.RemoveAt(this.DataGridView1.CurrentRow.Index); IL_2B: num2 = 3; double num3 = Conversions.ToDouble(this.DataGridView1.Rows[0].Cells[2].Value); IL_54: num2 = 4; short num4 = 1; short num5 = checked ((short)(this.DataGridView1.RowCount - 1)); short num6 = num4; for (;;) { short num7 = num6; short num8 = num5; if (num7 > num8) { break; } IL_6B: num2 = 5; short num9 = Conversions.ToShort(this.DataGridView1.Rows[(int)(checked (num6 - 1))].Cells[1].Value); IL_98: num2 = 6; num3 += (double)num9 / 1000.0; IL_AA: num2 = 7; this.DataGridView1.Rows[(int)num6].Cells[2].Value = Strings.Format(num3, "0.000"); IL_DE: num2 = 8; num6 += 1; } IL_F4: goto IL_165; IL_F6: goto IL_16F; IL_F8: num10 = num2; if (num <= -2) { goto IL_10F; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); goto IL_143; IL_10F: int num11 = num10 + 1; num10 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num11); IL_143: goto IL_16F; } catch when(endfilter(obj is Exception & num != 0 & num10 == 0)) { Exception ex = (Exception)obj2; goto IL_F8; } IL_165: if (num10 != 0) { ProjectData.ClearProjectError(); } return; IL_16F: throw ProjectData.CreateProjectError(-2146828237); }
public static void LoadProxy() { try { string FullPath = Application.StartupPath + "\\data\\proxy.txt"; _VARIABLES.Proxy = new myProxy[1]; if (File.Exists(FullPath)) { string str1 = _LOADSAVE.FileLoad(ref FullPath); if (str1 != null && str1.Length != 0) { string[] strArray1 = Strings.Split(str1.Replace("\r", ""), "\n", -1, CompareMethod.Binary); _VARIABLES.Proxy = new myProxy[checked (Information.UBound((Array)strArray1, 1) + 1 + 1)]; int index1 = 0; string str2 = string.Empty; string str3 = string.Empty; int num1 = 8080; ProtocolProxy protocolProxy = ProtocolProxy.HTTP; int[] numArray1 = new int[5]; int num2 = 0; int num3 = 0; int num4 = Information.UBound((Array)strArray1, 1); int index2 = num3; while (index2 <= num4) { if (strArray1[index2].Length != 0) { string[] strArray2 = strArray1[index2].Split('\''); if (strArray2[0].Length != 0) { strArray2[0] = Strings.Replace(strArray2[0], " ", "", 1, -1, CompareMethod.Binary); strArray2[0] = Strings.Replace(strArray2[0], "\t", "", 1, -1, CompareMethod.Binary); if (!Information.IsNothing((object)strArray2[0])) { if (Operators.CompareString(Strings.LCase(Strings.Left(strArray2[0], 6)), "login="******"password="******"port=", false) == 0) { num1 = checked ((int)Math.Round(Conversion.Val(Strings.Right(strArray2[0], Strings.Len(strArray2[0]) - 5)))); } else if (Operators.CompareString(Strings.LCase(Strings.Left(strArray2[0], 9)), "protocol=", false) == 0) { string lower = Strings.Right(strArray2[0], checked (Strings.Len(strArray2[0]) - 9)).ToLower(); string Left = lower; if (Operators.CompareString(Left, "http", false) == 0) { protocolProxy = ProtocolProxy.HTTP; num2 = 0; } else if (Operators.CompareString(Left, "https", false) == 0) { protocolProxy = ProtocolProxy.HTTPs; num2 = 1; } else if (Operators.CompareString(Left, "socks4", false) == 0) { protocolProxy = ProtocolProxy.SOCKS4; num2 = 2; } else if (Operators.CompareString(Left, "socks4a", false) == 0) { protocolProxy = ProtocolProxy.SOCKS4a; num2 = 3; } else if (Operators.CompareString(Left, "socks5", false) == 0) { protocolProxy = ProtocolProxy.SOCKS5; num2 = 4; } else { _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Unknown protocol Proxy: " + lower; fn.TXT(ref sText); protocolProxy = ProtocolProxy.HTTP; num2 = 0; } } else if (Operators.CompareString(strArray2[0].ToLower(), "end", false) != 0) { if (Strings.InStr(strArray2[0], ".", CompareMethod.Binary) != 0) { string[] strArray3 = Strings.Split(strArray2[0], ":", -1, CompareMethod.Binary); checked { ++index1; } _VARIABLES.Proxy[index1] = new myProxy(); _VARIABLES.Proxy[index1].IP = strArray3[0]; _VARIABLES.Proxy[index1].Port = Information.UBound((Array)strArray3, 1) <= 0 ? num1 : checked ((int)Math.Round(Conversion.Val(strArray3[1]))); int[] numArray2 = numArray1; int[] numArray3 = numArray2; int index3 = num2; int index4 = index3; int num5 = checked (numArray2[index3] + 1); numArray3[index4] = num5; _VARIABLES.Proxy[index1].Login = str2; _VARIABLES.Proxy[index1].Password = str3; _VARIABLES.Proxy[index1].Protocol = protocolProxy; } } else { break; } } } } checked { ++index2; } } _VARIABLES.Proxy = (myProxy[])Utils.CopyArray((Array)_VARIABLES.Proxy, (Array) new myProxy[checked (index1 + 1)]); if (numArray1[0] > 0) { _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Загружено Proxy HTTP: " + Conversions.ToString(numArray1[0]); fn.TXT(ref sText); } if (numArray1[1] > 0) { _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Загружено Proxy HTTPs: " + Conversions.ToString(numArray1[1]); fn.TXT(ref sText); } if (numArray1[2] > 0) { _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Загружено Proxy SOCKS4: " + Conversions.ToString(numArray1[2]); fn.TXT(ref sText); } if (numArray1[3] > 0) { _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Загружено Proxy SOCKS4a: " + Conversions.ToString(numArray1[3]); fn.TXT(ref sText); } if (numArray1[4] <= 0) { return; } _FUNCTION.clsTXT fn1 = _FUNCTION.FN; string sText1 = "Загружено Proxy SOCKS5: " + Conversions.ToString(numArray1[4]); fn1.TXT(ref sText1); return; } } _FUNCTION.clsTXT fn2 = _FUNCTION.FN; string sText2 = "Proxy list is empty."; fn2.TXT(ref sText2); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception exception = ex; _FUNCTION.clsTXT fn = _FUNCTION.FN; string sText = "Ошибка загрузки proxy.txt: " + exception.Message; fn.TXT(ref sText); ProjectData.ClearProjectError(); } }
public static void DeleteBuilding(string strBuildingID) { try { mdUtility.DB.BeginTransaction(); DataTable dataTable1 = mdUtility.DB.GetDataTable("SELECT * FROM Building_System WHERE bldg_sys_bldg_id='" + strBuildingID + "'"); try { foreach (DataRow row in dataTable1.Rows) { BuildingSystem.DeleteSystem(row["bldg_sys_id"].ToString()); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } Sample.DeleteSampleLocationsForBuilding(strBuildingID); string str1 = "SELECT * FROM Facility WHERE [Facility_ID]='" + strBuildingID + "'"; DataTable dataTable2 = mdUtility.DB.GetDataTable(str1); if (Information.IsDBNull(RuntimeHelpers.GetObjectValue(dataTable2.Rows[0]["bred_status"])) || Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(dataTable2.Rows[0]["bred_status"], (object)"N", false)) { dataTable2.Rows[0]["bred_status"] = (object)"D"; } else { dataTable2.Rows[0].Delete(); } mdUtility.DB.SaveDataTable(ref dataTable2, str1); string str2 = "Select * from Organization_Facilities where Facility_ID = '" + strBuildingID + "'"; DataTable dataTable3 = mdUtility.DB.GetDataTable(str2); try { foreach (DataRow row in dataTable3.Rows) { if (Information.IsDBNull(RuntimeHelpers.GetObjectValue(row["BRED_STATUS"])) || Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(row["BRED_STATUS"], (object)"N", false)) { row["BRED_STATUS"] = (object)"D"; } else { row.Delete(); } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } mdUtility.DB.SaveDataTable(ref dataTable3, str2); string str3 = "SELECT * FROM Missing_Components WHERE Building_ID = '" + strBuildingID + "'"; DataTable dataTable4 = mdUtility.DB.GetDataTable(str3); if (dataTable4.Rows.Count > 0) { try { foreach (DataRow row in dataTable4.Rows) { row.Delete(); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } mdUtility.DB.SaveDataTable(ref dataTable4, str3); } string str4 = "SELECT * FROM ADA_Assessment WHERE Building_ID = '" + strBuildingID + "'"; DataTable dataTable5 = mdUtility.DB.GetDataTable(str4); if (dataTable5.Rows.Count > 0) { string str5 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)"SELECT * FROM ADA_Attributes WHERE ADA_Assessment_ID = '", dataTable5.Rows[0]["ADA_Assessment_ID"]), (object)"'")); DataTable dataTable6 = mdUtility.DB.GetDataTable(str5); if (dataTable6.Rows.Count > 0) { try { foreach (DataRow row in dataTable6.Rows) { row.Delete(); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } mdUtility.DB.SaveDataTable(ref dataTable6, str5); } dataTable5.Rows[0].Delete(); mdUtility.DB.SaveDataTable(ref dataTable5, str4); } mdUtility.fMainForm.tvInventory.Nodes.Remove(mdUtility.fMainForm.tvInventory.Nodes[strBuildingID]); if (mdUtility.fMainForm.tvInspection.GetNodeByKey(strBuildingID) != null) { mdUtility.fMainForm.tvInspection.Nodes.Remove(mdUtility.fMainForm.tvInspection.GetNodeByKey(strBuildingID)); mdUtility.fMainForm.tvInspection.Refresh(); } mdUtility.DB.CommitTransaction(); mdUtility.fMainForm.tvInventory.Refresh(); } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception exception = ex; if (Information.Err().Number != 35601) { mdUtility.DB.RollbackTransaction(); throw exception; } ProjectData.ClearProjectError(); } }
private void cmbAceptar_Click(object sender, EventArgs e) { DataSet set = new DataSet(); DataSet dataSet = new DataSet(); if ((StringType.StrCmp(this.editCodCli.Text, Strings.Space(0), false) != 0) && (StringType.StrCmp(this.editDescCli.Text, Strings.Space(0), false) == 0)) { Interaction.MsgBox("Cliente inexistente", 0x10, "Operador"); this.editCodCli.Focus(); } else if ((!this.rbTodas.Checked & !this.rbCliBloq.Checked) & !this.rbCliExc.Checked) { Interaction.MsgBox("Debe indicar Ordenes de Venta a listar", 0x10, "Operador"); this.rbTodas.Checked = true; } else if (!this.rbOrdenOCCliente.Checked & !this.rbOrdenFechaConf.Checked) { Interaction.MsgBox("Debe indicar orden del reporte", 0x10, "Operador"); this.rbOrdenOCCliente.Checked = true; } else { this.editCodCli.Enabled = false; this.rbTodas.Enabled = false; this.rbCliBloq.Enabled = false; this.rbCliExc.Enabled = false; this.cmbAceptar.Enabled = false; this.cmbSalir.Enabled = false; if (StringType.StrCmp(this.cbAlmacen1.Text, Strings.Space(0), false) != 0) { Variables.gAlmacen1 = Strings.Mid(StringType.FromObject(this.cbAlmacen1.SelectedValue), 1, 2); } else { Variables.gAlmacen1 = ""; } if (StringType.StrCmp(this.cbAlmacen2.Text, Strings.Space(0), false) != 0) { Variables.gAlmacen2 = Strings.Mid(StringType.FromObject(this.cbAlmacen2.SelectedValue), 1, 2); } else { Variables.gAlmacen2 = ""; } Variables.gCodCli = this.editCodCli.Text; Variables.gNomCli = this.editDescCli.Text; if (this.rbOrdenOCCliente.Checked) { Variables.gOrdenList = 1; } else if (this.rbOrdenFechaConf.Checked) { Variables.gOrdenList = 2; } if (this.rbTodas.Checked) { if ((StringType.StrCmp(Variables.gAlmacen1, "", false) != 0) & (StringType.StrCmp(Variables.gAlmacen2, "", false) == 0)) { Variables.gTipoList = "Todas las Ordenes de Venta - Almac\x00e9n " + this.cbAlmacen1.Text; } else if ((StringType.StrCmp(Variables.gAlmacen1, "", false) == 0) & (StringType.StrCmp(Variables.gAlmacen2, " ", false) != 0)) { Variables.gTipoList = "Todas las Ordenes de Venta - Almac\x00e9n " + this.cbAlmacen2.Text; } else if ((StringType.StrCmp(Variables.gAlmacen1, "", false) != 0) & (StringType.StrCmp(Variables.gAlmacen2, " ", false) != 0)) { Variables.gTipoList = "Todas las Ordenes de Venta - Almac\x00e9n " + this.cbAlmacen1.Text + " y Almac\x00e9n " + this.cbAlmacen2.Text; } else { Variables.gTipoList = "Todas las Ordenes de Venta - Todos los Almacenes"; } Variables.gOVaListar = 1; } else if (this.rbCliBloq.Checked) { if ((StringType.StrCmp(Variables.gAlmacen1, "", false) != 0) & (StringType.StrCmp(Variables.gAlmacen2, "", false) == 0)) { Variables.gTipoList = "Ordenes de Venta de clientes bloqueados - Almac\x00e9n " + Variables.gAlmacen1; } else if ((StringType.StrCmp(Variables.gAlmacen1, "", false) == 0) & (StringType.StrCmp(Variables.gAlmacen2, " ", false) != 0)) { Variables.gTipoList = "Ordenes de Venta de clientes bloqueados - Almac\x00e9n " + Variables.gAlmacen2; } else if ((StringType.StrCmp(Variables.gAlmacen1, "", false) != 0) & (StringType.StrCmp(Variables.gAlmacen2, " ", false) != 0)) { Variables.gTipoList = "Ordenes de Venta de clientes bloqueados - Almac\x00e9n " + Variables.gAlmacen1 + " y Almac\x00e9n " + Variables.gAlmacen2; } else { Variables.gTipoList = "Ordenes de Venta de clientes bloqueados - Todos los Almacenes"; } Variables.gOVaListar = 3; } else if (this.rbCliExc.Checked) { if ((StringType.StrCmp(Variables.gAlmacen1, "", false) != 0) & (StringType.StrCmp(Variables.gAlmacen2, "", false) == 0)) { Variables.gTipoList = "Ordenes de Venta de clientes excedidos en l\x00edmite de cr\x00e9dito - Almac\x00e9n " + Variables.gAlmacen1; } else if ((StringType.StrCmp(Variables.gAlmacen1, "", false) == 0) & (StringType.StrCmp(Variables.gAlmacen2, " ", false) != 0)) { Variables.gTipoList = "Ordenes de Venta de clientes excedidos en l\x00edmite de cr\x00e9dito - Almac\x00e9n " + Variables.gAlmacen2; } else if ((StringType.StrCmp(Variables.gAlmacen1, "", false) != 0) & (StringType.StrCmp(Variables.gAlmacen2, " ", false) != 0)) { Variables.gTipoList = "Ordenes de Venta de clientes excedidos en l\x00edmite de cr\x00e9dito - Almac\x00e9n " + Variables.gAlmacen1 + " y Almac\x00e9n " + Variables.gAlmacen2; } else { Variables.gTipoList = "Ordenes de Venta de clientes excedidos en l\x00edmite de cr\x00e9dito - Todos los Almacenes"; } Variables.gOVaListar = 4; } 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); SqlConnection connection2 = new SqlConnection("data source=" + Variables.gServer + ";user id=teleprinter;password=tele;initial catalog=Colector;persist security info=False;packet size=4096"); connection2.Open(); SqlCommand command = new SqlCommand("delete " + Variables.gTermi + "TmpFormaDesp", connection2); int num2 = command.ExecuteNonQuery(); string selectCommandText = "SELECT PL23003,PL23004 FROM dbo.PL230100 where PL23001='2' and PL23002='00'"; new SqlDataAdapter(selectCommandText, connectionString).Fill(dataSet, "PL230100"); long num3 = dataSet.Tables["PL230100"].Rows.Count - 1; for (long i = 0L; i <= num3; i += 1L) { DataRow row = dataSet.Tables["PL230100"].Rows[(int)i]; command = new SqlCommand(StringType.FromObject(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj(ObjectType.StrCatObj("insert into " + Variables.gTermi + "TmpFormaDesp (Codigo,Descripcion) values (", row["PL23003"]), ",'"), row["PL23004"]), "')")), connection2); try { command.ExecuteNonQuery(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; Interaction.MsgBox("Se ha producido el siguiente error:" + exception.Message, 0, null); connection2.Close(); ProjectData.ClearProjectError(); return; ProjectData.ClearProjectError(); } } connection2.Close(); frmRepOVExp1 exp = new frmRepOVExp1(); this.Hide(); exp.Show(); } }