private void eliminarProgramProductionAuditToolStripMenuItem_Click(object sender, EventArgs e) { try { int IdProgramProductionAudit = 0; if (gvProgramProductionAudit.GetFocusedRowCellValue("IdProgramProductionAudit") != null) { IdProgramProductionAudit = int.Parse(gvProgramProductionAudit.GetFocusedRowCellValue("IdProgramProductionAudit").ToString()); } ProgramProductionAuditBE objBE_ProgramProductionAudit = new ProgramProductionAuditBE(); objBE_ProgramProductionAudit.IdProgramProductionAudit = IdProgramProductionAudit; objBE_ProgramProductionAudit.IdCompany = Parametros.intEmpresaId; objBE_ProgramProductionAudit.Login = Parametros.strUsuarioLogin; objBE_ProgramProductionAudit.Machine = WindowsIdentity.GetCurrent().Name.ToString(); ProgramProductionAuditBL objBL_ProgramProductionAudit = new ProgramProductionAuditBL(); objBL_ProgramProductionAudit.Elimina(objBE_ProgramProductionAudit); gvProgramProductionAudit.DeleteRow(gvProgramProductionAudit.FocusedRowHandle); gvProgramProductionAudit.RefreshData(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ProgramProductionAuditBE Selecciona(int IdProgramProductionAudit) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionAudit_Selecciona"); db.AddInParameter(dbCommand, "pidProgramProductionAudit", DbType.Int32, IdProgramProductionAudit); IDataReader reader = db.ExecuteReader(dbCommand); ProgramProductionAuditBE ProgramProductionAudit = null; while (reader.Read()) { ProgramProductionAudit = new ProgramProductionAuditBE(); ProgramProductionAudit.IdCompany = Int32.Parse(reader["IdCompany"].ToString()); ProgramProductionAudit.IdProgramProduction = Int32.Parse(reader["IdProgramProduction"].ToString()); ProgramProductionAudit.IdProgramProductionAudit = Int32.Parse(reader["idProgramProductionAudit"].ToString()); ProgramProductionAudit.Item = reader["Item"].ToString(); ProgramProductionAudit.AuditDate = DateTime.Parse(reader["AuditDate"].ToString()); ProgramProductionAudit.NumeroOI = reader["NumeroOI"].ToString(); ProgramProductionAudit.SendDate = reader.IsDBNull(reader.GetOrdinal("SendDate")) ? (DateTime?)null : reader.GetDateTime(reader.GetOrdinal("SendDate")); ProgramProductionAudit.ReturnDate = reader.IsDBNull(reader.GetOrdinal("ReturnDate")) ? (DateTime?)null : reader.GetDateTime(reader.GetOrdinal("ReturnDate")); ProgramProductionAudit.Comment = reader["Comment"].ToString(); ProgramProductionAudit.FileBox = reader["FileBox"].ToString(); ProgramProductionAudit.GarmentBox = reader["GarmentBox"].ToString(); ProgramProductionAudit.FlagState = Boolean.Parse(reader["FlagState"].ToString()); } reader.Close(); reader.Dispose(); return(ProgramProductionAudit); }
public List <ProgramProductionAuditBE> ListaTodosActivo(int IdProgramProduction, int IdProgramProductionDetail) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionAudit_ListaTodosActivo"); db.AddInParameter(dbCommand, "pIdProgramProduction", DbType.Int32, IdProgramProduction); db.AddInParameter(dbCommand, "pIdProgramProductionDetail", DbType.Int32, IdProgramProductionDetail); IDataReader reader = db.ExecuteReader(dbCommand); List <ProgramProductionAuditBE> ProgramProductionAuditlist = new List <ProgramProductionAuditBE>(); ProgramProductionAuditBE ProgramProductionAudit; while (reader.Read()) { ProgramProductionAudit = new ProgramProductionAuditBE(); ProgramProductionAudit.IdCompany = Int32.Parse(reader["IdCompany"].ToString()); ProgramProductionAudit.IdProgramProduction = Int32.Parse(reader["IdProgramProduction"].ToString()); ProgramProductionAudit.IdProgramProductionAudit = Int32.Parse(reader["idProgramProductionAudit"].ToString()); ProgramProductionAudit.IdStyle = Int32.Parse(reader["IdStyle"].ToString()); ProgramProductionAudit.Item = reader["Item"].ToString(); ProgramProductionAudit.AuditDate = DateTime.Parse(reader["AuditDate"].ToString()); ProgramProductionAudit.NumeroOI = reader["NumeroOI"].ToString(); ProgramProductionAudit.SendDate = reader.IsDBNull(reader.GetOrdinal("SendDate")) ? (DateTime?)null : reader.GetDateTime(reader.GetOrdinal("SendDate")); ProgramProductionAudit.ReturnDate = reader.IsDBNull(reader.GetOrdinal("ReturnDate")) ? (DateTime?)null : reader.GetDateTime(reader.GetOrdinal("ReturnDate")); ProgramProductionAudit.Comment = reader["Comment"].ToString(); ProgramProductionAudit.FileBox = reader["FileBox"].ToString(); ProgramProductionAudit.GarmentBox = reader["GarmentBox"].ToString(); ProgramProductionAudit.FlagState = Boolean.Parse(reader["FlagState"].ToString()); ProgramProductionAudit.TipoOper = 4; //CONSULTAR ProgramProductionAuditlist.Add(ProgramProductionAudit); } reader.Close(); reader.Dispose(); return(ProgramProductionAuditlist); }
public void Elimina(ProgramProductionAuditBE pItem) { try { ProgramProductionAuditDL ProgramProductionAudit = new ProgramProductionAuditDL(); ProgramProductionAudit.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public ProgramProductionAuditBE Selecciona(int IdProgramProductionAudit) { try { ProgramProductionAuditDL ProgramProductionAudit = new ProgramProductionAuditDL(); ProgramProductionAuditBE objEmp = ProgramProductionAudit.Selecciona(IdProgramProductionAudit); return(objEmp); } catch (Exception ex) { throw ex; } }
public ProgramProductionAuditBE SeleccionaNumero(int IdProgramProduction, int IdStyle, string NumeroOI) { try { ProgramProductionAuditDL ProgramProductionAudit = new ProgramProductionAuditDL(); ProgramProductionAuditBE objEmp = ProgramProductionAudit.SeleccionaNumero(IdProgramProduction, IdStyle, NumeroOI); return(objEmp); } catch (Exception ex) { throw ex; } }
public void Elimina(ProgramProductionAuditBE pItem) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionAudit_Elimina"); db.AddInParameter(dbCommand, "pIdProgramProductionAudit", DbType.Int32, pItem.IdProgramProductionAudit); db.AddInParameter(dbCommand, "pIdCompany", DbType.Int32, pItem.IdCompany); db.AddInParameter(dbCommand, "pLogin", DbType.String, pItem.Login); db.AddInParameter(dbCommand, "pMachine", DbType.String, pItem.Machine); db.ExecuteNonQuery(dbCommand); }
private void btnGrabar_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; if (!ValidarIngreso()) { ProgramProductionAuditBL objBL_ProgramProductionAudit = new ProgramProductionAuditBL(); //DETAIL List <ProgramProductionAuditBE> lstProgramProductionAudit = new List <ProgramProductionAuditBE>(); foreach (var item in mListaProgramProductionAuditOrigen) { ProgramProductionAuditBE objE_ProgramProductionAudit = new ProgramProductionAuditBE(); objE_ProgramProductionAudit.IdCompany = Parametros.intEmpresaId; objE_ProgramProductionAudit.IdProgramProduction = item.IdProgramProduction; objE_ProgramProductionAudit.IdProgramProductionDetail = item.IdProgramProductionDetail; objE_ProgramProductionAudit.IdProgramProductionAudit = item.IdProgramProductionAudit; objE_ProgramProductionAudit.IdStyle = item.IdStyle; objE_ProgramProductionAudit.AuditDate = item.AuditDate; objE_ProgramProductionAudit.NumeroOI = item.NumeroOI; objE_ProgramProductionAudit.SendDate = (item.SendDate == null) ? (DateTime?)null : item.SendDate; objE_ProgramProductionAudit.ReturnDate = (item.ReturnDate == null) ? (DateTime?)null : item.ReturnDate; objE_ProgramProductionAudit.Comment = item.Comment; objE_ProgramProductionAudit.FileBox = item.FileBox; objE_ProgramProductionAudit.GarmentBox = item.GarmentBox; objE_ProgramProductionAudit.FlagState = true; objE_ProgramProductionAudit.Login = Parametros.strUsuarioLogin; objE_ProgramProductionAudit.Machine = WindowsIdentity.GetCurrent().Name.ToString(); objE_ProgramProductionAudit.TipoOper = item.TipoOper; lstProgramProductionAudit.Add(objE_ProgramProductionAudit); } objBL_ProgramProductionAudit.Actualiza(lstProgramProductionAudit); Application.DoEvents(); this.Close(); } } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private bool ValidarIngreso() { bool flag = false; string strMensaje = "Could not register:\n"; if (gvProgramProductionAudit.DataRowCount > 0) { for (int i = 0; i < gvProgramProductionAudit.DataRowCount; i++) { if (gvProgramProductionAudit.GetRowCellValue(i, "NumeroOI").ToString() == "") { strMensaje = strMensaje + "- You must enter number O/I.\n"; flag = true; } } string strNumeroOI = gvProgramProductionAudit.GetRowCellValue(0, "NumeroOI").ToString().Trim(); int intTipoOper = int.Parse(gvProgramProductionAudit.GetRowCellValue(0, "TipoOper").ToString()); ProgramProductionAuditBE objE_ProgramProductionAudit = null; if (IdClient == 8) //BI-BILLING { objE_ProgramProductionAudit = new ProgramProductionAuditBL().SeleccionaNumero(IdProgramProduction, IdStyle, strNumeroOI); } else { objE_ProgramProductionAudit = new ProgramProductionAuditBL().SeleccionaNumero(IdProgramProduction, 0, strNumeroOI); } if (objE_ProgramProductionAudit != null && intTipoOper == Convert.ToInt32(Operacion.Nuevo)) { strMensaje = strMensaje + "The number O/I already exists\n Please Verify."; flag = true; } } if (flag) { XtraMessageBox.Show(strMensaje, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); Cursor = Cursors.Default; } return(flag); }
public void Actualiza(ProgramProductionAuditBE pItem) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionAudit_Actualiza"); db.AddInParameter(dbCommand, "pIdProgramProductionAudit", DbType.Int32, pItem.IdProgramProductionAudit); db.AddInParameter(dbCommand, "pIdProgramProduction", DbType.Int32, pItem.IdProgramProduction); db.AddInParameter(dbCommand, "pIdProgramProductionDetail", DbType.Int32, pItem.IdProgramProductionDetail); db.AddInParameter(dbCommand, "pIdStyle", DbType.Int32, pItem.IdStyle); db.AddInParameter(dbCommand, "pAuditDate", DbType.Date, pItem.AuditDate); db.AddInParameter(dbCommand, "pNumeroOI", DbType.String, pItem.NumeroOI); db.AddInParameter(dbCommand, "pSendDate", DbType.Date, pItem.SendDate); db.AddInParameter(dbCommand, "pReturnDate", DbType.Date, pItem.ReturnDate); db.AddInParameter(dbCommand, "pComment", DbType.String, pItem.Comment); db.AddInParameter(dbCommand, "pFileBox", DbType.String, pItem.FileBox); db.AddInParameter(dbCommand, "pGarmentBox", DbType.String, pItem.GarmentBox); db.AddInParameter(dbCommand, "pFlagState", DbType.Boolean, pItem.FlagState); db.AddInParameter(dbCommand, "pLogin", DbType.String, pItem.Login); db.AddInParameter(dbCommand, "pMachine", DbType.String, pItem.Machine); db.AddInParameter(dbCommand, "pIdCompany", DbType.Int32, pItem.IdCompany); db.ExecuteNonQuery(dbCommand); }
public List <ProgramProductionAuditBE> ListaClientDate(int IdClient, DateTime DateFrom, DateTime DateTo) { Database db = DatabaseFactory.CreateDatabase("cnERPBD"); DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionAudit_ListaClientDate"); db.AddInParameter(dbCommand, "pIdClient", DbType.Int32, IdClient); db.AddInParameter(dbCommand, "pDateFrom", DbType.DateTime, DateFrom); db.AddInParameter(dbCommand, "pDateTo", DbType.DateTime, DateTo); IDataReader reader = db.ExecuteReader(dbCommand); List <ProgramProductionAuditBE> ProgramProductionAuditlist = new List <ProgramProductionAuditBE>(); ProgramProductionAuditBE ProgramProductionAudit; while (reader.Read()) { ProgramProductionAudit = new ProgramProductionAuditBE(); ProgramProductionAudit.IdProgramProductionAudit = Int32.Parse(reader["idProgramProductionAudit"].ToString()); ProgramProductionAudit.AuditDate = DateTime.Parse(reader["AuditDate"].ToString()); ProgramProductionAudit.NumeroOI = reader["NumeroOI"].ToString(); ProgramProductionAudit.NameClient = reader["NameClient"].ToString(); ProgramProductionAudit.NameVendor = reader["NameVendor"].ToString(); ProgramProductionAudit.NameDestination = reader["NameDestination"].ToString(); ProgramProductionAudit.NumberPO = reader["NumberPO"].ToString(); ProgramProductionAudit.Units = Decimal.Parse(reader["Units"].ToString()); ProgramProductionAudit.Item = reader["Item"].ToString(); ProgramProductionAudit.NameStyle = reader["NameStyle"].ToString(); ProgramProductionAudit.XfDate = DateTime.Parse(reader["XfDate"].ToString()); ProgramProductionAudit.SendDate = reader.IsDBNull(reader.GetOrdinal("SendDate")) ? (DateTime?)null : reader.GetDateTime(reader.GetOrdinal("SendDate")); ProgramProductionAudit.ReturnDate = reader.IsDBNull(reader.GetOrdinal("ReturnDate")) ? (DateTime?)null : reader.GetDateTime(reader.GetOrdinal("ReturnDate")); ProgramProductionAudit.Comment = reader["Comment"].ToString(); ProgramProductionAudit.FileBox = reader["FileBox"].ToString(); ProgramProductionAudit.GarmentBox = reader["GarmentBox"].ToString(); ProgramProductionAudit.FlagState = Boolean.Parse(reader["FlagState"].ToString()); ProgramProductionAuditlist.Add(ProgramProductionAudit); } reader.Close(); reader.Dispose(); return(ProgramProductionAuditlist); }