Exemplo n.º 1
0
        public void UpdateRow(cp_conciliacion_Caja_det_x_ValeCaja_Info info_det, decimal IdTransaccionSession)
        {
            cp_conciliacion_Caja_det_x_ValeCaja_Info edited_info = get_list(IdTransaccionSession).Where(m => m.Secuencia == info_det.Secuencia).First();

            edited_info.valor     = info_det.valor;
            edited_info.IdPersona = info_det.IdPersona;
            if (edited_info.IdPersona != info_det.IdPersona)
            {
                var per = bus_persona.get_info(info_det.IdPersona);
                if (per != null)
                {
                    edited_info.pe_nombreCompleto = per.pe_nombreCompleto;
                }
            }
            if (edited_info.idTipoMovi != info_det.idTipoMovi)
            {
                var tipo = bus_tipo_movi.get_info(Convert.ToInt32(SessionFixed.IdEmpresa), Convert.ToInt32(info_det.idTipoMovi));
                if (tipo != null)
                {
                    info_det.IdCtaCble = tipo.IdCtaCble;
                }
            }
            edited_info.Observacion = info_det.Observacion;
            edited_info.idTipoMovi  = info_det.idTipoMovi;
            edited_info.fecha       = info_det.fecha;
            edited_info.se_modifico = true;
        }
 public Boolean ModificarDB(cp_conciliacion_Caja_det_x_ValeCaja_Info info)
 {
     try
     {
         using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
         {
             cp_conciliacion_Caja_det_x_ValeCaja Entity = Context.cp_conciliacion_Caja_det_x_ValeCaja.FirstOrDefault(q => q.IdEmpresa_movcaja == info.IdEmpresa && q.IdCbteCble_movcaja == info.IdCbteCble_movcaja && q.IdTipocbte_movcaja == info.IdTipocbte_movcaja);
             if (Entity != null)
             {
                 Entity.IdPunto_cargo                  = info.IdPunto_cargo == 0 ? null : info.IdPunto_cargo;
                 Entity.IdPunto_cargo_grupo            = info.IdPunto_cargo_grupo == 0 ? null : info.IdPunto_cargo_grupo;
                 Entity.IdCentroCosto                  = info.IdCentroCosto == "" ? null : info.IdCentroCosto;
                 Entity.IdCentroCosto_sub_centro_costo = info.IdCentroCosto_sub_centro_costo == "" ? null : info.IdCentroCosto_sub_centro_costo;
                 Context.SaveChanges();
             }
         }
         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.InnerException.ToString());
     }
 }
 public Boolean GrabarDB(cp_conciliacion_Caja_det_x_ValeCaja_Info info, ref string mensaje)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar();
             cp_conciliacion_Caja_det_x_ValeCaja address = new cp_conciliacion_Caja_det_x_ValeCaja();
             address.IdEmpresa                      = info.IdEmpresa;
             address.IdConciliacion_Caja            = info.IdConciliacion_Caja;
             address.Secuencia                      = info.Secuencia;
             address.IdEmpresa_movcaja              = info.IdEmpresa_movcaja;
             address.IdCbteCble_movcaja             = info.IdCbteCble_movcaja;
             address.IdTipocbte_movcaja             = info.IdTipocbte_movcaja;
             address.IdCtaCble                      = info.IdCtaCble;
             address.IdPunto_cargo                  = info.IdPunto_cargo;
             address.IdPunto_cargo_grupo            = info.IdPunto_cargo_grupo;
             address.IdCentroCosto                  = info.IdCentroCosto;
             address.IdCentroCosto_sub_centro_costo = info.IdCentroCosto_sub_centro_costo;
             context.cp_conciliacion_Caja_det_x_ValeCaja.Add(address);
             context.SaveChanges();
         }
         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());
     }
 }
