public void AddRow(in_devolucion_inven_det_Info info_det)
        {
            List <in_devolucion_inven_det_Info> list = get_list();

            info_det.secuencia     = list.Count == 0 ? 1 : list.Max(q => q.secuencia) + 1;
            info_det.cant_devuelta = info_det.cant_devuelta;
            list.Add(info_det);
        }
Beispiel #2
0
        private void Cargar_Movi_Inven(in_Ing_Egr_Inven_Info info_ing_egr)
        {
            try
            {
                if (info_ing_egr != null)
                {
                    txtObservacion.Text = "";
                    txtObservacion.Text = "Dev/Inventario x Trans#" + info_ing_egr.IdNumMovi + " " + info_ing_egr.cm_observacion;
                    ucIn_Sucursal_Bodega.set_Idsucursal(info_ing_egr.IdSucursal);
                    ucIn_Sucursal_Bodega.set_Idbodega(info_ing_egr.IdSucursal, Convert.ToInt32(info_ing_egr.IdBodega));
                    dtpFecha.Value     = DateTime.Now;
                    txtIdMovi_Inv.Text = infoDetDev.IdNumMovi.ToString();
                    Lista_dev_detalle  = new BindingList <in_devolucion_inven_det_Info>();
                    txtIdMovi_Inv.Text = info_ing_egr.IdNumMovi.ToString();
                    ucIn_TipoMoviInv_Cmb.set_TipoMoviInvInfo(info_ing_egr.IdMovi_inven_tipo);

                    int c = 1;

                    foreach (var item in info_ing_egr.listMovi_inven_det)
                    {
                        in_devolucion_inven_det_Info ItemDv = new in_devolucion_inven_det_Info();

                        ItemDv.IdBodega_movi_inv          = item.IdBodega;
                        ItemDv.IdDev_Inven                = 0;
                        ItemDv.IdEmpresa                  = item.IdEmpresa;
                        ItemDv.IdEmpresa_movi_inv         = item.IdEmpresa;
                        ItemDv.IdMovi_inven_tipo_movi_inv = item.IdMovi_inven_tipo;
                        ItemDv.IdNumMovi_movi_inv         = item.IdNumMovi;
                        ItemDv.IdSucursal_movi_inv        = item.IdSucursal;
                        ItemDv.Secuencia_movi_inv         = item.Secuencia;
                        ItemDv.nom_punto_cargo            = item.nom_punto_cargo;
                        c++;
                        ItemDv.secuencia = c;

                        ItemDv.cantidad_egresada   = item.dm_cantidad * -1;
                        ItemDv.cantidad_devuelta   = BusDevolucion_det.Get_cantidad_devuelta(item.IdEmpresa, item.IdBodega, item.IdSucursal, item.IdMovi_inven_tipo, item.IdNumMovi, item.Secuencia);
                        ItemDv.cantidad_a_devolver = 0;

                        ItemDv.nom_producto        = item.nom_producto;
                        ItemDv.cod_producto        = item.cod_producto;
                        ItemDv.Info_movi_inven_det = item;
                        ItemDv.Checked             = false;
                        if (ItemDv.cantidad_devuelta < Math.Abs(ItemDv.cantidad_egresada))
                        {
                            Lista_dev_detalle.Add(ItemDv);
                        }
                    }

                    gridDevolucion_det.DataSource = Lista_dev_detalle;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public ActionResult EditingUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] in_devolucion_inven_det_Info info_det)
        {
            int IdEmpresa = Convert.ToInt32(Session["IdEmpresa"]);

            if (info_det != null)
            {
                List_det.UpdateRow(info_det);
            }
            var model = List_det.get_list();

            return(PartialView("_GridViewPartial_devolucion_det", model));
        }
Beispiel #4
0
        public List <in_devolucion_inven_det_Info> Get_List_in_devolucion_inven_det(int IdEmpresa, decimal IdDev_Inven)
        {
            List <in_devolucion_inven_det_Info> Lst = new List <in_devolucion_inven_det_Info>();

            try
            {
                EntitiesInventario oEnti = new EntitiesInventario();



                var Query = from q in oEnti.vwin_devolucion_inven_det
                            where q.IdEmpresa == IdEmpresa &&
                            q.IdDev_Inven == IdDev_Inven
                            select q;

                foreach (var item in Query)
                {
                    in_devolucion_inven_det_Info Obj = new in_devolucion_inven_det_Info();

                    Obj.IdEmpresa                  = item.IdEmpresa;
                    Obj.cantidad_a_devolver        = item.cantidad_a_devolver;
                    Obj.cantidad_devuelta          = item.cantidad_devuelta;
                    Obj.cantidad_egresada          = item.cantidad_egresada;
                    Obj.IdBodega_movi_inv          = item.IdBodega_movi_inv;
                    Obj.IdDev_Inven                = item.IdDev_Inven;
                    Obj.IdEmpresa_movi_inv         = item.IdEmpresa_movi_inv;
                    Obj.IdMovi_inven_tipo_movi_inv = item.IdMovi_inven_tipo_movi_inv;
                    Obj.IdNumMovi_movi_inv         = item.IdNumMovi_movi_inv;
                    Obj.IdSucursal_movi_inv        = item.IdSucursal_movi_inv;
                    Obj.secuencia                  = item.secuencia;
                    Obj.Secuencia_movi_inv         = item.Secuencia_movi_inv;
                    Obj.nom_punto_cargo            = item.nom_punto_cargo;
                    Obj.Checked           = true;
                    Obj.nom_producto      = item.nom_producto;
                    Obj.cod_producto      = item.cod_producto;
                    Obj.cantidad_egresada = item.cantidad_inven;
                    Lst.Add(Obj);
                }

                return(Lst);
            }
            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());
            }
        }
