Exemplo n.º 1
0
        private void eliminarProgramProductionDevelopmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                int IdProgramProductionDevelopment = 0;
                if (gvProgramProductionDevelopment.GetFocusedRowCellValue("IdProgramProductionDevelopment") != null)
                {
                    IdProgramProductionDevelopment = int.Parse(gvProgramProductionDevelopment.GetFocusedRowCellValue("IdProgramProductionDevelopment").ToString());
                }
                ProgramProductionDevelopmentBE objBE_ProgramProductionDevelopment = new ProgramProductionDevelopmentBE();
                objBE_ProgramProductionDevelopment.IdProgramProductionDevelopment = IdProgramProductionDevelopment;
                objBE_ProgramProductionDevelopment.IdCompany = Parametros.intEmpresaId;
                objBE_ProgramProductionDevelopment.Login     = Parametros.strUsuarioLogin;
                objBE_ProgramProductionDevelopment.Machine   = WindowsIdentity.GetCurrent().Name.ToString();

                ProgramProductionDevelopmentBL objBL_ProgramProductionDevelopment = new ProgramProductionDevelopmentBL();
                objBL_ProgramProductionDevelopment.Elimina(objBE_ProgramProductionDevelopment);
                gvProgramProductionDevelopment.DeleteRow(gvProgramProductionDevelopment.FocusedRowHandle);
                gvProgramProductionDevelopment.RefreshData();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        public List <ProgramProductionDevelopmentBE> ListaTodosActivo(int IdProgramProduction, int IdProgramProductionDetail)
        {
            Database  db        = DatabaseFactory.CreateDatabase("cnERPBD");
            DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionDevelopment_ListaTodosActivo");

            db.AddInParameter(dbCommand, "pIdProgramProduction", DbType.Int32, IdProgramProduction);
            db.AddInParameter(dbCommand, "pIdProgramProductionDetail", DbType.Int32, IdProgramProductionDetail);

            IDataReader reader = db.ExecuteReader(dbCommand);
            List <ProgramProductionDevelopmentBE> ProgramProductionDevelopmentlist = new List <ProgramProductionDevelopmentBE>();
            ProgramProductionDevelopmentBE        ProgramProductionDevelopment;

            while (reader.Read())
            {
                ProgramProductionDevelopment                                = new ProgramProductionDevelopmentBE();
                ProgramProductionDevelopment.IdCompany                      = Int32.Parse(reader["IdCompany"].ToString());
                ProgramProductionDevelopment.IdProgramProduction            = Int32.Parse(reader["IdProgramProduction"].ToString());
                ProgramProductionDevelopment.IdProgramProductionDevelopment = Int32.Parse(reader["idProgramProductionDevelopment"].ToString());
                ProgramProductionDevelopment.DevDate                        = DateTime.Parse(reader["DevDate"].ToString());
                ProgramProductionDevelopment.Comment                        = reader["Comment"].ToString();
                ProgramProductionDevelopment.IdSituation                    = Int32.Parse(reader["IdSituation"].ToString());
                ProgramProductionDevelopment.Situation                      = reader["Situation"].ToString();
                ProgramProductionDevelopment.FlagState                      = Boolean.Parse(reader["FlagState"].ToString());
                ProgramProductionDevelopment.TipoOper                       = 4; //CONSULTAR
                ProgramProductionDevelopmentlist.Add(ProgramProductionDevelopment);
            }
            reader.Close();
            reader.Dispose();
            return(ProgramProductionDevelopmentlist);
        }
