Пример #1
0
        public static List <Comun> ObtenerUsuarios()
        {
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                OracleDataReader dr = null;
                cmd = exeProc.GenerarOracleCommandCursor("PKG_PLANEACION.Obt_Combo_Usuarios", ref dr);
                List <Comun> listarComun = new List <Comun>();
                while (dr.Read())
                {
                    Comun objComun = new Comun();
                    objComun.Usuario = Convert.ToString(dr[0]);
                    listarComun.Add(objComun);
                }
                return(listarComun);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }
Пример #2
0
        public static List <Comun> ObtenerComboBasicos(string Tipo, string SubTipo)
        {
            //IND
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                string[] Parametros = { "P_TIPO", "P_SUBTIPO" };
                object[] Valores    = { Tipo, SubTipo };

                OracleDataReader dr = null;
                cmd = exeProc.GenerarOracleCommandCursor("PKG_PLANEACION.Obt_Combo_Basicos", ref dr, Parametros, Valores);
                List <Comun> listarComun = new List <Comun>();
                while (dr.Read())
                {
                    Comun objComun = new Comun();
                    objComun.Id          = Convert.ToString(dr[0]);
                    objComun.Descripcion = Convert.ToString(dr[1]);
                    objComun.EtiquetaDos = Convert.ToString(dr[2]);
                    listarComun.Add(objComun);
                }
                return(listarComun);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }
Пример #3
0
        public static List <Comun> GridUnidadesDisponibles(string Usuario)
        {
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                string[]         Parametros = { "P_USUARIO" };
                object[]         Valores    = { Usuario };
                OracleDataReader dr         = null;
                cmd = exeProc.GenerarOracleCommandCursor("PKG_PLANEACION.Obt_Grid_Unidades_Dispobibles", ref dr, Parametros, Valores);
                List <Comun> list = new List <Comun>();
                while (dr.Read())
                {
                    Comun objIndicador = new Comun();
                    objIndicador.Id          = Convert.ToString(dr[0]);
                    objIndicador.Descripcion = Convert.ToString(dr[1]);

                    list.Add(objIndicador);
                }
                return(list);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }
Пример #4
0
        public static List <Comun> ObtenerCarreras(string Dependencia)
        {
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                string[] Parametros = { "P_Dependencia" };
                object[] Valores    = { Dependencia };

                OracleDataReader dr = null;
                cmd = exeProc.GenerarOracleCommandCursor("PKG_PLANEACION.Obt_Combo_Carreras", ref dr, Parametros, Valores);
                List <Comun> listarComun = new List <Comun>();
                while (dr.Read())
                {
                    Comun objComun = new Comun();
                    objComun.Id          = Convert.ToString(dr[0]);
                    objComun.Descripcion = Convert.ToString(dr[1]);
                    listarComun.Add(objComun);
                }
                return(listarComun);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }
Пример #5
0
        public void Monitor_EstadisticaPP(string Color, int Rango, ref List <Comun> List)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                OracleDataReader dr = null;

                String[] Parametros = { "p_color", "p_rango" };
                String[] Valores    = { Convert.ToString(Color), Convert.ToString(Rango) };

                cmm = CDDatos.GenerarOracleCommandCursor("pkg_presupuesto.Obt_Grid_Monitor_Estadisticas", ref dr, Parametros, Valores);
                while (dr.Read())
                {
                    Comun objMonitor = new Comun();
                    objMonitor.Descripcion  = Convert.ToString(dr.GetValue(1));
                    objMonitor.Etiqueta     = Convert.ToString(dr.GetValue(3));
                    objMonitor.EtiquetaTres = Convert.ToString(dr.GetValue(2));
                    objMonitor.EtiquetaDos  = "images/" + Convert.ToString(dr.GetValue(4)) + ".png";
                    List.Add(objMonitor);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref cmm);
            }
        }
Пример #6
0
        public void Setup()
        {
            comun   = new Comun(2);
            red     = new Red(10);
            bomb    = new Bomb(3);
            chuck   = new Chuck(4);
            terence = new Terence(3, 2);
            matilda = new Matilda(4, new List <Huevo>()
            {
                new Huevo(2), new Huevo(3), new Huevo(1), new Huevo(4)
            });

            madera       = new Madera(3);
            vidrio       = new Vidrio(1);
            piedra       = new Piedra(2);
            obrero       = new Obrero();
            armadoEscudo = new Armado(new Escudo(2));
            armadoCasco  = new Armado(new Casco(4));

            isla = new Isla(new List <Pajaro>()
            {
                comun, red, bomb, chuck, terence, matilda
            });
            islaCerditos = new Isla_Cerdo(new List <Obstaculo>()
            {
                madera, vidrio, piedra, obrero, armadoCasco, armadoEscudo
            });
        }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.anclaCarrito.ServerClick += new EventHandler(anclaCarrito_Click);
     if (Session["IdCarrito"] != null)
     {
         ImageButtonCarro.Visible = true;
     }
     else
     {
         ImageButtonCarro.Visible = false;
     }
     txtUser.Text = (string)Session[Constantes.Session.Usuario];
     if (Session["TiendaCamper"] == null)
     {
         Session["TiendaCamper"] = Comun.checkTiendaCamper();
     }
     if (Session["TiendaCamper"].ToString() == "1")
     {
         this.ImageButtonC9.Visible = false;
     }
     else
     {
         ImageButtonC9.Visible = true;
     }
 }
