Exemplo n.º 1
0
        public in_Categoria_x_Formula Get_Info_Categoria_x_Formula(int IdCategoria, int IdEmpresa)
        {
            try
            {
                in_Categoria_x_Formula   categoria_x_formula = new in_Categoria_x_Formula();
                EntitiesInventarioEdehsa OEt = new EntitiesInventarioEdehsa();
                var categoriaxformula        = OEt.in_Categoria_x_Formula.First(var =>
                                                                                var.IdCategoria == IdCategoria && var.IdEmpresa == IdEmpresa);

                categoria_x_formula.formula        = categoriaxformula.formula;
                categoria_x_formula.tiene_longitud = categoriaxformula.tiene_longitud;
                categoria_x_formula.tiene_espesor  = categoriaxformula.tiene_espesor;
                categoria_x_formula.tiene_ancho    = categoriaxformula.tiene_ancho;
                categoria_x_formula.tiene_alto     = categoriaxformula.tiene_alto;
                categoria_x_formula.tiene_ceja     = categoriaxformula.tiene_ceja;
                categoria_x_formula.tiene_diametro = categoriaxformula.tiene_diametro;
                categoria_x_formula.estado         = categoriaxformula.estado;


                return(categoria_x_formula);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemplo n.º 2
0
        public Boolean GrabarDB(in_Categoria_x_Formula_Info info, ref int id, ref string msg)
        {
            try
            {
                using (EntitiesInventarioEdehsa context = new EntitiesInventarioEdehsa())
                {
                    var address = new in_Categoria_x_Formula();
                    int idpv    = GetId(info.IdEmpresa);
                    id = idpv;
                    address.IdEmpresa = info.IdEmpresa;


                    address.IdCategoria    = info.IdCategoria;
                    address.tiene_longitud = info.tiene_longitud;
                    address.tiene_espesor  = info.tiene_espesor;
                    address.tiene_ancho    = info.tiene_ancho;
                    address.tiene_alto     = info.tiene_alto;
                    address.tiene_ceja     = info.tiene_ceja;
                    address.tiene_diametro = info.tiene_diametro;
                    address.densidad       = info.densidad;
                    address.formula        = info.formula;
                    address.estado         = info.estado;


                    context.in_Categoria_x_Formula.Add(address);
                    context.SaveChanges();
                    msg = "Se ha procedido a grabar el registro de la Categoria, sus dimensiones y formula: "
                          //+ info.tp_descripcion
                          + " exitosamente.";
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                msg     = "Se ha producido el siguiente error: " + ex.Message;
                throw new Exception(mensaje);
            }
        }
Exemplo n.º 3
0
        public List <in_Categoria_x_Formula> Get_List_Categoria_x_Formula()
        {
            try
            {
                List <in_Categoria_x_Formula> lM     = new List <in_Categoria_x_Formula>();
                EntitiesInventarioEdehsa      OEUser = new EntitiesInventarioEdehsa();
                //Core.Erp.Data.Inventario_Edehsa.
                var select_ = from TI in OEUser.in_Categoria_x_Formula
                              select TI;


                foreach (var item in select_)
                {
                    in_Categoria_x_Formula dat_ = new in_Categoria_x_Formula();

                    dat_.IdEmpresa      = item.IdEmpresa;
                    dat_.IdCategoria    = item.IdCategoria;
                    dat_.tiene_longitud = item.tiene_longitud;
                    dat_.tiene_espesor  = item.tiene_espesor;
                    dat_.tiene_ancho    = item.tiene_ancho;
                    dat_.tiene_alto     = item.tiene_alto;
                    dat_.tiene_ceja     = item.tiene_ceja;
                    dat_.tiene_diametro = item.tiene_diametro;
                    dat_.densidad       = item.densidad;
                    dat_.formula        = item.formula;
                    dat_.estado         = item.estado;

                    lM.Add(dat_);
                }
                return(lM);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }