예제 #1
0
        private void gridLkUOrdenTaller_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                if (gridLkUOrdenTaller.EditValue != null && gridLkUOrdenTaller.EditValue != "")
                {
                    List <prd_SubGrupoTrabajo_Info> lstGT = new List <prd_SubGrupoTrabajo_Info>();
                    OT = busOT.ObtenerUnaOT(param.IdEmpresa, _sucursalInfo.IdSucursal,
                                            Convert.ToDecimal(gridLkUOrdenTaller.EditValue), UCObra.get_item());
                    lstGT = busGT.ObtenerGrupoTrabajoCab_x_OT(param.IdEmpresa, Convert.ToInt32(UCSuc_Bod.cmb_sucursal.EditValue), Convert.ToDecimal(gridLkUOrdenTaller.EditValue));
                    gridLkUGrupoTrabajo.Properties.DataSource = lstGT;
                    if (lstGT.Count > 0)
                    {
                        gridLkUGrupoTrabajo.SelectionStart = 1;
                    }
                    gridVwEnsamblado.SelectAll();
                    gridVwEnsamblado.DeleteSelectedRows();

                    cargadataproducto(OT);
                }
                else
                {
                    gridLkUGrupoTrabajo.Text = "";
                    txtCantAProducir.Text    = "";

                    txtProducto.Text = "";
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }
        private void gridLkUOrdenTaller_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                LstSaldoxOT = new List <vwprd_Saldos_x_Req_x_OT_x_Consumo_Info>();
                getSucBod();
                if (CmbOrdenTaller.EditValue != "")
                {
                    LstSaldoxOT = BusDetxItems.DisponiblesxReqOt(param.IdEmpresa, UCObra.get_item(), _sucursalInfo.IdSucursal,
                                                                 Convert.ToDecimal(CmbOrdenTaller.EditValue), ref msg);
                    if (LstSaldoxOT != null)
                    {
                        LstSaldoxOT.ForEach(var => var.saldo = (var.saldo == null) ? var.ped_saldo : var.saldo);
                    }


                    cargadisponible();

                    prd_OrdenTaller_Bus BusOT = new prd_OrdenTaller_Bus();
                    OT = BusOT.ObtenerUnaOT(param.IdEmpresa, ctrl_Sucbod.get_sucursal().IdSucursal,
                                            Convert.ToDecimal(CmbOrdenTaller.EditValue), UCObra.get_item());
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                // MessageBox.Show(ex.InnerException.ToString());
            }
        }