Пример #8
0
 private void CargarGenero()
 {
     ddlGenero.DataSource     = Comun.CargarGenero();
     ddlGenero.DataValueField = "Value";
     ddlGenero.DataTextField  = "Text";
     ddlGenero.DataBind();
 }
Пример #9
0
        public void LlenaComboStr(Int32 Id1, string SP, string Conexion, ref System.Collections.Generic.List <Comun> list)
        {
            try
            {
                SqlDataReader      dr        = null;
                CapaDatos.CD_Datos CapaDatos = new CapaDatos.CD_Datos(Conexion);

                string[] Parametros = { "@Id1" };
                object[] Valores    = { Id1 };

                SqlCommand sqlcmd = CapaDatos.GenerarSqlCommand(SP, ref dr, Parametros, Valores);

                Comun Comun = default(Comun);
                while (dr.Read())
                {
                    Comun             = new Comun();
                    Comun.IdStr       = dr.GetString(dr.GetOrdinal("IdStr"));
                    Comun.Descripcion = dr.GetString(dr.GetOrdinal("Descripcion"));

                    list.Add(Comun);
                }
                dr.Close();
                CapaDatos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #10
0
        public ActionResult ReenviarNotificacion(string id)
        {
            try
            {
                NotificacionesGeneralesModels  NotificacionGeneral      = new NotificacionesGeneralesModels();
                _NotificacionesGenerales_Datos NotificacionGeneralDatos = new _NotificacionesGenerales_Datos();


                NotificacionGeneral.conexion = Conexion;
                NotificacionGeneral.IDNotificacionGeneral = id;
                NotificacionGeneralDatos.ReenviarNotificacion(NotificacionGeneral);

                if (NotificacionGeneral.Resultado == 1)
                {
                    foreach (DataRow notificacion in NotificacionGeneral.TablaAlumnos.Rows)
                    {
                        int Bagde = 0, IDTipoCelular = 0;
                        Bagde         = Convert.ToInt32(notificacion["Badge"].ToString());
                        IDTipoCelular = Convert.ToInt32(notificacion["idTipoCelular"].ToString());

                        Comun.EnviarMensaje(notificacion["token"].ToString(), notificacion["titulo"].ToString(), notificacion["descripcion"].ToString(), Bagde, IDTipoCelular);
                    }
                }


                TempData["message"] = "El Evento se elimino correctamente";
                return(Json(""));
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
        public static List <Comun> ObtenerComboPlanTrabajo()
        {
            //s
            OracleCommand    cmd     = null;
            ExeProcedimiento exeProc = new ExeProcedimiento();

            try
            {
                OracleDataReader dr = null;
                cmd = exeProc.GenerarOracleCommandCursor("PKG_PLANEACION.Obt_Combo_Plan", ref dr);
                List <Comun> listarPlanes = new List <Comun>();
                while (dr.Read())
                {
                    Comun objPlan = new Comun();
                    objPlan.Id          = Convert.ToString(dr[0]);
                    objPlan.Descripcion = Convert.ToString(dr[1]);
                    listarPlanes.Add(objPlan);
                }
                return(listarPlanes);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                exeProc.LimpiarOracleCommand(ref cmd);
            }
        }
        public void Setup()
        {
            abuelo = new Abuelo();
            necio  = new Necio();
            comun  = new Comun();

            maqui  = new Maquillaje();
            tierno = new Traje_Tierno();
            terror = new Traje_Terrorifico();

            mary = new Niño(maqui, tierno, 16);
            jony = new Niño(maqui, terror, 0);
            romo = new Niño(maqui, terror, 5);
            flor = new Niño(maqui, terror, 100);

            niños = new List <Asustador>()
            {
                mary, jony, romo
            };

            legion           = new Legion(niños);
            legionDeLegiones = new Legion(new List <Asustador>()
            {
                legion, flor
            });

            niños.Add(flor);
        }
Пример #13
0
        public USUARIO RecuperarContrasenia(string email)
        {
            USUARIO obj = null;

            obj = oDAO.Obtener(email);

            if (obj == null)
            {
                throw new FaultException <ExceptionBase>(
                          new ExceptionBase()
                {
                    Codigo      = "103",
                    Descripcion = "El Usuario no existe",
                }, new FaultReason("Error al intentar recuperar contraseña"));
            }


            Email oEmail = new Email()
            {
                EmailTo = obj.EMAIL,
                Cuerpo  = "Su contraseña de la app es " + obj.PASSWORD,
                Asunto  = "Recuperar contraseña"
            };


            Comun comun = new Comun();

            comun.Enviar(oEmail);

            return(obj);
        }
Пример #14
0
        private void CopiarComboAsig(ref List <Comun> LBXPasa)
        {
            try
            {
                SesionUsu.ListDetConceptoAsig.Clear();

                for (int i = 0; i < LBXPasa.Count; i++)
                {
                    ObjComun                = new Comun();
                    ObjComun.Id             = LBXPasa[i].Id;
                    ObjComun.IdStr          = LBXPasa[i].IdStr;
                    ObjComun.Descripcion    = LBXPasa[i].Descripcion;
                    ObjComun.EtiquetaDos    = LBXPasa[i].EtiquetaDos;
                    ObjComun.EtiquetaTres   = LBXPasa[i].EtiquetaTres;
                    ObjComun.EtiquetaCuatro = LBXPasa[i].EtiquetaCuatro;
                    ObjComun.EtiquetaCinco  = LBXPasa[i].EtiquetaCinco;
                    SesionUsu.ListDetConceptoAsig.Add(ObjComun);
                }
                //  Sorting(ref LBXRecibe);
                LBXPasa.Clear();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Пример #15
0
        //Metodo de Iserción de Datos
        public bool Insertar(Comun.Vars p)
        {
            bool Resultado = false;
               //Realizar metodo de conexión
            System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection();
            //Activa o Desactivar String de Conexion
            cn.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Wayvas\\Task\\Presentacion\\App_Data\\Task.mdf;Integrated Security=True;User Instance=True";
            //cn.ConnectionString = "Data Source=.\\SQLEXPRESS;Initial Catalog=Task;Integrated Security=True";
            cn.Open();//Iniciamos la Conexion

            System.Data.SqlClient.SqlCommand cm =new System.Data.SqlClient.SqlCommand();
            cm.Connection=cn;
            cm.CommandType=System.Data.CommandType.Text;
            cm.CommandText = "Insert into Task(TaskName,StartDate,DueDate,CompDate,TaskComs) Values(@P_TaskName,@P_StartDate,@P_DueDate,@P_CompDate,@P_TaskComs)";

            cm.Parameters.AddWithValue("@P_TaskName", p.TaskName);
            cm.Parameters.AddWithValue("@P_StartDate", p.StartDate);
            cm.Parameters.AddWithValue("@P_DueDate", p.DueDate);
            cm.Parameters.AddWithValue("@P_CompDate", p.CompDate);
            cm.Parameters.AddWithValue("@P_TaskComs", p.TaskComs);

            int ra = cm.ExecuteNonQuery();
                   if (ra==1)
                   { Resultado=true;}
            cn.Close();
            cn.Dispose();
            return Resultado;
        }
Пример #16
0
        private void Abrir()
        {
            try
            {
                Comun cds;
                CentrosSeleccionados = new List <Comun>();
                foreach (RadListBoxItem item in RadListBox1.Items)
                {
                    if (item.Checked)
                    {
                        cds             = new Comun();
                        cds.Id          = Convert.ToInt32(item.Value);
                        cds.Descripcion = item.Text;
                        CentrosSeleccionados.Add(cds);
                    }
                }

                RadAjaxManager1.ResponseScripts.Add("AbrirConf();");
                //var oWnd = radopen(dir, "AbrirRelacionGestor");
                //oWnd.center();
                //oWnd.Maximize();
                //args.set_cancel(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #17
0
        public void Setup()
        {
            carlos = new Comun();
            mabel  = new Abuelo(50);
            juana  = new Necios();

            maquillaje   = new Maquillaje();
            tiernos      = new Tiernos();
            terrorificos = new Terrorificos();

            maria  = new Niños(maquillaje, tiernos, 4, 16);
            juan   = new Niños(maquillaje, tiernos, 6, 3);
            tomas  = new Niños(maquillaje, terrorificos, 2, 14);
            camila = new Niños(maquillaje, terrorificos, 4, 5);

            niños = new List <Niños>();
            niños.Add(maria);
            niños.Add(juan);
            niños.Add(tomas);
            niños.Add(camila);

            miembros = new List <LegionDeTerror> {
                maria, juan, camila
            };

            legion   = new Legion(niños);
            legiones = new LegionesDeLegiones(new List <LegionDeTerror>()
            {
                legion, tomas
            });

            miembros.Add(tomas);
        }
Пример #18
0
        protected void SalvarFornecedor()
        {
            if (_Fornecedor.Id == 0)
            {
                _Fornecedor.Nome     = txtNome.Text;
                _Fornecedor.Servico  = txtDescricao.Text;
                _Fornecedor.Telefone = Comun.ApenasNumeros(txtTelefone.Text);
                _Fornecedor.Status   = 0;


                SvcFornecedor.AlteraSalvaFornecedor(_Fornecedor);
                Response.Redirect("ListaFornecedor.aspx");
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "AlertBox", "alert('Cadastrado com sucesso');", true);
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "AlertBox", "alert('Cadastrado com sucesso');", false);
            }
            else
            {
                _Fornecedor.Nome     = txtNome.Text;
                _Fornecedor.Servico  = txtDescricao.Text;
                _Fornecedor.Telefone = Comun.ApenasNumeros(txtTelefone.Text);
                _Fornecedor.Status   = 0;


                SvcFornecedor.AlteraSalvaFornecedor(_Fornecedor);
                Response.Redirect("ListaFornecedor.aspx");
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "AlertBox", "alert('Cadastrado com sucesso');", true);
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "AlertBox", "alert('Cadastrado com sucesso');", false);
            }
        }
Пример #19
0
        public List <Comun> ObetenerFechasAtendidosRegion()
        {
            List <Comun> lstComun = null;

            using (SqlConnection cn = AccesoBD.getConnnection())
            {
                cn.Open();
                using (SqlCommand cmd = new SqlCommand("UspObetenerFechasAtendidosRegion", cn))
                {
                    cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                    cmd.CommandTimeout = 0;
                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        if (reader != null)
                        {
                            lstComun = new List <Comun>();
                            Comun obeComun;
                            while (reader.Read())
                            {
                                obeComun             = new Comun();
                                obeComun.Codigo      = reader["Anio"];
                                obeComun.Descripcion = reader["Anio"];
                                lstComun.Add(obeComun);
                            }
                        }
                    }
                }
            }
            return(lstComun);
        }
Пример #20
0
        private static void BorrarPruebas(Crm crm, Comun co)
        {
            #region BORRAR PRODUCTOS
            //var queprod = new QueryExpression("product");
            ////quece.TopCount = 5000;

            //var prods = new EntityCollection();
            //while (true)
            //{
            //    var res1 = crm.GetIOS().RetrieveMultiple(queprod);
            //    prods.Entities.AddRange(res1.Entities);
            //    if (res1.MoreRecords)
            //    {
            //        queprod.PageInfo.PageNumber++;
            //        queprod.PageInfo.PagingCookie = res1.PagingCookie;
            //    }
            //    else
            //        break;
            //}
            //foreach (var ce in prods.Entities)
            //{
            //    crm.AnadirElementoEmr(new DeleteRequest()
            //    {
            //        Target = new EntityReference("product", ce.Id)
            //    });
            //}
            //crm.ProcesarUltimosEmr();
            #endregion BORRAR PRODuCTOS
            co.LogText("\n=============================== PRODUCTOS  BORRADOS ===================================\n");
        }
        public void GraficaRotacion(ref List <Comun> list, Usuario usu, string Conexion)
        {
            try
            {
                CapaDatos.CD_Datos CapaDatos = new CapaDatos.CD_Datos(Conexion);
                SqlDataReader      dr        = null;

                string[] Parametros = { "@Db", "@Id_Emp", "@Id_Cd", "@Id_U", "@Id_Cd_Ver", "@Id_TCd" };
                object[] Valores    = { usu.DbName, usu.Id_Emp, usu.Id_Cd, usu.Id_U, usu.Id_Cd_Ver, usu.Id_TCd };

                SqlCommand sqlcmd = CapaDatos.GenerarSqlCommand("spGraficaRotacion", ref dr, Parametros, Valores);
                Comun      comun;
                while (dr.Read())
                {
                    comun = new Comun();
                    comun.ValorDateTime = Convert.ToDateTime(dr.GetValue(dr.GetOrdinal("Fecha")));
                    comun.ValorDoble    = Convert.ToDouble(dr.GetValue(dr.GetOrdinal("Valor")));
                    list.Add(comun);
                }


                CapaDatos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #22
0
 public Oracle(Comun com)
 {
     ConnStringOracle   = com.OracleConnString;
     SchemaStringOracle = com.OracleEsquema;
     OraConn            = new OracleConnection(ConnStringOracle);
     OraConn.Open();
 }
        private void Inicializar()
        {
            try
            {
                List <Comun> List = new List <Comun>();
                Comun        c    = new Comun();
                c.Id          = -1;
                c.Descripcion = "--Todos--";
                List.Add(c);
                CmbCdi.DataSource     = List;
                CmbCdi.DataValueField = "Id";
                CmbCdi.DataTextField  = "Descripcion";
                CmbCdi.DataBind();
                CmbRepresentante.DataSource     = List;
                CmbRepresentante.DataValueField = "Id";
                CmbRepresentante.DataTextField  = "Descripcion";
                CmbRepresentante.DataBind();

                this.CmbCdi.Enabled           = false;
                this.CmbRepresentante.Enabled = false;
                this.CmbTipo.SelectedValue    = "-1";
                this.rdFechaIni.SelectedDate  = (DateTime?)null;
                this.rdFechaFin.SelectedDate  = (DateTime?)null;
                this.TxtDF_Comentario.Text    = string.Empty;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #24
0
        public void Monitor_Patrimonio(string Usuario, string Sistema, string Centro_Contable, ref List <Comun> List)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand cmm     = null;

            try
            {
                OracleDataReader dr = null;

                String[] Parametros = { "p_usuario", "p_id_sistema", "p_centro_contable" };
                String[] Valores    = { Usuario, Sistema, Centro_Contable };

                cmm = CDDatos.GenerarOracleCommandCursor("pkg_patrimonio.Obt_Grid_Monitor_Patrimonio", ref dr, Parametros, Valores);
                while (dr.Read())
                {
                    Comun objMonitor = new Comun();
                    objMonitor.Descripcion = Convert.ToString(dr.GetValue(1));
                    List.Add(objMonitor);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref cmm);
            }
        }
Пример #25
0
        static void Main(string[] args)
        {
            try
            {
                comunGlobal  = new Comun();
                crmGlobal    = new Crm(comunGlobal);
                oracleGlobal = new Oracle(crmGlobal, comunGlobal);
            }
            catch (Exception e)
            {
                comunGlobal.LogText("ERROR en MAIN ::: " + e.ToString());
                if (oracleGlobal != null && oracleGlobal.OraConnParaLog.State == ConnectionState.Open)
                {
                    oracleGlobal.OraConnParaLog.Dispose();
                }
                return;
            }

            //Estas dos lineas, para borrar (PRUEBAS SOLO)
            //crmGlobal.InicializarPFE(oracleGlobal);
            //BorrarPruebas(crmGlobal, comunGlobal);

            comunGlobal.LogText("|_________   Iniciando CARGA INICIAL _________|");

            sW_todo = new Stopwatch();
            sW_todo.Start();
            new LanzadorPublicaciones().Iniciar(oracleGlobal, comunGlobal, crmGlobal);
            sW_todo.Stop();
            comunGlobal.LogText("|_________/====> TIEMPO DE CARGA: " + sW_todo.Elapsed.ToString());
        }
Пример #26
0
 public testadoasignado(Comun.TEstandar estado)
 {
     this.Id = 0;
     this.Estado = estado;
     this.Fecha = DateTime.MinValue;
     this.Descripcion = string.Empty;
 }
Пример #27
0
        /*prueba*/
        public void LlenaCombo(string SP, string Conexion, ref System.Collections.Generic.List <Comun> list)
        {
            try
            {
                SqlDataReader      dr        = null;
                CapaDatos.CD_Datos CapaDatos = new CapaDatos.CD_Datos(Conexion);

                SqlCommand sqlcmd = CapaDatos.GenerarSqlCommand(SP, ref dr);

                Comun Comun = default(Comun);
                while (dr.Read())
                {
                    Comun             = new Comun();
                    Comun.Id          = dr.GetInt32(dr.GetOrdinal("Id"));
                    Comun.Descripcion = dr.GetString(dr.GetOrdinal("Descripcion"));
                    try
                    {
                        Comun.Relacion = dr.IsDBNull(dr.GetOrdinal("Relacion")) ? "" : dr.GetValue(dr.GetOrdinal("Relacion")).ToString();
                    }
                    catch
                    {
                        Comun.Relacion = "sin_relacion";
                    }
                    list.Add(Comun);
                }
                dr.Close();

                CapaDatos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #28
0
 public void Bind(Comun.TypeMr typemr, short idelement)
 {
     Init();
     this.Properties.DataSource = new ModMaterialReference().GetBy_TypeMr_And_Element(typemr, idelement);
     this.Properties.ValueMember = "Idmr_detail";
     this.Properties.DisplayMember = "Cod_mr";
 }
Пример #29
0
        public void LlenaCombo(string SP, ref List <Comun> list, string[] Parametros, string[] Valores)
        {
            CD_Datos      CDDatos = new CD_Datos();
            OracleCommand Cmm     = null;

            try
            {
                OracleDataReader dr = null;
                Cmm = CDDatos.GenerarOracleCommandCursor(SP, ref dr, Parametros, Valores);

                Comun Comun = default(Comun);
                while (dr.Read())
                {
                    Comun             = new Comun();
                    Comun.IdStr       = Convert.ToString(dr.GetValue(0));
                    Comun.Descripcion = Convert.ToString(dr.GetValue(1));
                    if (dr.FieldCount == 3)
                    {
                        Comun.EtiquetaDos = Convert.ToString(dr.GetValue(2));
                    }
                    else if (dr.FieldCount == 4)
                    {
                        Comun.EtiquetaDos  = Convert.ToString(dr.GetValue(2));
                        Comun.EtiquetaTres = Convert.ToString(dr.GetValue(3));
                    }
                    else if (dr.FieldCount == 5)
                    {
                        Comun.EtiquetaDos    = Convert.ToString(dr.GetValue(2));
                        Comun.EtiquetaTres   = Convert.ToString(dr.GetValue(3));
                        Comun.EtiquetaCuatro = Convert.ToString(dr.GetValue(4));
                    }
                    else if (dr.FieldCount == 6)
                    {
                        Comun.EtiquetaDos    = Convert.ToString(dr.GetValue(2));
                        Comun.EtiquetaTres   = Convert.ToString(dr.GetValue(3));
                        Comun.EtiquetaCuatro = Convert.ToString(dr.GetValue(4));
                        Comun.EtiquetaCinco  = Convert.ToString(dr.GetValue(5));
                    }
                    else if (dr.FieldCount == 7)
                    {
                        Comun.EtiquetaDos    = Convert.ToString(dr.GetValue(2));
                        Comun.EtiquetaTres   = Convert.ToString(dr.GetValue(3));
                        Comun.EtiquetaCuatro = Convert.ToString(dr.GetValue(4));
                        Comun.EtiquetaCinco  = Convert.ToString(dr.GetValue(5));
                        Comun.EtiquetaSeis   = Convert.ToString(dr.GetValue(6));
                    }
                    list.Add(Comun);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                CDDatos.LimpiarOracleCommand(ref Cmm);
            }
        }
Пример #30
0
        public Oracle(Crm crm, Comun comun)
        {
            Crm   = crm;
            Comun = comun;

            OraConnParaLog = new OracleConnection(Comun.ConnStringOracle);
            OraConnParaLog.Open();
        }
Пример #31
0
        public void SaveControlSample(int idtemplate_method_aa, long idbatch)
        {
            CTemplate_method    template_method     = new CTemplate_methodFactory().GetByPrimaryKey(new CTemplate_methodKeys(idtemplate_method_aa));
            CCorrelative        correlative         = new CCorrelativeFactory().GetByPrimaryKey(new CCorrelativeKeys(template_method.Cod_type_sample));
            CTemplate_method_aa templaate_method_aa = new CTemplate_method_aaFactory().GetByPrimaryKey(new CTemplate_method_aaKeys(idtemplate_method_aa));

            control_sample.Idtemplate_method = templaate_method_aa.Idtemplate_method;
            //control_sample.Idrecep_sample = idrecep_sample;
            //control_sample.Idrecep_sample_detail = idrecep_sample_detail;
            //control_sample.Idrecep_sample_detail_elem = idrecep_sample_detail_elem;
            control_sample.Weight1  = templaate_method_aa.Weight;
            control_sample.Weight2  = templaate_method_aa.Weight;
            control_sample.Volumen1 = templaate_method_aa.Volumen;
            control_sample.Volumen2 = templaate_method_aa.Volumen;
            control_sample.Dilu2    = templaate_method_aa.Dilution2;
            control_sample.Dilu3    = templaate_method_aa.Dilution3;

            control_sample.Flag_dilu2 = false;
            control_sample.Flag_dilu3 = false;

            control_sample.Flag_mri                 = 1;
            control_sample.Fum                      = methods.GetFactorConvertionUM(templaate_method_aa.Idtemplate_method);
            control_sample.Qaqc_blk                 = 3;
            control_sample.Qaqc_par                 = 3;
            control_sample.Qaqc_mr                  = 3;
            control_sample.Qaqc_error               = 0;
            control_sample.Qaqc_approve             = false;
            control_sample.Qaqc_review              = false;
            control_sample.Qaqc_has_retest          = 0;
            control_sample.Qaqc_tmp_retest          = 0;
            control_sample.Qaqc_tmp_retest_idmethod = 0;
            control_sample.Qaqc_approve_text        = "";
            control_sample.Qaqc_review_text         = "";

            // --- insert mri
            CBatch oBatch          = new CBatchFactory().GetByPrimaryKey(new CBatchKeys(idbatch));
            int    num_free_places = GetNumFreePlacesInBatch(idbatch, templaate_method_aa.Idtemplate_method);

            if (num_free_places >= 1)
            {
                if (!Convert.ToBoolean(oBatch.Has_sample_control)) // batch no tiene mri
                {
                    long index_mri = GetIndexMriPosition(idbatch);
                    if (index_mri > 0)
                    {
                        // --- insert mri
                        control_sample.Cod_interno = index_mri;
                        control_sample.Idbatch     = idbatch;
                        control_sample.Cod_sample  = Comun.FormatCorrelativeCode(correlative.Prefix + correlative.Cod_serie, index_mri, Convert.ToInt32(correlative.Num_digits));
                        if (faBatch_detail_aa_twofold.Insert(control_sample))
                        {
                            oBatch.Has_sample_control = true;
                            new CBatchFactory().Update(oBatch);
                        }
                    }
                }
            }
        }
Пример #32
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lblLeyenda.Text = "PORTAL MÉDICO / BANDEJA DE PACIENTES";
     if (!Page.IsPostBack)
     {
         Comun.CambiarIdiomaFilterGridTelerik(radGridPaciente);
         CargarIdentificaciones();
     }
 }
        protected void CarregarDropDown()
        {
            SortedList sl = Comun.GetEnumForBind(typeof(Enuns.tipos));

            txtTipo.DataSource     = sl;
            txtTipo.DataTextField  = "value";
            txtTipo.DataValueField = "key";
            txtTipo.DataBind();
        }
Пример #34
0
        public void BindConcen(Comun.TypeMr typemr, short idelement)
        {
            this.Properties.Columns.Clear();
            this.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo() { FieldName = "Nominal_value", Visible = true });
            this.Properties.ShowHeader = false;
            this.Properties.ShowFooter = false;

            this.Properties.DataSource = new ModMaterialReference().GetConcentration_By_TypeMr(typemr, idelement);
            this.Properties.ValueMember = "Nominal_value";
            this.Properties.DisplayMember = "Nominal_value";
        }
Пример #35
0
 Comun.MethodSaveProperty RequireNewVersionOrMethod(Comun.TypeAnalysis type_analysis)
 {
     Comun.MethodSaveProperty result = Comun.MethodSaveProperty.Nothing;
     switch (type_analysis)
     {
         case Comun.TypeAnalysis.AbsorcionAtomica:
             result = GetResultTestHeader();
             break;
     }
     return result;
 }
Пример #36
0
 public TEmpresa(string nombre, string rnc,string telefono,string telefono1,string fax, string web, string email, string email1, Comun.TDireccion direccion, object logo,string descripcion) {
     this.Nombre = nombre;
     this.Rnc = rnc;
     this.Telefono = telefono;
     this.Telefono1 = telefono1;
     this.Fax = fax;
     this.Web = web;
     this.Email1 = email1;
     this.Email = email;
     this.Direccion = direccion;
     this.Logo = logo;
     this.Descripcion = descripcion;
     this.Director = new RHH.tpersonal();
 }
Пример #37
0
        public CDataBatch(long p_idbatch, int p_idtemplate_method, Comun.StatusWork statusWork, Comun.CriteriaSort criteriaSort)
        {
            Idtemplate_method = p_idtemplate_method;
            Idbatch = p_idbatch;
            TypeBatch = statusWork;
            CriteriaSort = criteriaSort;
            CBatch_detail_aa_twofoldFactory faBatch_detail_aa_twofold = new CBatch_detail_aa_twofoldFactory();
            dtPivotBatch =
                new BindingList<CBatch_detail_aa_twofold>(
                    faBatch_detail_aa_twofold
                    .GetAll()
                    .Where(c => c.Idbatch == p_idbatch && c.Idtemplate_method == p_idtemplate_method).ToList());

            ExecuteQaqc(statusWork);
        }
Пример #38
0
Файл: Log.cs Проект: Wayvas/Task
        public bool insertar(Comun.Vars p)
        {
            bool Resultado = false;

            if (p != null)
            {
                if (p.StartDate != null)
                {
                    if  (!string.IsNullOrEmpty(p.TaskName))
                    {
                        if (p.DueDate != null)
                        {
                            AccesoADatos.Conn o = new AccesoADatos.Conn();
                            Resultado = o.Insertar(p);
                        }

                    }
                }
            }

            return Resultado;
        }
Пример #39
0
        private System.Windows.Forms.DialogResult OpenShowPopup(Comun.TypeSample type_sample)
        {
            CBatch_detail_aa_twofold current_row = oDataBatch.ListSamples[bgvBatchCalc2.FocusedRowHandle];
            System.Windows.Forms.DialogResult result = System.Windows.Forms.DialogResult.Cancel;

            FormCheckContent ofmPopupContent = new FormCheckContent();
            if (tabTreeQaqc.SelectedTabPageIndex == 0)
            {
                ofmPopupContent.Text = "Aprobar";
                ofmPopupContent.Windows_current = Comun.WindowsTray.PendingApprove;
            }
            else
            {
                ofmPopupContent.Text = "Revisar";
                ofmPopupContent.Windows_current = Comun.WindowsTray.PendingReview;
            }

            // --- retrieve observation and method
            ofmPopupContent.Idtemplate_method = Idtemplate_method;
            ofmPopupContent.Text_obs = bgvBatchCalc2.GetFocusedRowCellValue("Qaqc_approve_text").ToString();
            ofmPopupContent.Idretest = Convert.ToInt32(bgvBatchCalc2.GetFocusedRowCellValue("Qaqc_tmp_retest_idmethod"));
            ofmPopupContent.Idrecep_sample_detail_elem = Convert.ToInt64(bgvBatchCalc2.GetFocusedRowCellValue("Idrecep_sample_detail_elem"));
            ofmPopupContent.Idbatch = Idbatch;
            ofmPopupContent.TypeSample = type_sample;

            if (ofmPopupContent.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (tabTreeQaqc.SelectedTabPageIndex == 0) // approved samples
                {
                    // --- save observation and change of method
                    if (ofmPopupContent.Text_obs.Trim().Length > 0)
                    {
                        current_row.Qaqc_approve_text = ofmPopupContent.Text_obs;
                        current_row.Qaqc_tmp_retest_idmethod = 0;
                        current_row.Qaqc_tmp_retest = 0;

                        DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e =
                            new CellValueChangedEventArgs(bgvBatchCalc2.FocusedRowHandle, gv2col_Qaqc_approve_text, ofmPopupContent.Idtemplate_method);
                        ModifyWhenCellChanged(e);

                    }
                    if (ofmPopupContent.EnableRetest)
                    {
                        current_row.Qaqc_approve_text = ofmPopupContent.Text_obs;
                        current_row.Qaqc_tmp_retest_idmethod = ofmPopupContent.Idtemplate_method;
                        current_row.Qaqc_tmp_retest = 1;
                        current_row.Qaqc_has_retest = 1;

                        DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e =
                            new CellValueChangedEventArgs(bgvBatchCalc2.FocusedRowHandle, gv2col_Qaqc_tmp_retest_idmethod, ofmPopupContent.Idtemplate_method);
                        ModifyWhenCellChanged(e);
                    }
                    //oPivotDataBatch.ListSamples[bgvBatchCalc2.FocusedRowHandle].Qaqc_approve = true;

                    result = System.Windows.Forms.DialogResult.OK;
                }
                else // review samples
                {
                    // --- save observation and change of method
                    if (ofmPopupContent.Text_obs.Trim().Length > 0)
                    {
                        current_row.Qaqc_review_text = ofmPopupContent.Text_obs;
                        current_row.Qaqc_tmp_retest_idmethod = 0;
                        current_row.Qaqc_tmp_retest = 0;

                        DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e =
                            new CellValueChangedEventArgs(bgvBatchCalc2.FocusedRowHandle, gv2col_Qaqc_review_text, ofmPopupContent.Idtemplate_method);
                        ModifyWhenCellChanged(e);
                    }
                    if (ofmPopupContent.EnableRetest)
                    {
                        current_row.Qaqc_review_text = ofmPopupContent.Text_obs;
                        current_row.Qaqc_tmp_retest_idmethod = ofmPopupContent.Idtemplate_method;
                        current_row.Qaqc_tmp_retest = 1;
                        current_row.Qaqc_has_retest = 1;

                        DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e =
                            new CellValueChangedEventArgs(bgvBatchCalc2.FocusedRowHandle, gv2col_Qaqc_tmp_retest_idmethod, ofmPopupContent.Idtemplate_method);
                        ModifyWhenCellChanged(e);
                    }

                    bgvBatchCalc2.UpdateCurrentRow();
                    result = System.Windows.Forms.DialogResult.OK;
                }
            }
            else
            {
                if (tabTreeQaqc.SelectedTabPageIndex == 0) // approved samples
                    bgvBatchCalc2.SetRowCellValue(bgvBatchCalc2.FocusedRowHandle, "Qaqc_approve", false);
            }

            // --- OPTIMIZAR A USER CONTROL
            if (AllSamplesApproveSelected())
                paAuthorization.Visible = true;
            else
                paAuthorization.Visible = false;

            return result;
        }
Пример #40
0
        void InitTreeBatch(Comun.StatusWork statusWork)
        {
            if (statusWork == Comun.StatusWork.Waiting)
            {
                treeTrayWaiting.DataSource = new ModQaQc().GetAllTree(cbAuthorizationWait.EditValue.ToString(), "M002", false, deFrom.DateTime, deUntil.DateTime, 0, 0);

                if (treeTrayWaiting.Nodes.Count > 0)
                {
                    treeTrayWaiting.FocusedNode = treeTrayWaiting.Nodes.FirstNode;
                }
                else
                {
                    gcBachCalc.DataSource = null;
                }

                treeTrayWaiting.BestFitColumns();
                treeTrayWaiting.Columns["Date_result"].SortOrder = SortOrder.Ascending;
                treeTrayWaiting.Columns["Hour_result"].SortOrder = SortOrder.Ascending;
            }
            else if (statusWork == Comun.StatusWork.Management)
            {
                bool enabled_history = false;
                if (cbAuthorizationApproved.EditValue.ToString() == "0000")
                    enabled_history = true;

                long? idrecep_sample_detail = null;
                if (ckSample.Checked)
                    idrecep_sample_detail = Convert.ToInt64(txSample.EditValue);

                long? idcompany = null;
                if (ckCompany.Checked)
                    idcompany = Convert.ToInt64(cbCompany.EditValue);

                treeTrayFinished.DataSource =
                    new ModQaQc().GetAllTree(cbAuthorizationApproved.EditValue.ToString(), "M003", enabled_history, deFrom.DateTime, deUntil.DateTime, idrecep_sample_detail, idcompany);

                if (treeTrayFinished.Nodes.Count > 0)
                {
                    //treeTrayFinished.FocusedNode = treeTrayFinished.Nodes[0].ParentNode;
                    treeTrayFinished.FocusedNode = treeTrayFinished.Nodes.FirstNode;
                }
                else
                {
                    gcBachCalc.DataSource = null;
                }
                treeTrayFinished.BestFitColumns();
                treeTrayWaiting.Columns["Date_result"].SortOrder = SortOrder.Ascending;
                treeTrayWaiting.Columns["Hour_result"].SortOrder = SortOrder.Ascending;
            }
        }
Пример #41
0
 public void Show_controls(Comun.WindowsTray window)
 {
     if (window == Comun.WindowsTray.PendingApprove)
     {
         this.Text = "Aprobar";
         gvListRetest.OptionsBehavior.Editable = false;
         btOkLstRetest.Enabled = false;
     }
     else
     {
         this.Text = "Revisar";
         if (Has_wait_samples())
         {
             gvListRetest.OptionsBehavior.Editable = false;
             btOkLstRetest.Enabled = false;
         }
         else
         {
             gvListRetest.OptionsBehavior.Editable = true;
             btOkLstRetest.Enabled = true;
         }
     }
 }
Пример #42
0
 void ShowColumnsByTypeAnalysis(Comun.TypeAnalysis type_analysis)
 {
     switch (type_analysis)
     {
         case Comun.TypeAnalysis.AbsorcionAtomica:
             ShowColumnsAA();
             break;
         case Comun.TypeAnalysis.Volumetria:
             ShowColumnsVC();
             break;
         case Comun.TypeAnalysis.Gravimetria:
             ShowColumnsGR();
             break;
         case Comun.TypeAnalysis.NewmontAA:
             ShowColumnsNewmontAA();
             break;
         case Comun.TypeAnalysis.NewmontGr:
             ShowColumnsNewmontGR();
             break;
     }
 }
Пример #43
0
 public void ExecuteQaqc(Comun.StatusWork statusWork)
 {
     if (statusWork == Comun.StatusWork.Waiting)
     {
         oQualitycontrol = new CQualityControl(ListSamples, Idtemplate_method);
         RefreshQaqcSummary();
     }
     else
         RefreshQaqcSummary();
 }
Пример #44
0
 public tpersonaRelacionada(RHH.tpersonal persona, Comun.TEstandar parentesco, bool esnuevo)
 {
     this.Parentesco = parentesco;
     this.EsNuevo = esnuevo;
     this.Persona = persona;
 }