private void busca_clave() { empresas empresas = new empresas(); Lib_SIF.men men = new Lib_SIF.men(); bool flag = true; DataTable dt = new DataTable(); string sec = ""; checked { ++this.contador; } if (this.contador > 3) { ProjectData.EndApp(); } bool ok; men.menu(this.TextBox1.Text, ref this.usuario, this.ip, ref sec, ref this.dt, ref ok); try { if (!ok) { flag = false; this.bien = false; this.Label3.Text = "Clave Incorrecta !!!!!!. " + Conversions.ToString(this.contador) + " Intentos "; this.TextBox1.Text = ""; } else { this.Label3.Text = this.usuario; this.nombre = this.usuario; empresas.usuario = this.Label3.Text; empresas.clave = this.TextBox1.Text; empresas.seccion = sec; this.foto.Visible = true; string strSql = "SELECT * FROM MEN_JAP_F WHERE PASSWORD = '******'"; Module1.llena_tablas(ref dt, strSql, ref this.cnn); if (dt.Rows.Count > 0) { DataRow row = dt.Rows[0]; try { this.foto.Image = Image.FromStream((Stream) new MemoryStream((byte[])row["FOTO"])); } catch (Exception ex) { ProjectData.SetProjectError(ex); ProjectData.ClearProjectError(); } } this.bien = true; } } catch (Exception ex) { ProjectData.SetProjectError(ex); int num = (int)Interaction.MsgBox((object)"No he podido conectarme al servidor. Por favor verifique su conección", MsgBoxStyle.Critical, (object)"Conección Perdida."); this.Close(); ProjectData.ClearProjectError(); } }
public Cajas22() { this.Load += new EventHandler(this.Cortes_status); this.cnn = new SqlConnection(); this.dt = new DataTable(); this.seccion = ""; this.obj = new empresas(); this.InitializeComponent(); }
private void graba_datos() { empresas empresas = new empresas(); string caja = ""; SqlConnection cnn = new SqlConnection(); cnn.ConnectionString = this.cnn.ConnectionString; this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; try { int num1 = checked (this.fg.Rows.Count - 1); int index = 1; while (index <= num1) { this.o.crea_cajas((object)empresas, cnn, ref caja); string str = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)("INSERT INTO CAJAS01 (CAJA,CORTE,TALLA,TIPO,UNIDADES,CLIENTE,UBICACION,FECHA,ESTADO,ESCALA,ORDEN,IMPRESO,TIPO_SEG,SECCION) VALUES ('" + caja + "','" + this.CORTE.Text + "','"), this.fg[index, 6]), (object)"','P','"), this.fg[index, 7]), (object)"','"), this.fg[index, 5]), (object)"','00',GETDATE(),'A','"), (object)this.escala), (object)"','"), this.fg[index, 8]), (object)"','"), (object)empresas.usuario), (object)"','0','"), (object)this.seccion), (object)"')")); command.CommandText = str; command.ExecuteNonQuery(); if (index == 1) { this.inicial = caja; } this.final = caja; checked { ++index; } } sqlTransaction.Commit(); int num2 = (int)Interaction.MsgBox((object)"Grabacion Exitosa", MsgBoxStyle.Exclamation, (object)"Grabaciones"); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { int num = (int)Interaction.MsgBox((object)"Inconsistencia en Datos", MsgBoxStyle.Critical, (object)"Por favor revise !!!!"); sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { int num = (int)Interaction.MsgBox((object)("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."), MsgBoxStyle.Critical, (object)"Error"); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }
private void graba_datos() { string str1 = ""; empresas empresas = new empresas(); if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(empresas.numero, "1", false) == 0) { str1 = "JTF"; } else if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(empresas.numero, "3", false) == 0) { str1 = "ZUF"; } string str2 = Strings.Format((object)DateAndTime.Today, "yyyy-MM-dd"); int[] numArray1 = new int[10]; int[] numArray2 = new int[10]; this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; try { string str3 = "INSERT INTO CAJAS06 (CORTE,FECHA,PRENDAS) VALUES ( '" + this.corte.Text + "','" + str2 + "','" + this.tprod.Text + "')"; command.CommandText = str3; command.ExecuteNonQuery(); sqlTransaction.Commit(); int num = (int)Interaction.MsgBox((object)"Grabacion Exitosa", MsgBoxStyle.Exclamation, (object)"Grabaciones"); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { int num = (int)Interaction.MsgBox((object)"Inconsistencia en Datos", MsgBoxStyle.Critical, (object)"Por favor revise !!!!"); sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { int num = (int)Interaction.MsgBox((object)("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."), MsgBoxStyle.Critical, (object)"Error"); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }
public Cajas99() { this.Load += new EventHandler(this.Plan_costura_Load); this.dt = new DataTable(); this.cnn = new SqlConnection(); this.con = new string[4]; this.obj = new empresas(); this.seccion = this.obj.seccion; this.sec = "('" + this.obj.seccion + "','TEXFOR" + Strings.Mid(this.obj.seccion, 7) + "')"; this.InitializeComponent(); }
public Cajas21() { this.Load += new EventHandler(this.BOM_Load); this.dt = new DataTable(); this.mt = new DataTable(); this.es = new DataTable(); this.cnn = new SqlConnection(); this.empre = new empresas(); this.ac = new DataTable(); this.InitializeComponent(); }
private void graba_datos() { int rowSel = this.fg.RowSel; empresas empresas = new empresas(); this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; string str1 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(this.fg[rowSel, 1], this.fg[rowSel, 2])); if (str1.Length > 0) { str1 = Strings.Mid(str1, 1, 30); } try { string str2 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)"UPDATE UPC SET T1 ='", this.upc[1, 1]), (object)"', T2 = '"), this.upc[1, 2]), (object)"', T3 ='"), this.upc[1, 3]), (object)"', T4 ='"), this.upc[1, 4]), (object)"', T5 ='"), this.upc[1, 5]), (object)"', T6 = '"), this.upc[1, 6]), (object)"', T7 ='"), this.upc[1, 7]), (object)"', T8 ='"), this.upc[1, 8]), (object)"', T9 ='"), this.upc[1, 9]), (object)"', T0 = '"), this.upc[1, 10]), (object)"' "), (object)" WHERE CLIENTE = '"), (object)this.cliente.Text), (object)"' AND ESTILO = '"), this.fg[rowSel, 1]), (object)"' AND COLOR = '"), this.fg[rowSel, 2]), (object)"'")); command.CommandText = str2; if (command.ExecuteNonQuery() == 0) { string str3 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)("INSERT INTO UPC (CLIENTE,ESTILO,COLOR,MATERIAL,ESCALA,T1,T2,T3,T4,T5,T6,T7,T8,T9,T0,USUARIO,FECHA) VALUES ('" + this.cliente.Text + "','"), this.fg[rowSel, 1]), (object)"','"), this.fg[rowSel, 2]), (object)"','"), (object)str1), (object)"','"), this.fg[rowSel, 3]), (object)"','"), this.upc[1, 1]), (object)"','"), this.upc[1, 2]), (object)"','"), this.upc[1, 3]), (object)"','"), this.upc[1, 4]), (object)"','"), this.upc[1, 5]), (object)"','"), this.upc[1, 6]), (object)"','"), this.upc[1, 7]), (object)"','"), this.upc[1, 8]), (object)"','"), this.upc[1, 9]), (object)"','"), this.upc[1, 10]), (object)"','"), (object)empresas.usuario), (object)"',GETDATE() )")); command.CommandText = str3; command.ExecuteNonQuery(); } sqlTransaction.Commit(); int num = (int)Interaction.MsgBox((object)"Actualización Exitosa.", MsgBoxStyle.Exclamation, (object)"Datos Actualizados."); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { int num = (int)Interaction.MsgBox((object)"Inconsistencia en Datos", MsgBoxStyle.Critical, (object)"Por favor revise !!!!"); sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { Console.WriteLine("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }
public Cajas10() { this.Load += new EventHandler(this.Prod_sec); this.h = "#######0.00"; this.cnn = new SqlConnection(); this.dt = new DataTable(); this.path = "c:\\estado_cliente.xls"; this.obj = new empresas(); this.constr = this.obj.constr; this.InitializeComponent(); }
private void Print_fg() { empresas empresas = new empresas(); Strings.Format((object)DateAndTime.Today, "dd/MM/yyy"); string str = empresas.nombre + " Reporte de Prendas Empacadas desde " + Strings.Format((object)Conversions.ToDate(this.fecha_i.Text), "dd/MM/yyyy") + " al " + Strings.Format((object)Conversions.ToDate(this.fecha_f.Text), "dd/MM/yyyy"); PageSettings defaultPageSettings = this.fg.PrintParameters.PrintDocument.DefaultPageSettings; defaultPageSettings.Landscape = true; defaultPageSettings.Margins.Left = 20; defaultPageSettings.Margins.Right = 50; defaultPageSettings.Margins.Top = 80; defaultPageSettings.Margins.Bottom = 80; this.fg.PrintParameters.HeaderFont = new Font("Arial Narrow", 14f, FontStyle.Bold); this.fg.PrintParameters.FooterFont = new Font("Arial Narrow", 12f, FontStyle.Italic); this.fg.PrintGrid("Empaque", PrintGridFlags.FitToPageWidth | PrintGridFlags.ShowPrintDialog, str + "\t\tPagina {0}", ""); }
public Cajas01() { this.Load += new EventHandler(this.Cortes_status); this.cnn = new SqlConnection(); this.dt = new DataTable(); this.es = new DataTable(); this.e = new string[11]; this.t = new int[11]; this.p = new object[11]; this.escala = ""; this.inicial = ""; this.final = ""; this.seccion = ""; this.obj = new empresas(); this.o = new Lib_SIF.jap(); this.InitializeComponent(); }
private void setea_empresa() { int selectedIndex = this.Empre.SelectedIndex; object objectValue = RuntimeHelpers.GetObjectValue(this.Empre.SelectedItem); if (selectedIndex <= -1) { return; } this.empresa = Strings.Mid(objectValue.ToString(), 1, 1); this.nombre = Strings.Mid(objectValue.ToString(), 5); this.obj = new empresas(); this.obj.numero = this.empresa; this.obj.nombre = this.nombre; this.obj.constr = this.cs.con_string(checked ((int)Math.Round(unchecked (Conversions.ToDouble(this.empresa) - 1.0)))); this.obj.conole = this.cs.con_ole(checked ((int)Math.Round(unchecked (Conversions.ToDouble(this.empresa) - 1.0)))); this.Label2.Text = this.nombre; }
private void elimina() { empresas empresas = new empresas(); Strings.Format((object)DateAndTime.Now, "yyyy-MM-dd hh:mm:ss"); this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; try { string str = "DELETE UPC WHERE CLIENTE = '" + this.cliente + "' AND ESTILO = '" + this.estil.Text + "' AND COLOR = '" + this.colo.Text + "'"; command.CommandText = str; command.ExecuteNonQuery(); sqlTransaction.Commit(); this.ec[this.ec.RowSel, 5] = (object)""; } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { Console.WriteLine("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }
private void Graba_datos(DataTable dt, ref bool ok) { int num1 = 0; empresas empresas = new empresas(); ok = false; this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; try { try { foreach (DataRow row in dt.Rows) { try { string str = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)"INSERT INTO CAJAS04 (CAJA,CORTE,TALLA,TIPO,UNIDADES,FECHA ,QUIEN) VALUES ( '", row["CAJA"]), (object)"','"), row["CORTE"]), (object)"','"), row["TALLA"]), (object)"','"), row["TIPO"]), (object)"','"), row["UNIDADES"]), (object)"',GETDATE(),'OPERADOR')")); command.CommandText = str; checked { num1 += command.ExecuteNonQuery(); } ok = true; } catch (Exception ex) { ProjectData.SetProjectError(ex); ProjectData.ClearProjectError(); } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } if (num1 > 0) { string str = "UPDATE CAJAS01 SET ESTADO = 'P' WHERE CAJA = '" + this.caja.Text + "'"; command.CommandText = str; command.ExecuteNonQuery(); } sqlTransaction.Commit(); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { int num2 = (int)Interaction.MsgBox((object)"Inconsistencia en Datos", MsgBoxStyle.Critical, (object)"Por favor revise !!!!"); sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { int num2 = (int)Interaction.MsgBox((object)("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."), MsgBoxStyle.Critical, (object)"Error"); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }
private void graba_datos() { string str1 = ""; empresas empresas = new empresas(); if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(empresas.numero, "1", false) == 0) { str1 = "JTF"; } else if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(empresas.numero, "3", false) == 0) { str1 = "ZUF"; } string str2 = Strings.Format((object)DateAndTime.Today, "yyyy-MM-dd"); int[] numArray1 = new int[10]; int[] numArray2 = new int[10]; string str3 = "Vales"; this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; try { int num1 = checked (this.pr.Rows.Count - 2); int index1 = 1; int num2; while (index1 <= num1) { string str4 = Conversions.ToString(this.pr[index1, 1]); if (!str3.Contains(str4)) { int index2 = 2; do { if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(this.pr[index1, index2], (object)0, false)) { string str5 = Conversions.ToString(this.pr[0, index2]); string str6 = Conversions.ToString(this.pr[index1, 0]); string str7 = "INSERT INTO PROD_DIARIA (CORTE,FECHA,TIPO,TALLA,PRENDAS) VALUES ( '" + this.corte.Text + "','" + str2 + "','" + str6 + "','" + str5 + "'," + Conversions.ToString(Conversions.ToInteger(this.pr[index1, index2])) + ")"; command.CommandText = str7; num2 = command.ExecuteNonQuery(); string str8; if (Conversions.ToDouble(str6) == 0.0) { numArray1[checked (index2 - 2)] = Conversions.ToInteger(this.pr[index1, index2]); str8 = "P" + Conversions.ToString(checked (index2 - 2)); } else { numArray2[checked (index2 - 2)] = Conversions.ToInteger(this.pr[index1, index2]); str8 = "S" + Conversions.ToString(checked (index2 - 2)); } string str9 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)("UPDATE CORTES_P SET " + str8 + " = " + str8 + " + "), this.pr[index1, index2]), (object)" WHERE CORTE = '"), (object)this.corte.Text), (object)"'")); command.CommandText = str9; if (command.ExecuteNonQuery() == 0) { string str10 = "INSERT INTO CORTES_P (CORTE,P0,P1,P2,P3,P4,P5,P6,P7,P8,P9,S0,S1,S2,S3,S4,S5,S6,S7,S8,S9) VALUES ( '" + this.corte.Text + "','" + Conversions.ToString(numArray1[0]) + "','" + Conversions.ToString(numArray1[1]) + "','" + Conversions.ToString(numArray1[2]) + "','" + Conversions.ToString(numArray1[3]) + "','" + Conversions.ToString(numArray1[4]) + "','" + Conversions.ToString(numArray1[5]) + "','" + Conversions.ToString(numArray1[6]) + "','" + Conversions.ToString(numArray1[7]) + "','" + Conversions.ToString(numArray1[8]) + "','" + Conversions.ToString(numArray1[9]) + "','" + Conversions.ToString(numArray2[0]) + "','" + Conversions.ToString(numArray2[1]) + "','" + Conversions.ToString(numArray2[2]) + "','" + Conversions.ToString(numArray2[3]) + "','" + Conversions.ToString(numArray2[4]) + "','" + Conversions.ToString(numArray2[5]) + "','" + Conversions.ToString(numArray2[6]) + "','" + Conversions.ToString(numArray2[7]) + "','" + Conversions.ToString(numArray2[8]) + "','" + Conversions.ToString(numArray2[9]) + "')"; command.CommandText = str10; num2 = command.ExecuteNonQuery(); } string str11 = "UPDATE CORTES SET FPROD = '" + str2 + "' WHERE CORTE = '" + this.corte.Text + "'"; command.CommandText = str11; num2 = command.ExecuteNonQuery(); } checked { ++index2; } }while (index2 <= 11); } checked { ++index1; } } string str12 = "UPDATE CAJAS01 SET ESTADO = 'T' WHERE CORTE = '" + this.corte.Text + "'"; command.CommandText = str12; num2 = command.ExecuteNonQuery(); string Style = "0000000"; string str13 = "SELECT CORRELATIVO FROM PROD_TER03 WHERE TIPO = 'ENTRADAS'"; command.CommandText = str13; string str14 = Strings.Format((object)checked ((int)Math.Round(unchecked (Conversions.ToDouble(RuntimeHelpers.GetObjectValue(command.ExecuteScalar()).ToString()) + 1.0))), Style); string str15 = "UPDATE PROD_TER03 SET CORRELATIVO = CORRELATIVO + 1 WHERE TIPO = 'ENTRADAS'"; command.CommandText = str15; num2 = command.ExecuteNonQuery(); try { foreach (DataRow row in this.pp.Rows) { if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(row["TIPO_SEG"], (object)12, false)) { string str4 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)"INSERT INTO PROD_TER01 (CAJA,CORTE,TALLA,TIPO,UBICACION,UNIDADES_I,UNIDADES,FECHA,ESTADO,USUARIO,CLIENTE,ESCALA,ORDEN) VALUES ('", row["CAJA"]), (object)"','"), row["CORTE"]), (object)"','"), row["TALLA"]), (object)"','"), row["TIPO"]), (object)"','00','"), row["UNIDADES"]), (object)"','"), row["UNIDADES"]), (object)"',GETDATE(),'A','"), (object)empresas.usuario), (object)"','"), row["CLIENTE"]), (object)"','"), row["ESCALA"]), (object)"','"), row["ORDEN"]), (object)"')")); command.CommandText = str4; num2 = command.ExecuteNonQuery(); string str5 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)("INSERT INTO PROD_TER02 (TIPO_MOVTO,NO_DOCTO,CAJA,CORTE,TALLA,TIPO,DESCRIPCION,FECHA,UNIDADES,USUARIO) VALUES ('E','" + str14 + "','"), row["CAJA"]), (object)"','"), row["CORTE"]), (object)"','"), row["TALLA"]), (object)"','"), row["TIPO"]), (object)"','"), (object)"INGRESOS POR PRODUCCION',GETDATE(),'"), row["UNIDADES"]), (object)"','"), (object)empresas.usuario), (object)"')")); command.CommandText = str5; num2 = command.ExecuteNonQuery(); } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } sqlTransaction.Commit(); int num3 = (int)Interaction.MsgBox((object)"Grabacion Exitosa", MsgBoxStyle.Exclamation, (object)"Grabaciones"); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { int num = (int)Interaction.MsgBox((object)"Inconsistencia en Datos", MsgBoxStyle.Critical, (object)"Por favor revise !!!!"); sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { int num = (int)Interaction.MsgBox((object)("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."), MsgBoxStyle.Critical, (object)"Error"); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }
private void graba_datos() { string str1 = ""; empresas empresas = new empresas(); string Style = "0000000"; if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(empresas.numero, "1", false) == 0) { str1 = "JTF"; } else if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(empresas.numero, "3", false) == 0) { str1 = "ZUF"; } this.cnn.Open(); SqlTransaction sqlTransaction = this.cnn.BeginTransaction(); SqlCommand command = this.cnn.CreateCommand(); command.Transaction = sqlTransaction; try { string str2 = "SELECT CORRELATIVO FROM CAJAS02"; command.CommandText = str2; int integer = Conversions.ToInteger(RuntimeHelpers.GetObjectValue(command.ExecuteScalar()).ToString()); this.inicial = str1 + Strings.Format((object)checked (integer + 1), Style); int num1 = checked (this.fg.Rows.Count - 1); int index = 1; while (index <= num1) { string str3 = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject((object)("INSERT INTO CAJAS01 (CAJA,CORTE,TALLA,TIPO,UNIDADES,CLIENTE,UBICACION,FECHA,ESTADO,ESCALA,ORDEN,IMPRESO,TIPO_SEG,SECCION) VALUES ('" + str1 + Strings.Format(Microsoft.VisualBasic.CompilerServices.Operators.AddObject((object)integer, this.fg[index, 1]), Style) + "','" + this.CORTE.Text + "','"), this.fg[index, 6]), (object)"','P','"), this.fg[index, 7]), (object)"','"), this.fg[index, 5]), (object)"','00',GETDATE(),'A','"), (object)this.escala), (object)"','"), this.fg[index, 8]), (object)"','"), (object)empresas.usuario), (object)"','0','"), (object)this.seccion), (object)"')")); command.CommandText = str3; int num2 = command.ExecuteNonQuery(); string str4 = "UPDATE CAJAS02 SET CORRELATIVO = CORRELATIVO + 1"; command.CommandText = str4; num2 = command.ExecuteNonQuery(); this.final = str1 + Strings.Format((object)checked (integer + index), Style); checked { ++index; } } sqlTransaction.Commit(); int num3 = (int)Interaction.MsgBox((object)"Grabacion Exitosa", MsgBoxStyle.Exclamation, (object)"Grabaciones"); } catch (Exception ex1) { ProjectData.SetProjectError(ex1); try { int num = (int)Interaction.MsgBox((object)"Inconsistencia en Datos", MsgBoxStyle.Critical, (object)"Por favor revise !!!!"); sqlTransaction.Rollback(); } catch (SqlException ex2) { ProjectData.SetProjectError((Exception)ex2); SqlException sqlException = ex2; if (sqlTransaction.Connection != null) { int num = (int)Interaction.MsgBox((object)("Ocurrió un error de tipo " + sqlException.GetType().ToString() + " se generó cuando se trato de eliminar la transacción."), MsgBoxStyle.Critical, (object)"Error"); } ProjectData.ClearProjectError(); } ProjectData.ClearProjectError(); } finally { this.cnn.Close(); } }