Exemplo n.º 4
0
        public void UpdateRow(cp_conciliacion_Caja_det_x_ValeCaja_Info info_det, decimal IdTransaccionSession)
        {
            cp_conciliacion_Caja_det_x_ValeCaja_Info edited_info = get_list(IdTransaccionSession).Where(m => m.Secuencia == info_det.Secuencia).First();

            edited_info.valor     = info_det.valor;
            edited_info.IdPersona = info_det.IdPersona;
            if (edited_info.IdPersona != info_det.IdPersona)
            {
                var per = bus_persona.get_info(info_det.IdPersona);
                if (per != null)
                {
                    edited_info.pe_nombreCompleto = per.pe_nombreCompleto;
                }
            }
            if (edited_info.idTipoMovi != info_det.idTipoMovi)
            {
                var tipo = bus_tipo_movi.get_info(Convert.ToInt32(SessionFixed.IdEmpresa), Convert.ToInt32(info_det.idTipoMovi));
                if (tipo != null)
                {
                    info_det.IdCtaCble = tipo.IdCtaCble;
                }
            }
            edited_info.Observacion = info_det.Observacion;
            edited_info.idTipoMovi  = info_det.idTipoMovi;
            edited_info.fecha       = info_det.fecha;
            edited_info.se_modifico = true;

            #region Centro de costo
            edited_info.IdCentroCosto_vales = info_det.IdCentroCosto_vales;
            if (string.IsNullOrEmpty(info_det.IdCentroCosto_vales))
            {
                edited_info.cc_Descripcion = string.Empty;
            }
            else
            {
                var cc = bus_cc.get_info(Convert.ToInt32(SessionFixed.IdEmpresa), info_det.IdCentroCosto_vales);
                if (cc != null)
                {
                    edited_info.cc_Descripcion = cc.cc_Descripcion;
                }
            }
            #endregion

            #region Punto Cargo
            edited_info.IdPunto_cargo_vales       = info_det.IdPunto_cargo_vales;
            edited_info.IdPunto_cargo_grupo_vales = info_det.IdPunto_cargo_grupo_vales;
            if (info_det.IdPunto_cargo_vales == null || info_det.IdPunto_cargo_vales == 0)
            {
                edited_info.nom_punto_cargo = string.Empty;
            }
            else
            {
                var pc = bus_pc.GetInfo(Convert.ToInt32(SessionFixed.IdEmpresa), Convert.ToInt32(info_det.IdPunto_cargo_vales));
                if (pc != null)
                {
                    edited_info.nom_punto_cargo = pc.nom_punto_cargo;
                }
            }
            #endregion
        }
Exemplo n.º 5
0
        public ActionResult EditingUpdateVale([ModelBinder(typeof(DevExpressEditorsBinder))] cp_conciliacion_Caja_det_x_ValeCaja_Info info_det)
        {
            if (ModelState.IsValid)
            {
                list_vale.UpdateRow(info_det, Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
            }
            cp_conciliacion_Caja_Info model = new cp_conciliacion_Caja_Info();

            model.lst_det_vale = list_vale.get_list(Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
            return(PartialView("_GridViewPartial_conciliacion_vales", model));
        }
Exemplo n.º 6
0
        public void AddRow(cp_conciliacion_Caja_det_x_ValeCaja_Info info_det, decimal IdTransaccionSession)
        {
            List <cp_conciliacion_Caja_det_x_ValeCaja_Info> list = get_list(IdTransaccionSession);

            info_det.Secuencia = list.Count == 0 ? 1 : list.Max(q => q.Secuencia) + 1;
            var per = bus_persona.get_info(info_det.IdPersona);

            if (per != null)
            {
                info_det.pe_nombreCompleto = per.pe_nombreCompleto;
            }

            var tipo = bus_tipo_movi.get_info(Convert.ToInt32(SessionFixed.IdEmpresa), Convert.ToInt32(info_det.idTipoMovi));

            if (tipo != null)
            {
                info_det.IdCtaCble = tipo.IdCtaCble;
            }

            if (info_det.IdPunto_cargo_vales == null || info_det.IdPunto_cargo_vales == 0)
            {
                info_det.nom_punto_cargo = string.Empty;
            }
            else
            {
                var pc = bus_pc.GetInfo(Convert.ToInt32(SessionFixed.IdEmpresa), Convert.ToInt32(info_det.IdPunto_cargo_vales));
                if (pc != null)
                {
                    info_det.nom_punto_cargo = pc.nom_punto_cargo;
                }
            }

            #region Centro de costo
            info_det.IdCentroCosto_vales = info_det.IdCentroCosto_vales;
            if (string.IsNullOrEmpty(info_det.IdCentroCosto_vales))
            {
                info_det.cc_Descripcion = string.Empty;
            }
            else
            {
                var cc = bus_cc.get_info(Convert.ToInt32(SessionFixed.IdEmpresa), info_det.IdCentroCosto_vales);
                if (cc != null)
                {
                    info_det.cc_Descripcion = cc.cc_Descripcion;
                }
            }
            #endregion

            list.Add(info_det);
        }
Exemplo n.º 7
0
 public Boolean ModificarDB(cp_conciliacion_Caja_det_x_ValeCaja_Info info)
 {
     try
     {
         return(odata.ModificarDB(info));
     }
     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("", "ModificarDB", ex.Message), ex)
               {
                   EntityType = typeof(cp_conciliacion_Caja_det_x_ValeCaja_Bus)
               };
     }
 }
Exemplo n.º 8
0
        public void AddRow(cp_conciliacion_Caja_det_x_ValeCaja_Info info_det, decimal IdTransaccionSession)
        {
            List <cp_conciliacion_Caja_det_x_ValeCaja_Info> list = get_list(IdTransaccionSession);

            info_det.Secuencia = list.Count == 0 ? 1 : list.Max(q => q.Secuencia) + 1;
            var per = bus_persona.get_info(info_det.IdPersona);

            if (per != null)
            {
                info_det.pe_nombreCompleto = per.pe_nombreCompleto;
            }

            var tipo = bus_tipo_movi.get_info(Convert.ToInt32(SessionFixed.IdEmpresa), Convert.ToInt32(info_det.idTipoMovi));

            if (tipo != null)
            {
                info_det.IdCtaCble = tipo.IdCtaCble;
            }

            list.Add(info_det);
        }