예제 #3
0
        public void setCab(prd_Ensamblado_CusCider_Info Info)
        {
            try
            {
                Ensamblado = Info;
                _sucursalInfo.IdEmpresa  = _bodegaInfo.IdEmpresa = Info.IdEmpresa;
                _sucursalInfo.IdSucursal = _bodegaInfo.IdSucursal = Info.IdSucursal;
                _bodegaInfo.IdBodega     = Info.IdBodega;
                UCObra.set_item(Info.CodObra);
                UCSuc_Bod.set_sucursal(_sucursalInfo);
                UCSuc_Bod.set_bodega(_bodegaInfo);
                OT = busOT.ObtenerUnaOT(param.IdEmpresa, Info.IdSucursal,
                                        Info.IdOrdenTaller, Info.CodObra);
                gridLkUOrdenTaller.EditValue = OT.IdOrdenTaller;
                GT = busGT.OBtenerGT(param.IdEmpresa, Info.IdSucursal,
                                     Info.IdGrupoTrabajo);
                gridLkUGrupoTrabajo.EditValue = GT.IdGrupoTrabajo;
                txtEnsamblado.Text            = Convert.ToString(Info.IdEnsamblado);
                txtObservacion.Text           = Info.Observacion;
                txtCodBarra.Text = Info.CodigoBarra;
                dtPfecha.Value   = Info.FechaTransac;
                prd_Ensamblado_Det_CusCider_Bus busDetEns = new prd_Ensamblado_Det_CusCider_Bus();
                DetalleEnsam = busDetEns.ConsultaEnsamblado(Info.IdEmpresa,
                                                            Info.IdSucursal, Info.IdEnsamblado, ref msg);
                cargagrid(DetalleEnsam);

                List <vwIn_Movi_Inven_x_TI_CusCider_Cab_Info> LstMov = new List <vwIn_Movi_Inven_x_TI_CusCider_Cab_Info>();
                LstMov = Bus_mv_detXpro.ConsultaMovimienosxEnsamblado(Ensamblado.IdEnsamblado, Ensamblado.IdSucursal, Ensamblado.IdEmpresa);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }
예제 #4
0
        public prd_OrdenTaller_Info   get_item_info()
        {
            try
            {
                prd_OrdenTaller_Info InfoOrdenTaller = new prd_OrdenTaller_Info();


                if (UC_OrdenTaller.EditValue != null)
                {
                    InfoOrdenTaller = (prd_OrdenTaller_Info)UC_OrdenTaller.Properties.View.GetFocusedRow();
                }
                else
                {
                    return(new prd_OrdenTaller_Info());
                }

                return(InfoOrdenTaller);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                return(new prd_OrdenTaller_Info());
            }
        }
예제 #5
0
        public void setCab(com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info InfoLisMat)
        {
            prd_OrdenTaller_Info InfoOT = new prd_OrdenTaller_Info();

            try
            {
                //// LLENAR LOS COMBOS DE LOS DATOS DE LA ORDEN

                //InfoLMat = InfoLisMat;
                //ucGe_Sucursal_combo1.set_SucursalInfo(InfoLisMat.IdSucursal);
                //Obra.set_item(InfoLisMat.CodObra_preasignada);
                //dtpFechareg.Value = InfoLisMat.FechaReg;
                //txtIdLMat.Text = Convert.ToString(InfoLisMat.IdNumMovi);
                ////dTPFecRegOT.Value = InfoOT.FechaReg;
                //txtUsuario.Text = InfoLisMat.Usuario;
                //txtObservacion.Text = InfoLisMat.lm_Observacion;
                ////txtIdOT.Text =Convert.ToString( InfoOT.IdOrdenTaller);
                //if (InfoLisMat.Estado == "I")
                //{
                //    lblAnulado.Visible = true;
                //    set_Accion(Cl_Enumeradores.eTipo_action.consultar);
                //}
                //cargagrid(InfoLisMat);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }
예제 #6
0
        private void gridLkUOrdenTaller_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                UCSuc_Bod.get_bodega();
                ListadoDisponible = new BindingList <in_Producto_Info>();
                gridControlDisponible.DataSource = ListadoDisponible;

                if (gridLkUOrdenTaller.EditValue != null && gridLkUOrdenTaller.EditValue != "")
                {
                    OT = busOT.ObtenerUnaOT(param.IdEmpresa, _sucursalInfo.IdSucursal,
                                            Convert.ToDecimal(gridLkUOrdenTaller.EditValue), UCObra.get_item());
                    lstGT = busGT.ObtenerGrupoTrabajoCab_x_OT(param.IdEmpresa, Convert.ToInt32(UCSuc_Bod.cmb_sucursal.EditValue), Convert.ToDecimal(gridLkUOrdenTaller.EditValue));
                    gridLkUGrupoTrabajo.Properties.DataSource = lstGT;

                    cargadataproducto(OT);
                }
                else
                {
                    gridLkUGrupoTrabajo.Text = "";
                    txtCantAProducir.Text    = "";
                    txtProducto.Text         = "";
                }
                //*********************
                CargarData();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }
예제 #7
0
        public void setCab(com_ListadoDiseno_Info InfoLisMat)
        {
            prd_OrdenTaller_Info InfoOT = new prd_OrdenTaller_Info();

            try
            {
                // LLENAR LOS COMBOS DE LOS DATOS DE LA ORDEN

                InfoLDiseno = InfoLisMat;
                ucGe_Sucursal_combo1.set_SucursalInfo(InfoLisMat.IdSucursal);
                Obra.set_item(InfoLisMat.CodObra);
                dtpFechareg.Value = InfoLisMat.FechaReg;

                cmbListadoDisenoTipo.EditValue = InfoLisMat.tipo_listado;
                InfoOT = BUSOT.ObtenerUnaOT(param.IdEmpresa, InfoLisMat.IdSucursal, InfoLisMat.IdOrdenTaller, InfoLisMat.CodObra);

                txtUsuario.Text     = InfoLisMat.Usuario;
                txtObservacion.Text = InfoLisMat.lm_Observacion;

                if (InfoLisMat.Estado == "I")
                {
                    lblAnulado.Visible = true;
                    set_Accion(Cl_Enumeradores.eTipo_action.consultar);
                }
                cargagrid(InfoLisMat);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }
        public vwprd_CantidadEnsamblada_x_OT_CusCider_Info TraerCantEnsamb(prd_OrdenTaller_Info OT, ref string msg)
        {
            try
            {
                vwprd_CantidadEnsamblada_x_OT_CusCider_Info info = new vwprd_CantidadEnsamblada_x_OT_CusCider_Info();

                EntitiesProduccion_Cidersus OEnti = new EntitiesProduccion_Cidersus();

                var objeto = OEnti.vwprd_CantidadEnsamblada_x_OT_CusCider.FirstOrDefault(var => var.IdEmpresa == OT.IdEmpresa && var.IdSucursal == OT.IdSucursal && var.IdOrdenTaller == OT.IdOrdenTaller && var.CodObra == OT.CodObra);
                if (objeto != null)
                {
                    info.IdEmpresa      = objeto.IdEmpresa;
                    info.IdSucursal     = objeto.IdSucursal;
                    info.CodObra        = objeto.CodObra;
                    info.IdOrdenTaller  = objeto.IdOrdenTaller;
                    info.CantidadPieza  = objeto.CantidadPieza;
                    info.CantEnsamblada = Convert.ToInt32(objeto.CantEnsamblada);
                }
                return(info);
            }
            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);
                msg = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }
예제 #9
0
 public Boolean Anular(int idempresa, prd_OrdenTaller_Info info, ref string msg)
 {
     try
     {
         using (EntitiesProduccion_Cidersus context = new EntitiesProduccion_Cidersus())
         {
             var contact = context.prd_Orden_Taller.FirstOrDefault(A => A.IdEmpresa == idempresa && A.IdSucursal == info.IdSucursal && A.IdOrdenTaller == info.IdOrdenTaller && A.CodObra == info.CodObra);
             if (contact != null)
             {
                 contact.Estado = info.Estado;
                 context.SaveChanges();
                 msg = "Se Cambio el estado de la Orden de Taller :" + info.Codigo.ToString() + " 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);
         msg = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         throw new Exception(ex.ToString());
     }
 }
예제 #10
0
        public Boolean GrabarDB(int idempresa, prd_OrdenTaller_Info info, ref string msg, ref decimal idgenerada, ref string numDoc)
        {
            try
            {
                using (EntitiesProduccion_Cidersus context = new EntitiesProduccion_Cidersus())
                {
                    var address = new prd_Orden_Taller();
                    idgenerada = getNumDoc(idempresa, info.IdSucursal);

                    address.IdEmpresa     = idempresa;
                    address.IdSucursal    = info.IdSucursal;
                    address.IdOrdenTaller = idgenerada;
                    address.CodObra       = info.CodObra;
                    //Para pasarla al winform
                    address.IdCliente  = info.IdCliente;
                    address.IdProducto = info.IdProducto;
                    //address.NumeroOT = idgenerada;
                    address.TotalPeso     = info.TotalPeso;
                    address.Estado        = info.Estado;
                    address.FechaReg      = info.FechaReg;
                    address.CantidadPieza = info.CantidadPieza;

                    address.LongitudUnitaria = info.LongitudUnitaria;
                    address.TotalLongitud    = info.TotalLongitud;
                    address.IdListadoDiseno  = info.IdListadoDiseno;
                    address.Observacion      = info.Observacion;
                    address.PesoUnitaro      = info.PesoUnitario;
                    if (info.Codigo == string.Empty)
                    {
                        info.Codigo = idgenerada.ToString("00");
                    }
                    while ((VerificarCodigo(info.Codigo)))
                    {
                        info.Codigo = info.Codigo + "-0";
                    }

                    address.Codigo = info.Codigo;
                    numDoc         = address.Codigo;

                    context.prd_Orden_Taller.Add(address);
                    context.SaveChanges();
                }
                msg = "Se ha generado la Orden de Taller # " + numDoc + " 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);
                mensaje = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
예제 #11
0
 public prd_OrdenTaller_Info ObtenerUnaOT(int IdEmpresa, int IdSucursal, decimal IdOrdenTaller, string CodObra)
 {
     try
     {
         EntitiesProduccion_Cidersus OEProduccion = new EntitiesProduccion_Cidersus();
         var registros = from A in OEProduccion.vwprd_OrdenTaller
                         where A.IdEmpresa == IdEmpresa &&
                         A.IdSucursal == IdSucursal &&
                         A.IdOrdenTaller == IdOrdenTaller &&
                         A.CodObra == CodObra
                         select A;
         if (registros.ToList().Count > 0)
         {
             prd_OrdenTaller_Info info = new prd_OrdenTaller_Info();
             foreach (var item in registros)
             {
                 info.IdEmpresa        = item.IdEmpresa;
                 info.IdSucursal       = item.IdSucursal;
                 info.CodObra          = item.CodObra;
                 info.IdOrdenTaller    = item.IdOrdenTaller;
                 info.IdProducto       = item.IdProducto;
                 info.NumeroOT         = item.NumeroOT;
                 info.CantidadPieza    = item.CantidadPieza;
                 info.TotalPeso        = item.TotalPeso;
                 info.Estado           = item.Estado;
                 info.Observacion      = item.Observacion;
                 info.PesoUnitario     = item.PesoUnitaro;
                 info.Codigo           = item.Codigo;
                 info.FechaReg         = item.ot_FechaReg;
                 info.CodObra          = item.CodObra;
                 info.ob_descripcion   = item.ob_descripcion;
                 info.NomProducto      = item.pr_descripcion;
                 info.NomSucursal      = item.Su_Descripcion;
                 info.LongitudUnitaria = Convert.ToDecimal(item.longitudProducto);
                 info.TotalLongitud    = item.TotalLongitud;
             }
             return(info);
         }
         else
         {
             return(new prd_OrdenTaller_Info());
         }
     }
     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);
         mensaje = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.ToString());
     }
 }
예제 #12
0
        public List <prd_OrdenTaller_Info> ObtenerListaOT_x_Obra(int idempresa, string CodObra)
        {
            try
            {
                List <prd_OrdenTaller_Info> lm      = new List <prd_OrdenTaller_Info>();
                EntitiesProduccion_Cidersus OEEtapa = new EntitiesProduccion_Cidersus();
                var registros = from A in OEEtapa.vwprd_OrdenTaller
                                where A.IdEmpresa == idempresa && A.CodObra == CodObra
                                orderby A.NumeroOT
                                select A;
                foreach (var item in registros)
                {
                    prd_OrdenTaller_Info info = new prd_OrdenTaller_Info();
                    info.IdEmpresa        = item.IdEmpresa;
                    info.IdSucursal       = item.IdSucursal;
                    info.CodObra          = item.CodObra;
                    info.IdOrdenTaller    = item.IdOrdenTaller;
                    info.IdProducto       = item.IdProducto;
                    info.NumeroOT         = item.NumeroOT;
                    info.CantidadPieza    = item.CantidadPieza;
                    info.TotalPeso        = item.TotalPeso;
                    info.Estado           = item.Estado;
                    info.Observacion      = item.Observacion;
                    info.PesoUnitario     = item.PesoUnitaro;
                    info.Codigo           = item.Codigo;
                    info.FechaReg         = item.ot_FechaReg;
                    info.CodObra          = item.CodObra;
                    info.ob_descripcion   = item.ob_descripcion;
                    info.NomProducto      = item.pr_descripcion;
                    info.Referencia       = "[" + item.CodObra.Trim() + "]" + " - " + item.ob_descripcion.Trim();
                    info.NomSucursal      = item.Su_Descripcion;
                    info.ca_categorias    = item.ca_Categoria;
                    info.IdCliente        = item.IdCliente;
                    info.IdListadoDiseno  = item.IdListadoDiseno;
                    info.ListadoDiseno    = item.lm_Observacion;
                    info.LongitudUnitaria = Convert.ToDecimal(item.longitudProducto);
                    info.TotalLongitud    = item.TotalLongitud;

                    lm.Add(info);
                }
                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);
                mensaje = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
예제 #13
0
 void cargadataproducto(prd_OrdenTaller_Info info)
 {
     try
     {
         txtProducto.Text = busprod.Get_DescripcionTot_Producto(param.IdEmpresa, OT.IdProducto);
         ObtenerCantAProd(OT);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.Message);
     }
 }
예제 #14
0
 public Boolean GrabarDB(int idempresa, prd_OrdenTaller_Info info, ref string msg, ref decimal idgenerada, ref string numDoc)
 {
     try
     {
         return(data.GrabarDB(idempresa, info, ref msg, ref idgenerada, ref numDoc));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GrabarDB", ex.Message), ex)
               {
                   EntityType = typeof(prd_OrdenTaller_Bus)
               };
     }
 }
예제 #15
0
 public Boolean Anular(int idempresa, prd_OrdenTaller_Info info, ref string msg)
 {
     try
     {
         return(data.Anular(idempresa, info, ref msg));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Anular", ex.Message), ex)
               {
                   EntityType = typeof(prd_OrdenTaller_Bus)
               };
     }
 }
 public vwprd_CantidadEnsamblada_x_OT_CusCider_Info TraerCantEnsamb(prd_OrdenTaller_Info OT, ref string msg)
 {
     try
     {
         return(Data.TraerCantEnsamb(OT, ref msg));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "TraerCantEnsamb", ex.Message), ex)
               {
                   EntityType = typeof(prd_Ensamblado_CusCider_Bus)
               };
     }
 }
        public void set_OT(prd_OrdenTaller_Info OTinfo)
        {
            try
            {
                InfoOrdenTaller   = OTinfo;
                txt_IDOT.Text     = OTinfo.IdOrdenTaller.ToString();
                txt_CodigoOT.Text = OTinfo.Codigo;
                ucGe_Sucursal.set_SucursalInfo(Convert.ToInt32(OTinfo.IdSucursal));
                UCOBra.set_item(OTinfo.CodObra);

                carga_CmbListadoDiseno(param.IdEmpresa, OTinfo.IdSucursal, OTinfo.CodObra);
                cmbListadoDiseno.EditValue = Convert.ToInt32(OTinfo.IdListadoDiseno);

                TxtDescripcion.Text = OTinfo.ob_descripcion;

                CmbProductos.EditValue = OTinfo.IdProducto;
                ucFa_Cliente_Facturacion1.cmb_cliente.EditValue = OTinfo.IdCliente;
                if (OTinfo.Estado == "A")
                {
                    lblAnulado.Visible = false;
                }
                else
                {
                    lblAnulado.Visible = true;
                }

                txt_Cantidad.EditValue  = OTinfo.CantidadPieza;
                txt_PesoTotal.EditValue = OTinfo.TotalPeso;
                txt_PesoUnit.EditValue  = OTinfo.PesoUnitario;
                txt_Observacion.Text    = OTinfo.Observacion;
                txt_CodigoOT.Text       = Convert.ToString(OTinfo.Codigo) ?? "0";
                if (txt_IDOT.Text == "")
                {
                    txt_CodigoOT.Text = txt_IDOT.Text;
                }

                cmbListadoDiseno.EditValue = OTinfo.IdListadoDiseno;
                setearprodterm(param.IdEmpresa, OTinfo.IdSucursal, OTinfo.CodObra);

                carga_UltraCmbEProdTerm();
                CmbProductos.EditValue = OTinfo.IdProducto;
            }

            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
예제 #18
0
        public Boolean ModificarDB(int idempresa, prd_OrdenTaller_Info info, ref string msg)
        {
            try
            {
                using (EntitiesProduccion_Cidersus context = new EntitiesProduccion_Cidersus())
                {
                    var contact = context.prd_Orden_Taller.FirstOrDefault(obj => obj.IdEmpresa == idempresa && obj.IdSucursal == info.IdSucursal && obj.CodObra == info.CodObra && obj.IdOrdenTaller == info.IdOrdenTaller);
                    if (contact != null)
                    {
                        contact.IdEmpresa     = idempresa;
                        contact.IdSucursal    = info.IdSucursal;
                        contact.CodObra       = info.CodObra;
                        contact.IdOrdenTaller = info.IdOrdenTaller;
                        contact.IdProducto    = info.IdProducto;
                        contact.NumeroOT      = info.NumeroOT;
                        contact.TotalPeso     = info.TotalPeso;

                        contact.LongitudUnitaria = info.LongitudUnitaria;
                        contact.TotalLongitud    = info.TotalLongitud;

                        contact.Estado          = info.Estado;
                        contact.FechaReg        = info.FechaReg;
                        contact.CantidadPieza   = info.CantidadPieza;
                        contact.Observacion     = info.Observacion;
                        contact.PesoUnitaro     = info.PesoUnitario;
                        contact.Codigo          = info.Codigo;
                        contact.IdCliente       = info.IdCliente;
                        contact.IdListadoDiseno = info.IdListadoDiseno;

                        context.SaveChanges();
                        msg = "Se ha procedido actualizar el registro de la Orden de Taller #: " + info.Codigo + " 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);
                msg = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }
예제 #19
0
        private void UC_OrdenTaller_EditValueChanged_1(object sender, EventArgs e)
        {
            try
            {
                _InfoOrdenTaller = (prd_OrdenTaller_Info)UC_OrdenTaller.Properties.View.GetFocusedRow();


                this.Event_UCOrdenTaller_SelectionChanged(sender, e);

                Event_UCOrdenTaller_EditValueChanged(sender, e);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
예제 #20
0
 public List <prd_OrdenTaller_Info> GetLisOrdenTaller(int idempresa, int IdSucursal, string CodObra)
 {
     try
     {
         List <prd_OrdenTaller_Info> lm      = new List <prd_OrdenTaller_Info>();
         EntitiesProduccion_Cidersus OEEtapa = new EntitiesProduccion_Cidersus();
         var registros = from A in OEEtapa.prd_Orden_Taller
                         where A.IdEmpresa == idempresa &&
                         A.CodObra == CodObra &&
                         A.IdSucursal == IdSucursal
                         orderby A.NumeroOT
                         select A;
         foreach (var item in registros)
         {
             prd_OrdenTaller_Info info = new prd_OrdenTaller_Info();
             info.IdEmpresa     = item.IdEmpresa;
             info.IdSucursal    = item.IdSucursal;
             info.CodObra       = item.CodObra;
             info.IdOrdenTaller = item.IdOrdenTaller;
             info.IdProducto    = item.IdProducto;
             info.NumeroOT      = item.NumeroOT;
             info.CantidadPieza = item.CantidadPieza;
             info.TotalPeso     = item.TotalPeso;
             info.Estado        = item.Estado;
             info.Observacion   = item.Observacion;
             info.PesoUnitario  = item.PesoUnitaro;
             info.Codigo        = item.Codigo;
             lm.Add(info);
         }
         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);
         mensaje = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.ToString());
     }
 }
예제 #21
0
        private int ObtenerCantAProd(prd_OrdenTaller_Info info)
        {
            try
            {
                vwprd_CantidadEnsamblada_x_OT_CusCider_Info CantEnsam = new vwprd_CantidadEnsamblada_x_OT_CusCider_Info();
                int Cant = 0;

                CantEnsam             = BusEnsamblado.TraerCantEnsamb(info, ref msg);
                txtCantAProducir.Text = Convert.ToString(CantEnsam.CantidadPieza - CantEnsam.CantEnsamblada);

                if (Convert.ToDecimal(txtCantAProducir.Text) <= 0)
                {
                    txtCantAProducir.ForeColor = Color.Red;
                }

                else
                {
                    txtCantAProducir.ForeColor = Color.Black;
                }

                if (Convert.ToDecimal(txtCantAProducir.Text) <= 0 && iAccion == Cl_Enumeradores.eTipo_action.grabar)
                {
                    lblNoEnsamblar.Visible = true;
                }


                else
                {
                    lblNoEnsamblar.Visible = false;
                }


                return(Cant);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Ha ocurrido un error:" + msg + ex.InnerException.ToString());
                return(0);
            }
        }
예제 #22
0
        public void setCab(com_ListadoMateriales_Info InfoLisMat)
        {
            prd_OrdenTaller_Info InfoOT = new prd_OrdenTaller_Info();

            try
            {
                // LLENAR LOS COMBOS DE LOS DATOS DE LA ORDEN

                InfoLMat = InfoLisMat;
                ucGe_Sucursal_combo1.set_SucursalInfo(InfoLisMat.IdSucursal);
                Obra.set_item(InfoLisMat.CodObra);
                dtpFechareg.Value = InfoLisMat.FechaReg;
                //UltraCmbOrdenTaller.EditValue = InfoLisMat.IdOrdenTaller;
                //InfoOT = BUSOT.ObtenerUnaOT(param.IdEmpresa, InfoLisMat.IdSucursal, InfoLisMat.IdOrdenTaller, InfoLisMat.CodObra);
                //txtCodOT.Text = InfoOT.Codigo;
                //txtProdTerm.Text = "[" + InfoOT.IdProducto + "][" + InfoOT.NomProducto + "]";
                //txtPesoUnit.Text = Convert.ToString(InfoOT.PesoUnitario);
                //txtUnit.Text = Convert.ToString(InfoOT.CantidadPieza);
                //txtTtPeso.Text = Convert.ToString(InfoOT.TotalPeso);
                txtIdLMat.Text = Convert.ToString(InfoLisMat.IdListadoMateriales);
                //dTPFecRegOT.Value = InfoOT.FechaReg;
                txtUsuario.Text     = InfoLisMat.Usuario;
                txtObservacion.Text = InfoLisMat.lm_Observacion;
                //txtIdOT.Text =Convert.ToString( InfoOT.IdOrdenTaller);
                if (InfoLisMat.Estado == "I")
                {
                    lblAnulado.Visible = true;
                    set_Accion(Cl_Enumeradores.eTipo_action.consultar);
                }
                cargagrid(InfoLisMat);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }