예제 #1
0
        private Boolean getCab()
        {
            try
            {
                InfoLMat.IdEmpresa = param.IdEmpresa;

                InfoLMat.IdListadoMateriales = (txtIdLMat.Text == "") ? 0 : Convert.ToInt32(txtIdLMat.Text);

                InfoLMat.IdSucursal = ucGe_Sucursal_combo1.get_SucursalInfo().IdSucursal;
                ////InfoLMat.IdOrdenTaller = (decimal)UltraCmbOrdenTaller.EditValue;
                InfoLMat.FechaReg       = dtpFechareg.Value;
                InfoLMat.Motivo         = "EST_APR_LIS_REQ";
                InfoLMat.CodObra        = Obra.get_item();
                InfoLMat.Estado         = "A";
                InfoLMat.Usuario        = param.IdUsuario;
                InfoLMat.lm_Observacion = txtObservacion.Text;

                if (getDet() == false)
                {
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                return(false);
            }
        }
예제 #2
0
        private Boolean getCab()
        {
            try
            {
                InfoLDiseno.IdEmpresa = param.IdEmpresa;

                InfoLDiseno.IdListadoDiseno = (txtIdLMat.Text == "") ? 0 : Convert.ToInt32(txtIdLMat.Text);

                InfoLDiseno.IdSucursal = ucGe_Sucursal_combo1.get_SucursalInfo().IdSucursal;

                InfoLDiseno.FechaReg       = dtpFechareg.Value;
                InfoLDiseno.Motivo         = "EST_APR_LIS_REQ";
                InfoLDiseno.CodObra        = Obra.get_item();
                InfoLDiseno.Estado         = "A";
                InfoLDiseno.Usuario        = param.IdUsuario;
                InfoLDiseno.lm_Observacion = txtObservacion.Text;
                InfoLDiseno.tipo_listado   = cmbListadoDisenoTipo.EditValue.ToString();

                if (getDet() == false)
                {
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                return(false);
            }
        }
예제 #3
0
        //private void cmbMotivo_Validating(object sender, CancelEventArgs e)
        //{
        //    try
        //    {
        //        if (cmbMotivo.SelectedItem == null)
        //        {
        //            cmbMotivo.Text = "";
        //        }

        //    }
        //    catch (Exception ex)
        //    {
        //        Log_Error_bus.Log_Error(ex.ToString());
        //        MessageBox.Show(ex.ToString());
        //    }


        //}

        private void gridvwDetListMateriales_KeyPress(object sender, KeyPressEventArgs e)
        {
            try
            {
                com_ListadoDiseno_Det_Info Temp = new com_ListadoDiseno_Det_Info();
                Temp = (com_ListadoDiseno_Det_Info)gridvwDetListMateriales.GetFocusedRow();
                if ((e.KeyChar == (char)8))
                {
                    if (MessageBox.Show("¿Desea eliminar el producto: " + Temp.pr_descripcion + " de la Lista ?", "Eliminar producto", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        List <com_ListadoDiseno_Det_Info> lsttemp = new List <com_ListadoDiseno_Det_Info>();


                        for (int i = 0; i < gridvwDetListMateriales.RowCount; i++)
                        {
                            if (i != gridvwDetListMateriales.FocusedRowHandle)
                            {
                                var ass = (com_ListadoDiseno_Det_Info)gridvwDetListMateriales.GetRow(i);
                                if (ass != null)
                                {
                                    com_ListadoDiseno_Det_Info row = new com_ListadoDiseno_Det_Info();

                                    row.IdEmpresa = param.IdEmpresa;

                                    row.CodObra = Obra.get_item();

                                    row.Det_Kg          = ass.Det_Kg;
                                    row.IdDetalle       = 0;
                                    row.IdListadoDiseno = 0;
                                    row.IdProducto      = ass.IdProducto;
                                    if (ass.IdProducto == 0)
                                    {
                                        MessageBox.Show("Debe corregir su seleccion de productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    }
                                    row.Unidades       = ass.Unidades;
                                    row.pr_codigo      = ass.pr_codigo;
                                    row.pr_descripcion = ass.pr_descripcion;
                                    if (row.Unidades != 0 && row.Det_Kg != 0)
                                    {
                                        lsttemp.Add(row);
                                    }
                                }
                            }
                        }


                        gridCtrlDetListMateriales.DataSource = lsttemp;

                        LstInfoLDiseno = (List <com_ListadoDiseno_Det_Info>)gridvwDetListMateriales.DataSource;
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
            }
        }
예제 #4
0
        private void gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra_KeyPress(object sender, KeyPressEventArgs e)
        {
            try
            {
                com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info Temp = new com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info();
                Temp = (com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info)gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.GetFocusedRow();
                if ((e.KeyChar == (char)8))
                {
                    if (MessageBox.Show("¿Desea eliminar el producto: " + Temp.pr_descripcion + " de la Lista ?", "Eliminar producto", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        List <com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info> lsttemp = new List <com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info>();


                        for (int i = 0; i < gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.RowCount; i++)
                        {
                            if (i != gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.FocusedRowHandle)
                            {
                                var ass = (com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info)gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.GetRow(i);
                                if (ass != null)
                                {
                                    com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info row = new com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info();

                                    row.IdEmpresa = param.IdEmpresa;

                                    row.CodObra_preasignada = Obra.get_item();
                                    //row.IdOrdenTaller = Convert.ToInt32(UltraCmbOrdenTaller.EditValue);
                                    row.Det_Kg = ass.Det_Kg;
                                    //row.IdDetalle = 0;
                                    row.IdNumMovi  = ass.IdNumMovi;
                                    row.IdProducto = ass.IdProducto;
                                    if (ass.IdProducto == 0)
                                    {
                                        MessageBox.Show("Debe corregir su seleccion de productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    }
                                    row.dm_cantidad    = ass.dm_cantidad;
                                    row.pr_codigo      = ass.pr_codigo;
                                    row.pr_descripcion = ass.pr_descripcion;
                                    if (row.dm_cantidad != 0 && row.Det_Kg != 0)
                                    {
                                        lsttemp.Add(row);
                                    }
                                }
                            }
                        }


                        gridCtrlDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource = lsttemp;

                        LstInfoLMat = (List <com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info>)gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource;
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
            }
        }
예제 #5
0
        public Boolean getDet()
        {
            try
            {
                List <com_ListadoDiseno_Det_Info> lsttemp = new List <com_ListadoDiseno_Det_Info>();


                for (int i = 0; i < gridvwDetListMateriales.RowCount; i++)
                {
                    var ass = (com_ListadoDiseno_Det_Info)gridvwDetListMateriales.GetRow(i);
                    if (ass != null)
                    {
                        com_ListadoDiseno_Det_Info row = new com_ListadoDiseno_Det_Info();

                        row.IdEmpresa = param.IdEmpresa;

                        row.CodObra = Obra.get_item();

                        row.Det_Kg              = ass.Det_Kg;
                        row.IdDetalle           = 0;
                        row.IdListadoDiseno     = 0;
                        row.IdProducto          = ass.IdProducto;
                        row.lm_IdEstadoAprobado = "PEN";
                        if (ass.IdProducto == 0)
                        {
                            MessageBox.Show("Debe corregir su seleccion de productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return(false);
                        }
                        row.Unidades       = ass.Unidades;
                        row.pr_codigo      = ass.pr_codigo;
                        row.pr_descripcion = ass.pr_descripcion;
                        if (row.Unidades > 0)
                        {
                            lsttemp.Add(row);
                        }
                        else
                        {
                            MessageBox.Show("Debe corregir la cantidad de los productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return(false);
                        }
                    }
                }


                //gridCtrlDetListMateriales.DataSource  = lsttemp;
                LstInfoLDiseno = lsttemp;
                //LstInfoLDiseno  = (List<com_ListadoMateriales_Det_Info>)gridvwDetListMateriales.DataSource;
                if (LstInfoLDiseno.Count < 1)
                {
                    MessageBox.Show("Debe ingresar los Materiales para la Orden de Taller", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
                return(false);
            }
        }
예제 #6
0
        public Boolean getDet()
        {
            try
            {
                List <com_ListadoMateriales_Det_Info> lsttemp = new List <com_ListadoMateriales_Det_Info>();


                for (int i = 0; i < gridvwDetListMateriales.RowCount; i++)
                {
                    var ass = (com_ListadoMateriales_Det_Info)gridvwDetListMateriales.GetRow(i);
                    if (ass != null)
                    {
                        com_ListadoMateriales_Det_Info row = new com_ListadoMateriales_Det_Info();

                        row.IdEmpresa = param.IdEmpresa;

                        row.CodObra = Obra.get_item();
                        //row.IdOrdenTaller = Convert.ToInt32(UltraCmbOrdenTaller.EditValue);
                        row.Det_Kg              = ass.Det_Kg;
                        row.IdDetalle           = 0;
                        row.IdListadoMateriales = 0;
                        row.IdProducto          = ass.IdProducto;
                        row.lm_IdEstadoAprobado = "PEN";

                        row.pr_largo       = ass.pr_largo;
                        row.largo_total    = ass.largo_total;
                        row.largo_restante = ass.largo_restante;

                        row.largo_pieza_entera                  = ass.largo_pieza_entera;
                        row.cantidad_pieza_entera               = ass.cantidad_pieza_entera;
                        row.largo_pieza_complementaria          = ass.largo_pieza_complementaria;
                        row.cantidad_pieza_complementaria       = ass.cantidad_pieza_complementaria;
                        row.cantidad_total_pieza_complementaria = ass.cantidad_total_pieza_complementaria;
                        row.largo_despunte1     = ass.largo_despunte1;
                        row.cantidad_despunte1  = ass.cantidad_despunte1;
                        row.es_despunte_usable1 = ass.es_despunte_usable1;
                        row.largo_despunte2     = ass.largo_despunte2;
                        row.cantidad_despunte2  = ass.cantidad_despunte2;
                        row.es_despunte_usable2 = ass.es_despunte_usable2;

                        if (ass.IdProducto == 0)
                        {
                            MessageBox.Show("Debe corregir su seleccion de productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return(false);
                        }
                        row.Unidades       = ass.Unidades;
                        row.pr_codigo      = ass.pr_codigo;
                        row.pr_descripcion = ass.pr_descripcion;
                        if (row.Unidades > 0)
                        {
                            lsttemp.Add(row);
                        }
                        else
                        {
                            MessageBox.Show("Debe corregir la cantidad de los productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return(false);
                        }
                    }
                }


                //gridCtrlDetListMateriales.DataSource  = lsttemp;
                LstInfoLMat = lsttemp;
                //LstInfoLMat  = (List<com_ListadoMateriales_Det_Info>)gridvwDetListMateriales.DataSource;
                if (LstInfoLMat.Count < 1)
                {
                    MessageBox.Show("Debe ingresar los Materiales para la Orden de Taller", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
                return(false);
            }
        }
예제 #7
0
        void carga_MPPreasignado_x_Obra()
        {
            try
            {
                LstMPPreasignado = BusMPPreasignado.Get_List_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det(param.IdEmpresa, Obra.get_item());
                //gridCtrlDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource = LstInfoLMat;

                LstBindMPPreasignado = new BindingList <com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info>(LstMPPreasignado);
                gridCtrlDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource = LstBindMPPreasignado;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
예제 #8
0
 void cargar_grids()
 {
     try
     {
         if (ucGe_Sucursal_combo1.get_SucursalInfo().IdSucursal != null)
         {
             if (Obra.get_item_info() != null)
             {
                 ListInfoListadoElementosDet_x_Obra        = BusListadoElementosDet.Get_List_ListadoElementos_x_OT_Det(param.IdEmpresa, Obra.get_item());
                 gridCtrlDetListMaterialesxObra.DataSource = ListInfoListadoElementosDet_x_Obra;
                 gridvwDetListMaterialesxObra.ExpandAllGroups();
                 //cargagrid_InventarioFisico();
                 carga_MPPreasignado_x_Obra();
             }
             else
             {
                 setearcampos();
             }
         }
         else
         {
             setearcampos();
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
예제 #9
0
        void grabar()
        {
            try
            {
                decimal id  = 0;
                string  msg = "";



                switch (Accion)
                {
                case Cl_Enumeradores.eTipo_action.grabar:

                    if (BusDetLstMPDisponible.GuardarDB(LstInfoLMat, cmbEstadoApro.EditValue.ToString()))
                    {
                        MessageBox.Show("Se ha procedido a grabar Los Materiales Disponibles a la Obra #: " + Obra.get_item().ToString() + " exitosamente.", "Operación Exitosa");

                        ActulizarInMoviInveDet_Producto_CusCider(InfoLMat, ref msg);

                        InfoLMat.IdNumMovi = id;
                        txtIdLMat.Text     = Convert.ToString(id);
                        txtUsuario.Text    = param.IdUsuario;
                        //setCab(InfoLMat);



                        set_Accion(Cl_Enumeradores.eTipo_action.consultar);
                        gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.SelectAll();
                        gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.DeleteSelectedRows();
                        gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.ViewCaption  = Obra.get_item();
                        gridCtrlDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource = LstInfoLMat;

                        gridCtrlDetListMaterialesDisponibles_PreAsignado_a_Obra.RefreshDataSource();

                        //cargagrid(InfoLMat);
                    }

                    break;

                case Cl_Enumeradores.eTipo_action.actualizar:

                //if (BUsLMat.ModificarDB(InfoLMat, ref  msg))
                //{
                //    List<com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info> templst = new List<com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info>();
                //    templst = BusDetLMat.Get_List_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det(param.IdEmpresa, InfoLMat.IdNumMovi);

                //    if (templst.Count != 0)
                //    {
                //        if (BusDetLMat.EliminarDB(templst, ref msg))
                //        {
                //            LstInfoLMat.ForEach(var => var.IdNumMovi = InfoLMat.IdNumMovi);
                //            int iddetail = 0;
                //            LstInfoLMat.ForEach(var => var.IdDetalle = iddetail++);
                //            LstInfoLMat.ForEach(var => var.lm_IdEstadoAprobado = "X APRO");
                //            if (BusDetLMat.GuardarDB(LstInfoLMat, ""))
                //            {
                //                MessageBox.Show("Se ha procedido a grabar el Listado de MaterialesDisponibles_PreAsignado_a_Obra #: " + InfoLMat.IdNumMovi.ToString() + " exitosamente.", "Operación Exitosa");
                //            }
                //        }
                //        //MessageBox.Show(msg+"No se Actualizo el registro de la Orden/Compra #: " + InfoLMat.IdListadoMaterialesDisponibles_PreAsignado_a_Obra.ToString(), "Operación Fallida");

                //    }
                //}
                //else
                //{
                //    MessageBox.Show(msg+ "No se ha grabado el registro de la Orden/Compra #: " + InfoLMat.IdNumMovi.ToString(), "Operación Fallida");
                //}
                //break;


                default: break;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
예제 #10
0
        public Boolean getDet()
        {
            try
            {
                List <com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info> lsttemp = new List <com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info>();


                for (int i = 0; i < gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.RowCount; i++)
                {
                    var ass = (com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info)gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.GetRow(i);
                    if (ass != null && ass.pre_asignar == true)
                    {
                        com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info row = new com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info();

                        row.IdEmpresa         = param.IdEmpresa;
                        row.IdSucursal        = param.IdSucursal;
                        row.IdBodega          = ass.IdBodega;
                        row.IdMovi_inven_tipo = ass.IdMovi_inven_tipo;
                        row.IdNumMovi         = ass.IdNumMovi;
                        row.mv_Secuencia      = ass.mv_Secuencia;
                        row.Secuencia         = ass.Secuencia;

                        row.CodObra_preasignada = Obra.get_item();
                        row.IdProducto          = ass.IdProducto;
                        row.CodigoBarra         = ass.CodigoBarra;

                        row.longitud = ass.longitud;
                        row.alto     = ass.alto;
                        row.espesor  = ass.espesor;


                        row.Det_Kg = ass.Det_Kg;

                        //row.IdNumMovi = 0;

                        row.IdEstadoAprob = "PEN";

                        row.pr_largo       = ass.pr_largo;
                        row.largo_total    = ass.largo_total;
                        row.largo_restante = ass.largo_restante;

                        row.largo_pieza_entera                  = ass.largo_pieza_entera;
                        row.cantidad_pieza_entera               = ass.cantidad_pieza_entera;
                        row.largo_pieza_complementaria          = ass.largo_pieza_complementaria;
                        row.cantidad_pieza_complementaria       = ass.cantidad_pieza_complementaria;
                        row.cantidad_total_pieza_complementaria = ass.cantidad_total_pieza_complementaria;
                        row.largo_despunte1     = ass.largo_despunte1;
                        row.cantidad_despunte1  = ass.cantidad_despunte1;
                        row.es_despunte_usable1 = ass.es_despunte_usable1;
                        row.largo_despunte2     = ass.largo_despunte2;
                        row.cantidad_despunte2  = ass.cantidad_despunte2;
                        row.es_despunte_usable2 = ass.es_despunte_usable2;

                        if (ass.IdProducto == 0)
                        {
                            MessageBox.Show("Debe corregir su seleccion de productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return(false);
                        }
                        row.dm_cantidad    = ass.dm_cantidad;
                        row.pr_codigo      = ass.pr_codigo;
                        row.pr_descripcion = ass.pr_descripcion;
                        if (row.dm_cantidad > 0)
                        {
                            lsttemp.Add(row);
                        }
                        else
                        {
                            MessageBox.Show("Debe corregir la cantidad de los productos", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            return(false);
                        }
                    }
                }


                //gridCtrlDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource  = lsttemp;
                LstInfoLMat = lsttemp;
                //LstInfoLMat  = (List<com_ListadoMaterialesDisponibles_PreAsignado_a_Obra_Det_Info>)gridvwDetListMaterialesDisponibles_PreAsignado_a_Obra.DataSource;
                if (LstInfoLMat.Count < 1)
                {
                    MessageBox.Show("Debe ingresar los MaterialesDisponibles_PreAsignado_a_Obra para la Orden de Taller", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
                return(false);
            }
        }
        void Obra_Event_UCObra_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                Limpiar();
                if (ucGe_Sucursal_combo1.get_SucursalInfo().IdSucursal != null)
                {
                    if (Obra.get_item_info() != null)
                    {
                        ListInfoListadoElementosDet_x_Obra = BusListadoElementosDet.Get_List_ListadoElementos_x_OT_Det(param.IdEmpresa, Obra.get_item());
                        gridCtrlDetListMaterialesDisponiblesxObra.DataSource = ListInfoListadoElementosDet_x_Obra;

                        //cargagrid_InventarioFisico();
                    }
                    else
                    {
                        setearcampos();
                    }
                }
                else
                {
                    setearcampos();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }