Ejemplo n.º 1
0
        public List <TagRegistrationDto> GetAll()
        {
            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            DbTools.SelectQuery(
                FireBirdConnection.Connection,
                ds.TagRegistration, UrgentAppQueries.TAGREGISTRATION_SELECT);

            List <TagRegistrationDto> lst = baseMapper.BindDataList <TagRegistrationDto>(ds.TagRegistration);

            return(lst);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 判断是否有数据可打印
 /// </summary>
 private bool HaveData()
 {
     if (this.book.Checked)
     {
         SqlConnection  connect = InitConnect.GetConnection();
         MyDataSet      data    = new MyDataSet();
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     select  = new SqlCommand();
         adapter.SelectCommand             = select;
         adapter.SelectCommand.Connection  = connect;
         adapter.SelectCommand.CommandText = "PrintBookSale";
         adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         adapter.SelectCommand.Parameters.AddWithValue("@date1", DateTime.Parse(this.date1.Value.ToShortDateString()) > DateTime.Parse(this.date2.Value.ToShortDateString()) ? DateTime.Parse(this.date2.Value.ToShortDateString()) : DateTime.Parse(this.date1.Value.ToShortDateString()));
         adapter.SelectCommand.Parameters.AddWithValue("@date2", DateTime.Parse(this.date1.Value.ToShortDateString()) < DateTime.Parse(this.date2.Value.ToShortDateString()) ? DateTime.Parse(this.date2.Value.ToShortDateString()) : DateTime.Parse(this.date1.Value.ToShortDateString()));
         data.Clear();
         adapter.Fill(data.book_sale);
         if (data.book_sale.DefaultView.Count != 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         SqlConnection  connect = InitConnect.GetConnection();
         MyDataSet      data    = new MyDataSet();
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     select  = new SqlCommand();
         adapter.SelectCommand             = select;
         adapter.SelectCommand.Connection  = connect;
         adapter.SelectCommand.CommandText = "PrintCdSale";
         adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         adapter.SelectCommand.Parameters.AddWithValue("@date1", DateTime.Parse(this.date1.Value.ToShortDateString()) > DateTime.Parse(this.date2.Value.ToShortDateString()) ? DateTime.Parse(this.date2.Value.ToShortDateString()) : DateTime.Parse(this.date1.Value.ToShortDateString()));
         adapter.SelectCommand.Parameters.AddWithValue("@date2", DateTime.Parse(this.date1.Value.ToShortDateString()) < DateTime.Parse(this.date2.Value.ToShortDateString()) ? DateTime.Parse(this.date2.Value.ToShortDateString()) : DateTime.Parse(this.date1.Value.ToShortDateString()));
         data.Clear();
         adapter.Fill(data.cd_sale);
         if (data.cd_sale.DefaultView.Count != 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Ejemplo n.º 3
0
        public List <TagDto> GetAll()
        {
            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;


            DbTools.SelectQuery(
                FireBirdConnection.Connection,
                ds.Tag, Queries.TAG_SELECT);

            List <TagDto> lst = baseMapper.BindDataList <TagDto>(ds.Tag);

            return(lst);
        }
Ejemplo n.º 4
0
        private void btnFill_Click(object sender, RoutedEventArgs e)
        {
            ds = new MyDataSet();// creating object of our  own already created data set

            DepartmentsTableAdapter daDepts = new DepartmentsTableAdapter();

            daDepts.Fill(ds.Departments);

            EmployeesTableAdapter daEmps = new EmployeesTableAdapter();

            daEmps.Fill(ds.Employees);


            dgEmps.ItemsSource = ds.Employees.DefaultView;
        }
Ejemplo n.º 5
0
        public List <PatientDto> GetAll()
        {
            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;


            DbTools.SelectQuery(
                FireBirdConnection.Connection,
                ds.Patient, UrgentAppQueries.PATIENT_SELECT);

            List <PatientDto> lst = baseMapper.BindDataList <PatientDto>(ds.Patient);

            return(lst);
        }
Ejemplo n.º 6
0
        public TagDto GetById(int Id)
        {
            TagDto result = new TagDto();

            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            DbTools.SelectQuery(
                FireBirdConnection.Connection,
                ds.Tag, string.Format(UrgentAppQueries.TAG_SELECT_BYID, Id));

            result = baseMapper.BindData <TagDto>(ds.Tag);

            return(result);
        }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //DateTime Desde = Convert.ToDateTime(Request.QueryString["Desde"]);
        //DateTime Hasta = Convert.ToDateTime(Request.QueryString["Hasta"]);
        //string operador = Request.QueryString["operador"];
        //string descripcion = Request.QueryString["descripcion"];
        string    tarjeta    = Request.QueryString["tarjeta"];
        Class1    MyClass    = new Class1();
        MyDataSet DTS        = MyClass.DatosTarjeta(tarjeta);
        string    ReportPath = Server.MapPath("../Reports/DatosTarjeta.rpt");

        CrystalReportSource1.ReportDocument.Load(ReportPath);
        CrystalReportSource1.ReportDocument.SetDataSource(DTS);
        Reporte_Datos_Tarjeta.ReportSource = CrystalReportSource1;
        Reporte_Datos_Tarjeta.RefreshReport();
    }
Ejemplo n.º 8
0
        private TagRegistrationDto GetByPatientId(int patientId)
        {
            TagRegistrationDto result = new TagRegistrationDto();

            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            DbTools.SelectQuery(
                FireBirdConnection.Connection,
                ds.TagRegistration, string.Format(UrgentAppQueries.TAGREGISTRATION_SELECT_BYPATIENTID, patientId));

            result = baseMapper.BindData <TagRegistrationDto>(ds.TagRegistration);

            return(result);
        }
Ejemplo n.º 9
0
        public void Delete(int patientId)
        {
            var check = GetByPatientId(patientId);

            if (check == null)
            {
                throw new ApplicationException();
            }

            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            DbTools.ExecuteQuery(
                FireBirdConnection.Connection,
                string.Format(UrgentAppQueries.TAGREGISTRATION_DELETE_BYPATIENTID, patientId));
        }
Ejemplo n.º 10
0
    public MyDataSet DatosTarjeta(string IdTarjeta)
    {
        string    sCadenaConexion = ConfigurationManager.AppSettings["CadenaConexion"].ToString();
        string    sSQL            = "SELECT Id_NoTarjeta,No_Pin,Nombre,PrimerApellido,SegundoApellido,NoSucursal,FechaOrdenImp,EstadoPin,Estado,Id_Matriz,Id_Lote,IdentificacionCliente,TipoIdentificacion,Id_Pais,Coord_Contrato FROM dbo.TLB_Tarjeta WHERE (dbo.TLB_Tarjeta.Id_NoTarjeta = '" + IdTarjeta + "')";
        MyDataSet DTS             = new MyDataSet();

        try
        {
            SqlDataAdapter Adapter = new SqlDataAdapter(sSQL, sCadenaConexion);
            Adapter.Fill(DTS, "DatosTarjetas");
        }
        catch (Exception excp)
        {
            throw excp;
        }
        return(DTS);
    }
Ejemplo n.º 11
0
    // datos de banca movil
    public MyDataSet DatosClienteBmovil(string IdTarjeta)
    {
        string    sCadenaConexion = ConfigurationManager.AppSettings["CadenaConexion"].ToString();
        string    sSQL            = "select ID_TARJETA,NUM_IDEPER,COD_TIPID,COD_PAEXID FROM sfn_GetClienteBMovil('" + IdTarjeta.Trim() + "')";
        MyDataSet DTS             = new MyDataSet();

        try
        {
            SqlDataAdapter Adapter = new SqlDataAdapter(sSQL, sCadenaConexion);
            Adapter.Fill(DTS, "DatosClienteBMovil");
        }
        catch (Exception excp)
        {
            throw excp;
        }
        return(DTS);
    }
Ejemplo n.º 12
0
        public IActionResult Post([FromBody] MyDataModel value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var entity = new MyDataSet()
            {
                Description = value.Description
            };

            _repo.Create(entity);
            _repo.SaveChanges();

            return(Get(entity.Id));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 判断是否可打印顾客退还图书信息
        /// </summary>
        private bool HaveBookReturnData()
        {
            SqlConnection  connect = InitConnect.GetConnection();
            MyDataSet      data    = new MyDataSet();
            SqlDataAdapter adapter = new SqlDataAdapter("select * from bookreturnme", connect);

            data.Clear();
            adapter.Fill(data.book_return);
            if (data.book_return.DefaultView.Count != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 14
0
        private static void Main(string[] args)
        {
            // how you split up Col1 to get your list of int's dataset is up to you
            var myDataSet1 = new MyDataSet(new List <int>(new int[] { 1, 2, 3 }));

            Console.WriteLine(myDataSet1.GetHashCode());

            var myDataSet2 = new MyDataSet(new List <int>(new int[] { 2, 1, 3 }));

            Console.WriteLine(myDataSet2.GetHashCode());

            var myDataSet3 = new MyDataSet(new List <int>(new int[] { 3, 2, 1 }));

            Console.WriteLine(myDataSet3.GetHashCode());

            Console.ReadLine();
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 判断是否可打印光盘损坏
        /// </summary>
        private bool HaveCdBadData()
        {
            SqlConnection  connect = InitConnect.GetConnection();
            MyDataSet      data    = new MyDataSet();
            SqlDataAdapter adapter = new SqlDataAdapter("select * from cdbadme", connect);

            data.Clear();
            adapter.Fill(data.cd_bad);
            if (data.cd_bad.DefaultView.Count != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 16
0
        public void Create(TagRegistrationDto tagRegistration)
        {
            MyDataSet ds = new MyDataSet();

            ds.EnforceConstraints = false;

            CheckForPKViolations(tagRegistration);

            string query = string.Format(
                UrgentAppQueries.TAGREGISTRATION_INSERT,
                tagRegistration.Id,
                tagRegistration.Tag_Id,
                tagRegistration.Patient_Id
                );

            DbTools.ExecuteQuery(
                FireBirdConnection.Connection, query);
        }
Ejemplo n.º 17
0
    public MyDataSet Reclamaciones(DateTime Desde, DateTime Hasta)
    {
        string sCadenaConexion = ConfigurationManager.AppSettings["CadenaConexion"].ToString();

        string    date_format = "SET DATEFORMAT YMD ";
        string    sSQL        = date_format + "SELECT Fecha, Id_Transaccion, Usuario, Descripcion FROM TLB_Reclamacion WHERE (Fecha >= '" + Desde + "' AND Fecha <= '" + Hasta + "')  ORDER BY Fecha";
        MyDataSet DTS         = new MyDataSet();

        try
        {
            SqlDataAdapter Adapter = new SqlDataAdapter(sSQL, sCadenaConexion);
            Adapter.Fill(DTS, "TLB_Reclamacion");
        }
        catch (Exception excp)
        {
            throw excp;
        }
        return(DTS);
    }
Ejemplo n.º 18
0
        private void crysreportpenjualaneceran_Load(object sender, EventArgs e)
        {
            string    id = FormPenjRetail.id;
            MyDataSet ds = new MyDataSet();
            db_Form_Penjualan_EceranTableAdapter d = new db_Form_Penjualan_EceranTableAdapter();
            db_BarangTableAdapter b = new db_BarangTableAdapter();
            db_Detail_Form_Penjualan_EceranTableAdapter dt = new db_Detail_Form_Penjualan_EceranTableAdapter();

            d.FillById(ds.db_Form_Penjualan_Eceran, id);
            b.FillByIdeceran(ds.db_Barang, id);
            dt.FillByid(ds.db_Detail_Form_Penjualan_Eceran, id);

            ReportClass rc = new formpenjualaneceran();

            rc.SetDataSource(ds);

            this.crystalReportViewer1.ReportSource  = rc;
            this.crystalReportViewer1.ToolPanelView = ToolPanelViewType.None;
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Adds a new row to the DataSet Study Table (MyStudyTable) if the DicomDataSet StudyInstanceUID does not already exist
        /// </summary>
        /// <param name="ds">The Leadtools.Dicom.DicomDataSet that is being stored</param>
        /// <param name="instanceDataSet">The DataSet that contains the patient, study, series, and instance tables</param>
        /// <param name="updateExistentPatient">If 'true', update the existing patient with information from dicomDataSet</param>
        /// <param name="retrieveAe">retrieveAe">AE Title of the client doing the retrieval</param>
        private void FillStudiesData(DicomDataSet ds, MyDataSet instanceDataSet, bool updateExistentStudy, string retrieveAe)
        {
            string patientIdentification = ds.MyGetStringValue(DicomTag.PatientID, AutoTruncate, instanceDataSet.MyPatientTable.PatientIdentificationColumn.MaxLength);
            string studyInstanceUID      = ds.MyGetStringValue(DicomTag.StudyInstanceUID, AutoTruncate, instanceDataSet.MyStudyTable.StudyStudyInstanceUIDColumn.MaxLength);

            if (null == studyInstanceUID)
            {
                return;
            }

            MyDataSet.MyStudyTableRow studyRow = null;
            DataRow[] rows = instanceDataSet.MyStudyTable.Select(string.Format("StudyStudyInstanceUID = '{0}'", studyInstanceUID));
            MyDataSet.MyStudyTableRow[] studyRows = (MyDataSet.MyStudyTableRow[])rows;
            if (studyRows != null && studyRows.Length > 0)
            {
                studyRow = studyRows[0];
            }

            bool studyFound = (null != studyRow);

            if (!studyFound)
            {
                studyRow = instanceDataSet.MyStudyTable.NewMyStudyTableRow();

                studyRow.StudyPatientId        = -1;          // Fill this in later
                studyRow.StudyStudyInstanceUID = studyInstanceUID;

                instanceDataSet.MyStudyTable.AddMyStudyTableRow(studyRow);
            }
            else if (!updateExistentStudy)
            {
                return;
            }

            FillStudyInformation(studyRow,
                                 ds,
                                 instanceDataSet,
                                 patientIdentification,
                                 studyInstanceUID,
                                 retrieveAe,
                                 updateExistentStudy);
        }
Ejemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //TeleBancaWS.InformeConsultas[] TempIC = (TeleBancaWS.InformeConsultas[])Datos[1];
        DateTime Desde   = Convert.ToDateTime(Request.QueryString["Desde"]);
        DateTime Hasta   = Convert.ToDateTime(Request.QueryString["Hasta"]);
        string   por     = Request.QueryString["por"];
        string   oper    = Request.QueryString["oper"];
        string   serv    = Request.QueryString["serv"];
        Class1   MyClass = new Class1();

        Desde.ToString("yyyy-MM-dd h:mm tt");
        Hasta.ToString("yyyy-MM-dd h:mm tt");
        MyDataSet DTS = MyClass.IContratodeServicios(Desde, Hasta, por, oper, serv);


        /*Para poder cargar el rpt, se tuvo que agregar en el HEAD de la pagina del reporte la sgte linea:
         * <script language="javascript" type="text/javascript" src="../aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js"></script>
         *
         * Para poder agregarla tiene que estar la carpeta: aspnet_client\system_web\4_0_30319\crystalreportviewers13, en el proyecto
         * Casi siempre esta en el wwwroot del inetput del sistema operativo, en C:\
         *
         */
        ReportDocument reportContrato = new ReportDocument();

        reportContrato.Load(Server.MapPath("~/Reports/ReporteContratos.rpt")); // se tuvo que modificar esta linea, porque como cargaba el rpt no funcionaba
        //reportContrato.SetParameterValue("Desde", Desde);
        reportContrato.SetDataSource(DTS);
        Reporte_Contrato.ReportSource = reportContrato;
        Reporte_Contrato.RefreshReport();



        /*CODIGO ANTERIOR*/
        //string ReportPath = Server.MapPath("~/Reports/ReporteContratos.rpt");
        //CrystalReportSource1.ReportDocument.Load(ReportPath);
        ////CrystalReportSource1.ReportDocument.SetParameterValue("Desde", Desde);
        //CrystalReportSource1.ReportDocument.SetDataSource(DTS);
        //CrystalReportViewer1.ReportSource = CrystalReportSource1;
        //CrystalReportViewer1.RefreshReport();

        //C:\Users\Administrator\Desktop\BT\Telebanca\Reports\ReporteContratos.rpt
    }
Ejemplo n.º 21
0
        /// <summary>
        /// Adds a new row to the DataSet Study Table (MySeriesTable) if the DicomDataSet SeriesInstanceUID does not already exist
        /// </summary>
        /// <param name="ds">The Leadtools.Dicom.DicomDataSet that is being stored</param>
        /// <param name="instanceDataSet">The DataSet that contains the patient, study, series, and instance tables</param>
        /// <param name="updateExistentPatient">If 'true', update the existing patient with information from dicomDataSet</param>
        /// <param name="retrieveAe">retrieveAe">AE Title of the client doing the retrieval</param>
        private void FillSeriesData(DicomDataSet ds, MyDataSet instanceDataSet, bool updateExistentSeries, string retrieveAe)
        {
            // studyInstanceUID = GetStringValue(dicomDataSet, DicomTag.StudyInstanceUID, AutoTruncate, instanceDataSet.Series.MaxLength);
            string seriesInstanceUID = ds.MyGetStringValue(DicomTag.SeriesInstanceUID, AutoTruncate, instanceDataSet.MySeriesTable.SeriesSeriesInstanceUIDColumn.MaxLength);

            if (/* null == studyInstanceUID  || */ null == seriesInstanceUID)
            {
                return;
            }

            // MyDataSet.SeriesRow seriesRow = instanceDataSet.Series.FindBySeriesInstanceUID(seriesInstanceUID);
            MyDataSet.MySeriesTableRow seriesRow = null;
            DataRow[] rows = instanceDataSet.MySeriesTable.Select(string.Format("SeriesSeriesInstanceUID = '{0}'", seriesInstanceUID));
            MyDataSet.MySeriesTableRow[] seriesRows = (MyDataSet.MySeriesTableRow[])rows;
            if (seriesRows != null && seriesRows.Length > 0)
            {
                seriesRow = seriesRows[0];
            }

            bool seriesFound = (null != seriesRow);

            if (!seriesFound)
            {
                seriesRow = instanceDataSet.MySeriesTable.NewMySeriesTableRow();

                // seriesRow.StudyInstanceUID = studyInstanceUID;
                seriesRow.SeriesSeriesInstanceUID = seriesInstanceUID;

                instanceDataSet.MySeriesTable.AddMySeriesTableRow(seriesRow);
            }
            else if (!updateExistentSeries)
            {
                return;
            }

            FillSeriesInformation(seriesRow,
                                  ds,
                                  instanceDataSet,
                                  seriesInstanceUID,
                                  retrieveAe,
                                  updateExistentSeries);
        }
Ejemplo n.º 22
0
    public MyDataSet OperacionesReversadas(DateTime Desde, DateTime Hasta)
    {
        string sCadenaConexion = ConfigurationManager.AppSettings["CadenaConexion"].ToString();

        string    date_format = "SET DATEFORMAT YMD ";
        string    sSQL        = date_format + "SELECT * from dbo.TLB_OperacionesReversadas WHERE (FechaHora >= '" + Desde + "' and FechaHora <= '" + Hasta + "')";
        MyDataSet DTS         = new MyDataSet();

        try
        {
            SqlDataAdapter Adapter = new SqlDataAdapter(sSQL, sCadenaConexion);
            Adapter.Fill(DTS, "TLB_OperacionesReversadas");
        }
        catch (Exception excp)
        {
            throw excp;
        }

        return(DTS);
    }
Ejemplo n.º 23
0
        public override void Create()
        {
            MyDataSet.WriteXmlSchema(DirPath + "\\" + BaseName + "_sheme.xsd");// запись схемы данных
            try
            {
                Conn.Open();

                if (MyDataSet != null)
                {
                    Cmd.CommandText = string.Format("if (db_id('{0}') is not null) DROP DATABASE [{0}] CREATE DATABASE [{0}] ", BaseName);
                    Cmd.ExecuteNonQuery();

                    foreach (DataTable tbl in MyDataSet.Tables)
                    {
                        Cmd.CommandText = string.Format("USE [{0}] CREATE TABLE {1} (", BaseName, tbl.TableName);

                        foreach (DataColumn col in tbl.Columns)
                        {
                            Cmd.CommandText += string.Format("[{0}] {1}, ", col.ColumnName, new SqlField(col).GenerateSql());
                        }

                        Cmd.CommandText  = Cmd.CommandText.Remove(Cmd.CommandText.Length - 2);
                        Cmd.CommandText += string.Format(@")");
                        Cmd.ExecuteNonQuery();
                    }
                }
                MessageBox.Show("DataBase (sql): " + BaseName + " has created Successfully", "MyProgram", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "MyProgram", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (Conn.State == ConnectionState.Open)
                {
                    Conn.Close();
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Adds a new row to the DataSet Patient table (MyPatientTable) if the DicomDataSet PatientID does not already exist
        /// </summary>
        /// <param name="ds">The Leadtools.Dicom.DicomDataSet that is being stored</param>
        /// <param name="instanceDataSet">The DataSet that contains the patient, study, series, and instance tables</param>
        /// <param name="updateExistentPatient">If 'true', update the existing patient with information from dicomDataSet</param>
        /// <param name="retrieveAe">retrieveAe">AE Title of the client doing the retrieval</param>
        private void FillPatientData(DicomDataSet ds, MyDataSet instanceDataSet, bool updateExistentPatient, string retrieveAe)
        {
            string patientId = ds.MyGetStringValue(DicomTag.PatientID, AutoTruncate, instanceDataSet.MyPatientTable.PatientIdColumn.MaxLength);

            if (null == patientId)
            {
                return;
            }

            MyDataSet.MyPatientTableRow patientRow = null;
            DataRow[] rows = instanceDataSet.MyPatientTable.Select(string.Format("PatientIdentification = '{0}'", patientId));

            MyDataSet.MyPatientTableRow[] patientRows = (MyDataSet.MyPatientTableRow[])rows;
            if (patientRows != null && patientRows.Length > 0)
            {
                patientRow = patientRows[0];
            }

            bool patientFound = (null != patientRow);

            if (!patientFound)
            {
                patientRow = instanceDataSet.MyPatientTable.NewMyPatientTableRow();

                patientRow.PatientIdentification = patientId;

                instanceDataSet.MyPatientTable.AddMyPatientTableRow(patientRow);
            }
            else if (!updateExistentPatient)
            {
                return;
            }

            FillPatientInformation(patientRow,
                                   ds,
                                   instanceDataSet,
                                   patientId,
                                   retrieveAe,
                                   updateExistentPatient);
        }
Ejemplo n.º 25
0
    public MyDataSet TarjetasCalientes(DateTime Desde, DateTime Hasta, string Descripcion, string operador)
    {
        string oper;
        string Descr;

        if (Descripcion == "Todos")
        {
            Descr = "<>''";
        }
        else
        {
            Descr = "='" + Descripcion + "'";
        }
        if (operador == "")
        {
            oper = "<>''";
        }
        else
        {
            oper = "='" + operador + "'";
        }



        string    sCadenaConexion = ConfigurationManager.AppSettings["CadenaConexion"].ToString();
        string    date_format     = "SET DATEFORMAT YMD ";
        string    sSQL            = date_format + "SELECT dbo.TLB_Tarjeta.Id_NoTarjeta AS Tarjeta, dbo.TLB_Tarjeta.IdentificacionCliente AS CI, dbo.TLB_Tarjeta.Nombre, dbo.TLB_Tarjeta.PrimerApellido AS Apellidos, dbo.TLB_AccionesUsuario.Fecha, dbo.TLB_AccionesUsuario.Usuario AS Operador, SUBSTRING(dbo.TLB_AccionesUsuario.Descripcion, 13, 1) AS Descripcion FROM dbo.TLB_AccionesUsuario INNER JOIN dbo.TLB_Tarjeta ON SUBSTRING(dbo.TLB_AccionesUsuario.Descripcion, 2, 10) = dbo.TLB_Tarjeta.Id_NoTarjeta  WHERE (dbo.TLB_AccionesUsuario.Funcionalidad = 'Tarjeta Caliente') AND (dbo.TLB_AccionesUsuario.Fecha >= '" + Desde + "' AND dbo.TLB_AccionesUsuario.Fecha <= '" + Hasta + "') AND (dbo.TLB_AccionesUsuario.Usuario " + oper + ") AND (SUBSTRING(dbo.TLB_AccionesUsuario.Descripcion, 13, 1) " + Descr + ") ORDER BY dbo.TLB_AccionesUsuario.Fecha";
        MyDataSet DTS             = new MyDataSet();

        try
        {
            SqlDataAdapter Adapter = new SqlDataAdapter(sSQL, sCadenaConexion);
            Adapter.Fill(DTS, "TarjetasCalientes");
        }
        catch (Exception excp)
        {
            throw excp;
        }
        return(DTS);
    }
Ejemplo n.º 26
0
        /// <summary>
        /// Creates the necessary table entries (MyPatient, MyStudy, MySeries, MyInstance) for a Leadtools.Dicom.DicomDataSet
        /// </summary>
        /// <param name="ds">The Leadtools.Dicom.DicomDataSet that is being stored.</param>
        /// <param name="referencedFileName">Full path to the DICOM file</param>
        /// <param name="retrieveAe">AE Title of the client doing the retrieval</param>
        /// <param name="images">Not used</param>
        /// <param name="updateExistentPatient">If true, overwrite an existing patient data.</param>
        /// <param name="updateExistentStudy">If true, overwrite any existing study data.</param>
        /// <param name="updateExistentSeries">If true, overwrite any existing series data.</param>
        /// <param name="updateExistentInstances">If true, overwrite an existing instance data.</param>
        /// <remarks>
        /// Table rows are overwritten based on the parameters:
        /// <list>
        /// <item>updateExistentPatient</item>
        /// <item>updateExistentStudy</item>
        /// <item>updateExistentSeries</item>
        /// <item>updateExistentInstances</item>
        /// </list>
        /// </remarks>
        public override void StoreDicom(DicomDataSet ds,
                                        string referencedFileName,
                                        string retrieveAe,
                                        ReferencedImages[] images,
                                        bool updateExistentPatient,
                                        bool updateExistentStudy,
                                        bool updateExistentSeries,
                                        bool updateExistentInstances
                                        )
        {
            if (ds.IsHangingProtocolDataSet())
            {
                return;
            }

            DataSet dataSetTemp = GetUpdateDataSet(ds,
                                                   updateExistentPatient,
                                                   updateExistentStudy,
                                                   updateExistentSeries,
                                                   updateExistentInstances);

            MyDataSet instanceDataSet = new MyDataSet();

            instanceDataSet.Merge(dataSetTemp);

            MyDicomDataSetConvertor converter = new MyDicomDataSetConvertor();

            converter.FillADONetDataSet(instanceDataSet,
                                        ds,
                                        referencedFileName,
                                        retrieveAe,
                                        updateExistentPatient,
                                        updateExistentStudy,
                                        updateExistentSeries,
                                        updateExistentInstances);


            UpdateCompositeInstance(instanceDataSet);
        }
Ejemplo n.º 27
0
        private static void UpdatePatientDataset(
            MyDataSet updatingDataset,
            DbConnection updatingDbConnection,
            DbTransaction updatingTransaction,
            MyUpdateTableDelegate updateTable
            )
        {
            try
            {
                updateTable(updatingDataset,
                            updatingDbConnection,
                            updatingTransaction,
                            updatingDataset.MyPatientTable.TableName);
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.WriteLine(exception.Message);
                System.Diagnostics.Debug.Assert(false);

                throw;
            }
        }
Ejemplo n.º 28
0
 private void PrintWareSale_Load(object sender, EventArgs e)//初始化
 {
     if (ware.Trim() == "图书")
     {
         SqlConnection  connect = InitConnect.GetConnection();
         MyDataSet      data    = new MyDataSet();
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     select  = new SqlCommand();
         adapter.SelectCommand             = select;
         adapter.SelectCommand.Connection  = connect;
         adapter.SelectCommand.CommandText = "PrintBookSale";
         adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         adapter.SelectCommand.Parameters.AddWithValue("@date1", begindate);
         adapter.SelectCommand.Parameters.AddWithValue("@date2", enddate);
         data.Clear();
         adapter.Fill(data.book_sale);
         PrintBookSale booksale = new PrintBookSale();
         booksale.SetDataSource(data);
         this.crystalReportViewer1.ReportSource = booksale;
     }
     else
     {
         SqlConnection  connect = InitConnect.GetConnection();
         MyDataSet      data    = new MyDataSet();
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     select  = new SqlCommand();
         adapter.SelectCommand             = select;
         adapter.SelectCommand.Connection  = connect;
         adapter.SelectCommand.CommandText = "PrintCdSale";
         adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         adapter.SelectCommand.Parameters.AddWithValue("@date1", begindate);
         adapter.SelectCommand.Parameters.AddWithValue("@date2", enddate);
         data.Clear();
         adapter.Fill(data.cd_sale);
         PrintCdSale cdsale = new PrintCdSale();
         cdsale.SetDataSource(data);
         this.crystalReportViewer1.ReportSource = cdsale;
     }
 }
Ejemplo n.º 29
0
    public MyDataSet ContratodeServicios(DateTime Desde, DateTime Hasta, string subcadena)
    {
        string sCadenaConexion = ConfigurationManager.AppSettings["CadenaConexion"].ToString();

        //Hasta = Hasta.Date.Add(new TimeSpan(0, 11, 59, 59, 59));
        Hasta = Hasta.Date.Add(new TimeSpan(11, 59, 59)); // especificada la hora hasta donde se hace el corte de las 12pm

        string    date_format = "SET DATEFORMAT YMD ";
        string    sSQL        = date_format + "SELECT Usuario, Funcionalidad, Fecha, Descripcion FROM TLB_AccionesUsuario WHERE(Funcionalidad = 'Contratar Servicios') AND (Fecha >='" + Desde.Date + "' AND Fecha <= '" + Hasta + "')" + subcadena + " ORDER BY Fecha";
        MyDataSet DTS         = new MyDataSet();

        try
        {
            SqlDataAdapter Adapter = new SqlDataAdapter(sSQL, sCadenaConexion);
            Adapter.Fill(DTS, "TLB_AccionesUsuario");
        }
        catch (Exception excp)
        {
            throw excp;
        }
        return(DTS);
    }
Ejemplo n.º 30
0
        public static DataSet Example()
        {
            var connectionDetails =
                ConfigurationManager.ConnectionStrings ["MyDatabase"];

            var providerName     = connectionDetails.ProviderName;
            var connectionString = connectionDetails.ConnectionString;
            var dbFactory        = DbProviderFactories.GetFactory(providerName);

            var adapter = dbFactory.CreateDataAdapter();

            // Fill
            var myDataSet = new MyDataSet();
            var myTable   = new MyDataSet.MyTableDataTable();

            adapter.Fill(myTable);

            foreach (MyDataSet.MyTableRow myTableRow in myTable)
            {
                var id     = myTableRow.Id;
                var name   = myTableRow.Name;
                var isMale = myTableRow.IsMale;
            }

            // insert
            MyDataSet.MyTableRow newRow = myTable.NewMyTableRow();

            newRow.Name   = "Bobby McFroggy";
            newRow.Id     = 1;
            newRow.IsMale = true;

            myTable.AddMyTableRow(newRow);

            myTable.AddMyTableRow(2, "James Pond", true);

            adapter.Update(myTable);

            return(myDataSet);
        }
		public static DataSet Example ()
		{
			var connectionDetails = 
				ConfigurationManager.ConnectionStrings ["MyDatabase"];

			var providerName = connectionDetails.ProviderName;
			var connectionString = connectionDetails.ConnectionString;
			var dbFactory = DbProviderFactories.GetFactory (providerName);   

			var adapter = dbFactory.CreateDataAdapter ();

			// Fill	
			var myDataSet = new MyDataSet ();
			var myTable = new MyDataSet.MyTableDataTable ();     

			adapter.Fill (myTable);     

			foreach (MyDataSet.MyTableRow myTableRow in myTable) {
				var id = myTableRow.Id;
				var name = myTableRow.Name;
				var isMale = myTableRow.IsMale;
			}

			// insert
			MyDataSet.MyTableRow newRow = myTable.NewMyTableRow ();          

			newRow.Name = "Bobby McFroggy";     
			newRow.Id = 1;     
			newRow.IsMale = true;     

			myTable.AddMyTableRow (newRow);     

			myTable.AddMyTableRow (2, "James Pond", true);	

			adapter.Update (myTable);   
		
			return myDataSet;
		}
Ejemplo n.º 32
0
    // 画面レイアウト
    void OnGUI()
    {
        if (_data == null) {
            // データの読み込み
            _data = AssetDatabase.LoadAssetAtPath(DataPath, typeof(MyDataSet)) as MyDataSet;
            if(_data == null)
            {
                _data = ScriptableObject.CreateInstance<MyDataSet>() as MyDataSet;
                AssetDatabase.CreateAsset(_data, DataPath);
                AssetDatabase.Refresh();
            }
        }

        EditorGUILayout.BeginHorizontal();

        // 要素の追加ボタン
        Color mainColor = GUI.color;
        GUI.color = Color.green;
        if (GUILayout.Button("+", GUILayout.Width(20))) {
            MyData addData = new MyData();
            MyData[] copy = new MyData[_data.list.Count];
            Array.Copy(_data.list.ToArray(), copy, _data.list.Count);
            Array.Sort(copy, (MyData a, MyData b)=>{ return a.id - b.id; });
            int newId = (copy!=null && copy.Length>0) ? copy[0].id : 0;
            // 最小のモンスターIDを探す
            for (int i=0; i<copy.Length; i++)
            {
                if (newId < copy[i].id) {
                    break;
                }
                else {
                    newId++;
                }
            }
            addData.id = newId;

            // データの追加
            _data.list.Insert(newId, addData);
        }
        GUI.color = mainColor;

        // 要素のコピー
        GUI.color = (copyInstance==null) ? Color.white : Color.green;
        if (GUILayout.Button("copy", GUILayout.Width(50))) {
            if (selected != -1)
            {
                copyInstance = (MyData)_data.list[selected].Clone();
                Debug.Log("copy : " + copyInstance.id + "  " +  copyInstance.name);
            }
        }
        GUI.color = mainColor;

        // 要素のペースト
        GUI.color = (copyInstance==null ? Color.white : Color.green);
        if (GUILayout.Button("paste", GUILayout.Width(50))) {
            if (selected != -1)
            {
                int pasteId = _data.list[selected].id;
                copyInstance.id = pasteId;
                _data.list[selected] = copyInstance;
                Debug.Log("paste : " + copyInstance.id + "  " +  copyInstance.name);
            }
        }
        GUI.color = mainColor;

        EditorGUILayout.EndHorizontal();

        scrollPos = GUILayout.BeginScrollView(scrollPos);
        Color orgCol = GUI.backgroundColor;

        // 配置オブジェクトのリストを表示
        if (_data != null && _data.list != null && _data.list.Count > 0)
        {
            for(int i = 0; i < _data.list.Count; i++) {
                orgCol = GUI.backgroundColor;
                GUI.backgroundColor = _data.list[i].color;// 色設定

                GUILayout.BeginHorizontal();
                bool prev = i == selected;
                if (prev) GUI.backgroundColor = Color.magenta;
                bool flag = GUILayout.Toggle((i == selected), _data.list[i].id.ToString() + " : " + _data.list[i].name, "BoldLabel");

                GUI.backgroundColor = orgCol;
                if (GUILayout.Button("Edit",GUILayout.Width(60))) {
                    isEditMode = !isEditMode;
                    selected = i;// 選択中にする
                }
                GUI.backgroundColor = Color.red;
                if (GUILayout.Button("Remove", GUILayout.Width(60))) {
                    // 削除確認のダイアログ
                    bool result = EditorUtility.DisplayDialog(
                        "Remove",
                        "Remove this object.",
                        "OK",
                        "Cancel");

                    if(result){
                        _data.list.RemoveAt(i);
                        GUI.FocusControl("");
                    }
                }
                GUI.backgroundColor = orgCol;
                EditorGUILayout.EndHorizontal();
                if (flag){
                    selected = i;

                    // 編集モード
                    if (isEditMode){
                        // TODO : 変数代入のエディタスクリプトを記述
                        int id_new				= EditorGUILayout.IntField("\tid", _data.list[i].id);
                        if (id_new != _data.list[i].id)
                        {
                            // すでにIDが使われていないかチェック
                            if (_data.list.Find(a=>a.id==id_new) == null)
                                _data.list[i].id = id_new;
                        }

                        _data.list[i].name		= EditorGUILayout.TextField("\tname", _data.list[i].name);
                        _data.list[i].image		= EditorGUILayout.ObjectField("\timage", _data.list[i].image, typeof(Texture2D), true) as Texture2D;
                        _data.list[i].color		= EditorGUILayout.ColorField("\tcolor", _data.list[i].color);
                        _data.list[i].type		= (int)Enum.ToObject(typeof(MyData.Type), EditorGUILayout.EnumPopup("\ttype", (MyData.Type)_data.list[i].type));
                    }
                }
                else{
                    // トグルを二度押ししたら非選択状態にする
                    if (prev){
                        selected = -1;
                        isEditMode = false;
                    }
                }
                GUI.color = orgCol;
            }
        }

        // スクロールバー終了
        GUILayout.EndScrollView();
        // Apply Data
        ScriptableObject scriptable = AssetDatabase.LoadAssetAtPath(DataPath, typeof(ScriptableObject)) as ScriptableObject;
        EditorUtility.SetDirty(scriptable);
    }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     MyDataSet ds = new MyDataSet();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "EmployeeDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     MyDataSet ds = new MyDataSet();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }