public override void guardar_Click(object sender, EventArgs e) { if (this.Cuit.Text == "" || this.Cuit.Text == null || this.corporateName.Text == "" || this.corporateName.Text == null || this.Phone.Text == "" || this.Phone.Text == null) { MessageBox.Show("No debe dejar campos en blanco"); return; } Conexion cnn = Conexion.Instance; System.Data.SqlClient.SqlCommand comando1 = new System.Data.SqlClient.SqlCommand(); comando1.CommandType = CommandType.StoredProcedure; //bindeos this.currentDataRow[0] = this.corporateName.Text; this.currentDataRow[1] = this.Mail.Text; this.currentDataRow[2] = this.Phone.Text; this.currentDataRow[3] = this.address.Text; this.currentDataRow[4] = this.postalCode.Text; this.currentDataRow[5] = this.City.Text; this.currentDataRow[6] = this.Cuit.Text; this.currentDataRow[7] = this.entry.Text; //se guardan los datos faltantes del proveedor this.currentDataRow[8] = this.ContactNumber.Text; if (insertar) { StringBuilder ins = new StringBuilder().AppendFormat("insert into TRANSA_SQL.Supplier (UserId,PersonalDataId,CorporateName,Cuit) values ({0},{1},'{2}','{3}')", this.userid, this.pd, this.corporateName.Text, this.Cuit.Text); Conexion.Instance.ejecutarQuery(ins.ToString()); } AbmProveedor.ModificarProvForm m = new AbmProveedor.ModificarProvForm(this.currentDataRow); m.UserId = this.userid; m.Owner = this; m.Main = this.mainWindow; m.guardar_Click(sender, e); comando1.Parameters.Add("@userid", SqlDbType.Int); comando1.Parameters[0].Value = this.userid; comando1.CommandText = "TRANSA_SQL.chauFirstLogin"; cnn.ejecutarQueryConSP(comando1); }
public override void guardar_Click(object sender, EventArgs e) { if (this.Cuit.Text == "" || this.Cuit.Text == null || this.corporateName.Text == "" || this.corporateName.Text == null || this.Phone.Text=="" || this.Phone.Text==null) { MessageBox.Show("No debe dejar campos en blanco"); return; } Conexion cnn = Conexion.Instance; System.Data.SqlClient.SqlCommand comando1 = new System.Data.SqlClient.SqlCommand(); comando1.CommandType = CommandType.StoredProcedure; //bindeos this.currentDataRow[0] = this.corporateName.Text; this.currentDataRow[1] = this.Mail.Text; this.currentDataRow[2] = this.Phone.Text; this.currentDataRow[3] = this.address.Text; this.currentDataRow[4] = this.postalCode.Text; this.currentDataRow[5] = this.City.Text; this.currentDataRow[6] = this.Cuit.Text; this.currentDataRow[7] = this.entry.Text; //se guardan los datos faltantes del proveedor this.currentDataRow[8] = this.ContactNumber.Text; if (insertar) { StringBuilder ins = new StringBuilder().AppendFormat("insert into TRANSA_SQL.Supplier (UserId,PersonalDataId,CorporateName,Cuit) values ({0},{1},'{2}','{3}')", this.userid, this.pd, this.corporateName.Text, this.Cuit.Text); Conexion.Instance.ejecutarQuery(ins.ToString()); } AbmProveedor.ModificarProvForm m = new AbmProveedor.ModificarProvForm(this.currentDataRow); m.UserId = this.userid; m.Owner=this; m.Main=this.mainWindow; m.guardar_Click(sender, e); comando1.Parameters.Add("@userid", SqlDbType.Int); comando1.Parameters[0].Value =this.userid ; comando1.CommandText = "TRANSA_SQL.chauFirstLogin"; cnn.ejecutarQueryConSP(comando1); }