Beispiel #1
0
        public void FormatoCotizacionCliente(int idcotizacioncliente)
        {
            Cotizacioncliente cotizacioncliente = Service.GetCotizacioncliente(idcotizacioncliente);
            var          tipocp       = Service.GetTipocp(x => x.Idtipocp == cotizacioncliente.Idtipocp);
            const string nameRelation = "ventas.vwcotizacionclienteimpresion";
            string       whereList    = string.Format("idcotizacioncliente = {0}", cotizacioncliente.Idcotizacioncliente);
            const string ordersList   = "numeroitem";
            const string fieldsList   = "*";

            DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList);

            if (string.IsNullOrEmpty(tipocp.Nombrereporte))
            {
                XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                return;
            }

            var    report      = new Report();
            string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", tipocp.Nombrereporte.Trim()));

            report.Load(nameReporte);
            report.RegisterData(dt, "cot");
            report.RegisterData(VwSucursalList, "emp");
            ReportHelper1 reportHelper1 = new ReportHelper1(report);

            reportHelper1.ShowDialog();
        }
Beispiel #2
0
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            if (VwCotizacionclienteInicial == null)
            {
                XtraMessageBox.Show("No hay información de cotización", "Atención", MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                return;
            }

            //Obtener instancia de cotizacion cliente
            Cotizacioncliente cotizacionclienteDestino = Service.GetCotizacioncliente(x => x.Idcotizacioncliente == VwCotizacionclienteInicial.Idcotizacioncliente);

            if (cotizacionclienteDestino != null)
            {
                //Obtener el de detalle de cotizacion seleccionada
                List <VwCotizacionclientedet> cotizacionclientedetDestinoList =
                    Service.GetAllVwCotizacionclientedet(
                        x => x.Idcotizacioncliente == VwCotizacionclienteInicial.Idcotizacioncliente);

                cotizacionclienteDestino.Idcotizacioncliente = 0;
                cotizacionclienteDestino.Idtipocp            = (int)iIdtipocpDestino.EditValue;
                cotizacionclienteDestino.Idcptooperacion     = (int)iIdcptooperacionDestino.EditValue;
                cotizacionclienteDestino.Seriecotizacion     = (string)rSeriecotizacionDestino.EditValue;
                cotizacionclienteDestino.Numerocotizacion    = (string)rNumerocotizacionDestino.EditValue;
                cotizacionclienteDestino.Numeronegociacion   = (int)iNumeronegociacionDestino.EditValue;
                cotizacionclienteDestino.Aprobado            = false;


                foreach (var item in cotizacionclientedetDestinoList)
                {
                    item.Idcotizacionclientedet = 0;
                    item.Idcotizacioncliente    = 0;
                    item.DataEntityState        = DataEntityState.Added;
                }

                if (Service.GuardarCotizacionCliente(TipoMantenimiento.Nuevo, cotizacionclienteDestino,
                                                     cotizacionclientedetDestinoList))
                {
                    XtraMessageBox.Show("Se proceso correctamente", "Atención", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                    DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #3
0
 public bool GuardarCotizacionCliente(TipoMantenimiento tipoMantenimiento, Cotizacioncliente entidadCab, List <VwCotizacionclientedet> entidadDetList)
 {
     return(CotizacionclienteDao.GuardarCotizacionCliente(tipoMantenimiento, entidadCab, entidadDetList));
 }
Beispiel #4
0
 public void UpdateCotizacioncliente(Cotizacioncliente entity)
 {
     CotizacionclienteDao.Update(entity);
 }
Beispiel #5
0
 public int SaveCotizacioncliente(Cotizacioncliente entity)
 {
     return(CotizacionclienteDao.Save(entity));
 }