Beispiel #5
0
 public Boolean GuardarDB(in_devolucion_inven_det_Info info, ref string mensaje)
 {
     try
     {
         return(oDat.GuardarDB(info, ref mensaje));
     }
     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("", "GuardarDB", ex.Message), ex)
               {
                   EntityType = typeof(in_devolucion_inven_det_Bus)
               };
     }
 }
Beispiel #6
0
        public Boolean GuardarDB(in_devolucion_inven_det_Info info, ref string mensaje)
        {
            try
            {
                using (EntitiesInventario Context = new EntitiesInventario())
                {
                    var Address = new in_devolucion_inven_det();

                    Address.IdEmpresa                  = info.IdEmpresa;
                    Address.IdDev_Inven                = info.IdDev_Inven;
                    Address.cantidad_a_devolver        = info.cantidad_a_devolver;
                    Address.cantidad_devuelta          = info.cantidad_devuelta;
                    Address.cantidad_egresada          = info.cantidad_egresada;
                    Address.IdBodega_movi_inv          = info.IdBodega_movi_inv;
                    Address.IdDev_Inven                = info.IdDev_Inven;
                    Address.IdEmpresa_movi_inv         = info.IdEmpresa_movi_inv;
                    Address.IdMovi_inven_tipo_movi_inv = info.IdMovi_inven_tipo_movi_inv;
                    Address.IdNumMovi_movi_inv         = info.IdNumMovi_movi_inv;
                    Address.IdSucursal_movi_inv        = info.IdSucursal_movi_inv;
                    Address.secuencia                  = info.secuencia;
                    Address.Secuencia_movi_inv         = info.Secuencia_movi_inv;


                    Context.in_devolucion_inven_det.Add(Address);
                    Context.SaveChanges();

                    mensaje = "Grabación ok..";
                }
                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;
                throw new Exception(ex.ToString());
            }
        }
Beispiel #7
0
 private void gridView_devol_inven_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     try
     {
         in_devolucion_inven_det_Info row = new in_devolucion_inven_det_Info();
         row = (in_devolucion_inven_det_Info)gridView_devol_inven.GetRow(e.RowHandle);
         if (row != null)
         {
             if (e.Column == ColCant_a_devol)
             {
                 if (row.cantidad_a_devolver > 0)
                 {
                     row.Checked = true;
                 }
                 else
                 {
                     row.Checked = false;
                 }
             }
             if (e.Column == ColCheck)
             {
                 if (row.Checked)
                 {
                     row.cantidad_a_devolver = Math.Abs(row.cantidad_egresada) - row.cantidad_devuelta;
                 }
                 else
                 {
                     row.cantidad_a_devolver = 0;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public void UpdateRow(in_devolucion_inven_det_Info info_det)
        {
            in_devolucion_inven_det_Info edited_info = get_list().Where(m => m.secuencia == info_det.secuencia).First();

            edited_info.cant_devuelta = info_det.cant_devuelta;
        }
Beispiel #9
0
        public void UpdateRow(in_devolucion_inven_det_Info info_det, decimal IdTransaccionSession)
        {
            in_devolucion_inven_det_Info edited_info = get_list(IdTransaccionSession).Where(m => m.secuencia == info_det.secuencia).First();

            edited_info.cant_devuelta = info_det.cant_devuelta;
        }