Exemplo n.º 3
0
        public ProgramProductionDevelopmentBE Selecciona(int IdProgramProductionDevelopment)
        {
            Database  db        = DatabaseFactory.CreateDatabase("cnERPBD");
            DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionDevelopment_Selecciona");

            db.AddInParameter(dbCommand, "pidProgramProductionDevelopment", DbType.Int32, IdProgramProductionDevelopment);

            IDataReader reader = db.ExecuteReader(dbCommand);
            ProgramProductionDevelopmentBE ProgramProductionDevelopment = null;

            while (reader.Read())
            {
                ProgramProductionDevelopment                                = new ProgramProductionDevelopmentBE();
                ProgramProductionDevelopment.IdCompany                      = Int32.Parse(reader["IdCompany"].ToString());
                ProgramProductionDevelopment.IdProgramProduction            = Int32.Parse(reader["IdProgramProduction"].ToString());
                ProgramProductionDevelopment.IdProgramProductionDevelopment = Int32.Parse(reader["idProgramProductionDevelopment"].ToString());
                ProgramProductionDevelopment.DevDate                        = DateTime.Parse(reader["DevDate"].ToString());
                ProgramProductionDevelopment.Comment                        = reader["Comment"].ToString();
                ProgramProductionDevelopment.IdSituation                    = Int32.Parse(reader["IdSituation"].ToString());
                ProgramProductionDevelopment.Situation                      = reader["Situation"].ToString();
                ProgramProductionDevelopment.FlagState                      = Boolean.Parse(reader["FlagState"].ToString());
            }
            reader.Close();
            reader.Dispose();
            return(ProgramProductionDevelopment);
        }
 public void Elimina(ProgramProductionDevelopmentBE pItem)
 {
     try
     {
         ProgramProductionDevelopmentDL ProgramProductionDevelopment = new ProgramProductionDevelopmentDL();
         ProgramProductionDevelopment.Elimina(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
 public ProgramProductionDevelopmentBE Selecciona(int IdProgramProductionDevelopment)
 {
     try
     {
         ProgramProductionDevelopmentDL ProgramProductionDevelopment = new ProgramProductionDevelopmentDL();
         ProgramProductionDevelopmentBE objEmp = ProgramProductionDevelopment.Selecciona(IdProgramProductionDevelopment);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemplo n.º 6
0
        public void Elimina(ProgramProductionDevelopmentBE pItem)
        {
            Database  db        = DatabaseFactory.CreateDatabase("cnERPBD");
            DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionDevelopment_Elimina");

            db.AddInParameter(dbCommand, "pIdProgramProductionDevelopment", DbType.Int32, pItem.IdProgramProductionDevelopment);
            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);
        }
Exemplo n.º 7
0
        public void Actualiza(ProgramProductionDevelopmentBE pItem)
        {
            Database  db        = DatabaseFactory.CreateDatabase("cnERPBD");
            DbCommand dbCommand = db.GetStoredProcCommand("usp_ProgramProductionDevelopment_Actualiza");

            db.AddInParameter(dbCommand, "pIdProgramProductionDevelopment", DbType.Int32, pItem.IdProgramProductionDevelopment);
            db.AddInParameter(dbCommand, "pIdProgramProduction", DbType.Int32, pItem.IdProgramProduction);
            db.AddInParameter(dbCommand, "pIdProgramProductionDetail", DbType.Int32, pItem.IdProgramProductionDetail);
            db.AddInParameter(dbCommand, "pDevDate", DbType.Date, pItem.DevDate);
            db.AddInParameter(dbCommand, "pComment", DbType.String, pItem.Comment);
            db.AddInParameter(dbCommand, "pIdSituation", DbType.Int32, pItem.IdSituation);
            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);
        }
Exemplo n.º 8
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (!ValidarIngreso())
                {
                    ProgramProductionDevelopmentBL objBL_ProgramProductionDevelopment = new ProgramProductionDevelopmentBL();


                    //DETAIL
                    List <ProgramProductionDevelopmentBE> lstProgramProductionDevelopment = new List <ProgramProductionDevelopmentBE>();

                    foreach (var item in mListaProgramProductionDevelopmentOrigen)
                    {
                        ProgramProductionDevelopmentBE objE_ProgramProductionDevelopment = new ProgramProductionDevelopmentBE();
                        objE_ProgramProductionDevelopment.IdCompany                      = Parametros.intEmpresaId;
                        objE_ProgramProductionDevelopment.IdProgramProduction            = IdProgramProduction;
                        objE_ProgramProductionDevelopment.IdProgramProductionDetail      = item.IdProgramProductionDetail;
                        objE_ProgramProductionDevelopment.IdProgramProductionDevelopment = item.IdProgramProductionDevelopment;
                        objE_ProgramProductionDevelopment.DevDate     = item.DevDate;
                        objE_ProgramProductionDevelopment.Comment     = item.Comment;
                        objE_ProgramProductionDevelopment.IdSituation = item.IdSituation;
                        objE_ProgramProductionDevelopment.FlagState   = true;
                        objE_ProgramProductionDevelopment.Login       = Parametros.strUsuarioLogin;
                        objE_ProgramProductionDevelopment.Machine     = WindowsIdentity.GetCurrent().Name.ToString();
                        objE_ProgramProductionDevelopment.TipoOper    = item.TipoOper;
                        lstProgramProductionDevelopment.Add(objE_ProgramProductionDevelopment);
                    }

                    objBL_ProgramProductionDevelopment.Actualiza(lstProgramProductionDevelopment);

                    Application.DoEvents();

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }