• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.DateTimePicker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.DateTimePicker的典型用法代码示例。如果您正苦于以下问题:C# DateTimePicker类的具体用法?C# DateTimePicker怎么用?C# DateTimePicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DateTimePicker类属于System.Windows.Forms命名空间,在下文中一共展示了DateTimePicker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: listarMicros

        public static void listarMicros(DataGridView dgMicros, String patente, String patenteEstimada,
            String modelo, String modeloEstimado, DateTimePicker dtpFechaAlta, String marca, String tipoServicio,
            decimal numero, bool mostrarDeshabilitados, bool mostrarHabilitados)
        {
            try
            {
                using (SqlConnection conn = new SqlConnection(main.connString))
                using (SqlCommand cmd = new SqlCommand("BONDIOLA.listarMicros", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    SQL_Library.agregarParametro(cmd, "@patente", patente);
                    SQL_Library.agregarParametro(cmd, "@patenteEstimada", patenteEstimada);
                    SQL_Library.agregarParametro(cmd, "@modelo", modelo);
                    SQL_Library.agregarParametro(cmd, "@modeloEstimado", modeloEstimado);
                    SQL_Library.agregarParametroFecha(cmd, dtpFechaAlta, "@fecha_alta");
                    SQL_Library.agregarParametro(cmd, "@marca", marca);
                    SQL_Library.agregarParametro(cmd, "@tipoServicio", tipoServicio);
                    SQL_Library.agregarParametro(cmd, "@numero", numero);
                    SQL_Library.agregarParametro(cmd, "@mostrarDeshabilitados", mostrarDeshabilitados);
                    SQL_Library.agregarParametro(cmd, "@mostrarHabilitados", mostrarHabilitados);
                    SQL_Library.agregarParametro(cmd, "@fechaActual", Properties.Settings.Default.Fecha);

                    SQL_Library.llenarDataGrid(dgMicros, conn, cmd);
                }
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:juanmjacobs,项目名称:gestion2c2013,代码行数:30,代码来源:Listado.cs


示例2: ListarEntredatas

        public void ListarEntredatas(DataGridView dgv, string codigo, DateTimePicker dtpInicial, DateTimePicker dtpFinal)
        {
            try
            {
                InstanciarBanco();
                dgv.DataSource = ((from mov in _banco.MovimentacaoProduto
                                   join prod in _banco.Produto on new { Codigo = mov.Codigo } equals new { Codigo = prod.Codigo }
                                   where prod.Codigo == codigo && mov.Data >= dtpInicial.Value.Date && mov.Data <= dtpFinal.Value.Date
                                   group new { mov, prod } by new
                                   {
                                       mov.Codigo,
                                       prod.Nome
                                   } into g
                                   select new
                                   {
                                       Código = g.Key.Codigo,
                                       Nome = g.Key.Nome,
                                       Quantidade = g.Sum(p => p.mov.Quantidade),
                                       Total = g.Sum(p => p.mov.Valor)
                                   }).Distinct()).ToList();

            }
            catch (CustomException erro)
            {
                DialogMessage.MessageFullComButtonOkIconeDeInformacao(erro.Message, "Aviso");
            }
            catch (Exception erro)
            {
                DialogMessage.MessageComButtonOkIconeErro(erro.Message, "Erro");
            }
        }
开发者ID:PablusVinii,项目名称:Caixapadariav2,代码行数:31,代码来源:MovimentacaoProdutoRepositorio.cs


示例3: CreateControl

		/// <summary>
		/// Create the editor control
		/// </summary>
		/// <returns></returns>
		protected override Control CreateControl()
		{
			System.Windows.Forms.DateTimePicker dtPicker = new System.Windows.Forms.DateTimePicker();
			dtPicker.Format = DateTimePickerFormat.Time;
			dtPicker.ShowUpDown = true;
			return dtPicker;
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:TimePicker.cs


示例4: DateTimePickerPresentation

        /// <summary>
        /// Initializes a new instance of the 'DateTimePickerPresentation' class.
        /// </summary>
        /// <param name="maskedTextBox">.NET MaskedTextBox reference.</param>
        /// <param name="dateTimePicker">.NET DateTimePicker reference.</param>
        public DateTimePickerPresentation(MaskedTextBox maskedTextBox, DateTimePicker dateTimePicker)
        {
            mMaskedTextBoxIT = maskedTextBox;
            mDateTimePickerIT = dateTimePicker;
            if (mMaskedTextBoxIT != null)
            {
                // Create and configure the ErrorProvider control.
                mErrorProvider = new ErrorProvider();
                mErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;

                // Link MaskedTextBox control events.
                mMaskedTextBoxIT.GotFocus += new EventHandler(HandleMaskedTextBoxITGotFocus);
                mMaskedTextBoxIT.LostFocus += new EventHandler(HandleMaskedTextBoxITLostFocus);
                mMaskedTextBoxIT.TextChanged += new EventHandler(HandleMaskedTextBoxITTextChanged);
                mMaskedTextBoxIT.EnabledChanged += new EventHandler(HandleMaskedTextBoxITEnabledChanged);
                mMaskedTextBoxIT.KeyDown += new KeyEventHandler(HandleMaskedTextBoxITKeyDown);
            }

            if (dateTimePicker != null)
            {
                mDateTimePickerIT.Enter += new System.EventHandler(HandleDateTimePickerITEnter);
                mDateTimePickerIT.KeyUp += new System.Windows.Forms.KeyEventHandler(HandleDateTimePickerITKeyUp);
                mDateTimePickerIT.DropDown += new System.EventHandler(HandleDateTimePickerITDropDown);
                mDateTimePickerIT.CloseUp += new System.EventHandler(HandleDateTimePickerCloseUp);
            }
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:31,代码来源:DateTimePickerPresentation.cs


示例5: IsValidTimeRange

        public static bool IsValidTimeRange(DateTimePicker dtpStartTime, DateTimePicker dtpEndTime, NumericUpDown numericUpDown)
        {
            // Check if the start time is after the end time.
            if (dtpStartTime.Value > dtpEndTime.Value)
            {
                MessageBox.Show("The end time must be greater than the start time.", "Entry Error", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                dtpEndTime.Focus();
                return false;
            }

            // TODO: Bug - The date time picker does not roll back to the previous day if the default
            // end time is set for the next day. For example, if we start the program at 8:00 PM, the
            // end time will be set for 12:00 AM the next day. This causes the validation to pass even
            // if the form shows that the time range is too small.

            // Check if at least two time slots can fit in the time range.
            TimeSpan twoTimeSlotsSpan = TimeSpan.FromMinutes((int) numericUpDown.Value * 2);
            if (dtpEndTime.Value - dtpStartTime.Value < twoTimeSlotsSpan)
            {
                MessageBox.Show("The difference between the start and end time must provide for at least two time slots.", "Entry Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtpEndTime.Focus();
                return false;
            }

            return true;
        }
开发者ID:masonelmore,项目名称:TicketQueue,代码行数:28,代码来源:Validator.cs


示例6: EIBDatePickerBase

        public EIBDatePickerBase()
        {
            dateTimePicker = new DateTimePicker();
            dateTimePicker.Size = new Size(width, height);

            //dateTimePicker.CalendarForeColor = Color.White;
            dateTimePicker.Dock = DockStyle.Top;
            this.Controls.Add(dateTimePicker);
            this.Resize += new System.EventHandler(EIBDatePickerBase_Resize);
            this.Size = new Size(width + 5, height + 5);
            this._Width = width;
            if (string.IsNullOrEmpty(this.Name))
            {
                this.Name = "datepicker" + counter;
            }
            if (string.IsNullOrEmpty(this.ControlName))
            {
                this.ControlName = this.Name;
            }
            checkUniqueness(this.Name);
            datapickerNames.Add(this.Name, this.Name);
            this.Margin = new Padding(0, 0, 0, 0);
            this.Font = SystemFonts.DefaultFont;
            this.Layout += new LayoutEventHandler(Control_Layout);
            this.SizeChanged += new System.EventHandler(Control_SizeChanged);
        }
开发者ID:harpreetoxyent,项目名称:pnl,代码行数:26,代码来源:EIBDatePicker.cs


示例7: SelectCoDK

 /*Lấy ra dòng dữ liệu và gán vào các hộp text*/
 public void SelectCoDK(DChuyenBay DCB, TextEdit txtMaCB, ComboBoxEdit cbMaDB, ComboBoxEdit cbMaMB
                           , TimeEdit dtGioBay, TextEdit txtDiemDi, ComboBoxEdit cbDiemDen
                           , DateTimePicker dtNgayDi, DateTimePicker dtNgayDen, TextEdit txtVeL1,
                             TextEdit txtVeL2, TextEdit txtGhiChu)
 {
     try
     {
         string path = string.Format("Select * From ChuyenBay Where MaChuyenBay='{0}'", DCB.MCB);
         DataTable dtt = DA.TbView(path);
         txtMaCB.EditValue = dtt.Rows[0]["MaChuyenBay"].ToString().Trim();
         cbMaDB.EditValue = dtt.Rows[0]["MaDuongBay"].ToString().Trim();
         cbMaMB.EditValue = dtt.Rows[0]["MaMayBay"].ToString().Trim();
         dtGioBay.Text = dtt.Rows[0]["GioBay"].ToString().Trim();
         txtDiemDi.EditValue = dtt.Rows[0]["DiemDi"].ToString().Trim();
         cbDiemDen.EditValue = dtt.Rows[0]["DiemDen"].ToString().Trim();
         dtNgayDi.Text = dtt.Rows[0]["NgayDi"].ToString().Trim();
         dtNgayDen.Text = dtt.Rows[0]["NgayDen"].ToString().Trim();
         txtVeL1.EditValue = dtt.Rows[0]["SLV_Loai1"].ToString().Trim();
         txtVeL2.EditValue = dtt.Rows[0]["SLV_Loai2"].ToString().Trim();
         txtGhiChu.EditValue = dtt.Rows[0]["GhiChu"].ToString().Trim();
         //return dt.TbView(path);
     }
     catch
     {
         XtraMessageBox.Show("Vui lòng kích vào lưới thông tin chọn thông tin cần sửa !", "Chú ý !",
                                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
开发者ID:NguyenManh94,项目名称:ManagerAirTicket,代码行数:29,代码来源:BChuyenBay.cs


示例8: ListarPordata

        public void ListarPordata(DataGridView dgv, string codigo, DateTimePicker dtp)
        {
            try
            {
                InstanciarBanco();
                dgv.DataSource = ((from mov in _banco.MovimentacaoProduto
                                   join prod in _banco.Produto on new { Codigo = mov.Codigo } equals new { Codigo = prod.Codigo }
                                   where prod.Codigo == codigo && mov.Data == dtp.Value.Date
                                   group new { mov, prod } by new
                                   {
                                       mov.Codigo,
                                       prod.Nome
                                   } into g
                                   select new
                                   {
                                       Código = g.Key.Codigo,
                                       Nome = g.Key.Nome,
                                       Quantidade = g.Sum(p => p.mov.Quantidade),
                                       Total = g.Sum(p => p.mov.Valor)
                                   }).Distinct()).ToList();

            }
            catch (CustomException error)
            {
                throw new CustomException(error.Message);
            }
            catch (Exception error)
            {
                throw new Exception(error.Message);
            }
        }
开发者ID:mikemajesty,项目名称:Caixapadariav2,代码行数:31,代码来源:MovimentacaoProdutoRepositorio.cs


示例9: ConfigurationForm

        public ConfigurationForm()
        {
            InitializeComponent();

              settings.Load(settings.cXMLSectionUpdate);
              settings.Load(settings.cXMLSectionMusic);
              settings.Load(settings.cXMLSectionVideo);
              settings.Load(settings.cXMLSectionMisc);

              releaseVersion.Text = String.Format("Version: {0}", Assembly.GetExecutingAssembly().GetName().Version.ToString());
              DateTime buildDate = getLinkerTimeStamp(Assembly.GetExecutingAssembly().Location);
              compileTime.Text += " " + buildDate.ToString() + " GMT";

              timePicker = new DateTimePicker();
              timePicker.Format = DateTimePickerFormat.Time;
              timePicker.ShowUpDown = true;
              timePicker.Location = new Point(309, 85);
              timePicker.Width = 100;
              CheckUpdate.Controls.Add(timePicker);

              if (MiscConfigGUI.MostRecentFanartTimerInt != 0)
            numFanartTimer.Value = (decimal)MiscConfigGUI.MostRecentFanartTimerInt;
              else
            numFanartTimer.Value = 7;
        }
开发者ID:MichelZ,项目名称:streamedmp-michelz,代码行数:25,代码来源:ConfigurationForm.cs


示例10: ListarEntreDatas

        public void ListarEntreDatas(DataGridView dgv, DateTimePicker dtpInicial, DateTimePicker dtpFinal)
        {
            try
            {
                InstanciarBanco();
                dgv.DataSource = ((from movimentacaoCaixa in _banco.MovimentacaoCaixa
                                   where movimentacaoCaixa.Data >= dtpInicial.Value.Date
                                       && movimentacaoCaixa.Data <= dtpFinal.Value.Date
                                   group movimentacaoCaixa by new
                                   {
                                       movimentacaoCaixa.Data
                                   } into g
                                   select new
                                   {
                                       Valor = g.Sum(p => p.Valor),
                                       Data = g.Key.Data
                                   }).Distinct()).ToList();

            }
            catch (CustomException erro)
            {
                throw new CustomException(erro.Message);
            }
            catch (Exception erro)
            {
                throw new Exception(erro.Message);
            }
        }
开发者ID:PablusVinii,项目名称:Caixapadariav2,代码行数:28,代码来源:MovimentacaoCaixaRepositorio.cs


示例11: InitSpec

        protected void InitSpec(DateTimePicker box)
        {
            _Box = box;

            _MenuList = new Dictionary<string, ToolStripMenuItem>(15);
            InitMenu("yyyyMMdd", "yyyyMMdd", MuDate);
            InitMenu("yyyy-MM-dd", "yyyy-MM-dd", MuDate);
            InitMenu("yyyy/MM/dd", "yyyy/MM/dd", MuDate);
            InitMenu("yyyy.MM.dd", "yyyy.MM.dd", MuDate);
            InitMenu("yyyy年MM月dd日", "yyyy年MM月dd日", MuDate);

            InitMenu("HHmmss", "HHmmss", MuTime);
            InitMenu("HH:mm:ss", "HH:mm:ss", MuTime);
            InitMenu("HH时mm分ss秒", "HH时mm分ss秒", MuTime);
            InitMenu("H:m:s", "H:m:s", MuTime);
            InitMenu("H时m分s秒", "H时m分s秒", MuTime);
            InitMenu("h:m:s", "h:m:s", MuTime);
            InitMenu("h时m分s秒", "h时m分s秒", MuTime);

            InitMenu("yyyyMMdd HHmmss", "yyyyMMdd HHmmss", MuDateTime);
            InitMenu("yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss", MuDateTime);
            InitMenu("yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss", MuDateTime);
            InitMenu("yyyy年MM月dd日 HH时mm分ss秒", "yyyy年MM月dd日 HH时mm分ss秒", MuDateTime);

            _LastMenu = MiDateDef;
            _LastMenu.Checked = true;
        }
开发者ID:burstas,项目名称:rmps,代码行数:27,代码来源:ADate.cs


示例12: selectDetails

        public void selectDetails(TextBox txt_Total, DateTimePicker startDatePicker, DateTimePicker endDatePicker)
        {
            var startDate = startDatePicker.Value.ToString("dd-MMM-yyyy");
            var endDate = endDatePicker.Value.ToString("dd-MMM-yyyy");

            string query_String = "SELECT SUM(Cost) FROM Bookings WHERE Return_Date BETWEEN'" + startDate + "'AND'" + endDate + "'";

            try
            {
                connection.Open();
                cmd = connection.CreateCommand();

                cmd.CommandText = query_String;
                data_reader = cmd.ExecuteReader();//the reader is used to read in the required record
                data_reader.Read();

                txt_Total.Text = data_reader.GetValue(0).ToString();

                connection.Close();
            }
            catch (Exception)
            {
                MessageBox.Show("No Records For the Chosen Period", "ERROR", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
        }
开发者ID:pafennell,项目名称:SoftwareEngineering,代码行数:25,代码来源:Account_Query.cs


示例13: Pagos

 public Pagos(string cuota,int codEmpresa)
 {
     this.codEmpresa=codEmpresa;
     InitializeComponent();
     this.lbTotalPago.Text = cuota;
     PagoMemDT = pago_MembresiaTableAdapter.GetDataByEmpresa(codEmpresa);
     //vistaPagos();
     PagoMemDT.Columns["perid_pago"].ColumnName = "Período de Pago";
     PagoMemDT.Columns["num_cuota"].ColumnName = "Número de Cuota";
     PagoMemDT.Columns["monto"].ColumnName = "Monto";
     PagoMemDT.Columns["fech_pago"].ColumnName = "Fecha de Pago";
     PagoMemDT.Columns["pagado"].ColumnName = "Estado";
     PagoMemDT.Columns["num_recib"].ColumnName = "Número de Recibo";
     PagoMemDT.Columns["observaciones"].ColumnName = "Observaciones";
     PagoMemDT.Columns["tipo"].ColumnName = "Tipo";
     this.dgPagosEmpresa.DataSource = PagoMemDT;
     this.domainNumCuotas.SelectedItem=5;
     dtpFechaPago = new DateTimePicker();
     dtpFechaPago.Format = DateTimePickerFormat.Short;
     dtpFechaPago.Visible = false;
     dtpFechaPago.Width = this.dgPagosEmpresa.Columns[5].Width-5;
     this.dgPagosEmpresa.Controls.Add(dtpFechaPago);
     this.dtpFechaPago.ValueChanged += dtpFechaPago_ValueChanged;
     this.dgPagosEmpresa.CellBeginEdit += this.dgPagosEmpresa_CellBeginEdit;
     this.dgPagosEmpresa.CellEndEdit += this.dgPagosEmpresa_CellEndEdit;
 }
开发者ID:eduardo-salazar,项目名称:sag,代码行数:26,代码来源:Pagos.cs


示例14: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			if (provider != null)
			{
				editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
			}
			if (editorService != null)
			{
				if (value == null)
				{
					time = DateTime.Now.ToString("HH:mm");
				}

				DateTimePicker picker = new DateTimePicker();
				picker.Format = DateTimePickerFormat.Custom;
				picker.CustomFormat = "HH:mm";
				picker.ShowUpDown = true;

				if (value != null)
				{
					picker.Value = DateTime.Parse((string)value);
				}

				editorService.DropDownControl(picker);
				value = picker.Value.ToString("HH:mm");
			}
			return value;
		}
开发者ID:dodexahedron,项目名称:EssentialsPlugin,代码行数:28,代码来源:UIEditors.cs


示例15: ListarPorDia

        public void ListarPorDia(DataGridView dgv, DateTimePicker dtp)
        {
            try
            {
                InstanciarBanco();
                dgv.DataSource = (from movimentacaoCaixa in
                                      (from mcaixa in _banco.MovimentacaoCaixa
                                       where mcaixa.Data == dtp.Value.Date
                                       select new
                                       {
                                           mcaixa.Valor,
                                           mcaixa.Data
                                       })
                                  group movimentacaoCaixa by new { movimentacaoCaixa.Data } into g
                                  select new
                                  {
                                      Valor = g.Sum(p => p.Valor),
                                      Data = g.Key.Data
                                  }).ToList();

            }
            catch (CustomException erro)
            {
                throw new CustomException(erro.Message);
            }
            catch (Exception erro)
            {
                throw new Exception(erro.Message);
            }

        }
开发者ID:mikemajesty,项目名称:Caixapadariav2,代码行数:31,代码来源:MovimentacaoCaixaRepositorio.cs


示例16: WinFormsDateTimePickerAdapter

        public WinFormsDateTimePickerAdapter(DateTimePicker control) : base(control)
        {
            _dtp = control;

            _dtp.ValueChanged += RaiseValueChanged;
            _dtp.Enter += RaiseEnter;
        }
开发者ID:Chillisoft,项目名称:habanero.binding,代码行数:7,代码来源:WinFormsDateTimePickerAdapter.cs


示例17: frmArqueoCaja

 public frmArqueoCaja(DateTimePicker dtPicker)
 {
     InitializeComponent();
     Cursor.Current = Cursors.WaitCursor;
     this.dtPicker = dtPicker;
     DataGridViewImageColumn imageColumn2 = new DataGridViewImageColumn();
     Image image2 = global::StockVentas.Properties.Resources.document_edit;
     imageColumn2.Image = image2;
     imageColumn2.Name = "Editar";
     dgvTesoreria.Columns.Add(imageColumn2);
     DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
     Image image = global::StockVentas.Properties.Resources.delete16;
     imageColumn.Image = image;
     imageColumn.Name = "Borrar";
     dgvTesoreria.Columns.Add(imageColumn);
     dgvTesoreria.CellClick += new DataGridViewCellEventHandler(dgvTesoreria_CellClick);
     DataGridViewImageColumn imageColumn3 = new DataGridViewImageColumn();
     imageColumn3.Image = image2;
     imageColumn3.Name = "Editar";
     dgvVentas.Columns.Add(imageColumn3);
     DataGridViewImageColumn imageColumn4 = new DataGridViewImageColumn();
     imageColumn4.Image = image;
     imageColumn4.Name = "Borrar";
     dgvVentas.Columns.Add(imageColumn4);
     dgvVentas.CellClick += new DataGridViewCellEventHandler(dgvVentas_CellClick);
     tblArticulos = BL.ArticulosBLL.CrearDataset();
 }
开发者ID:BenjaOtero,项目名称:trend-pos-factura,代码行数:27,代码来源:frmArqueoCaja.cs


示例18: ParteHandler

        public ParteHandler(Element.ComboBox cboTipoDoc, Element.MaskedTextBox txtNroDni, Element.ComboBox cboSexo,
                            Element.TextBox txtNombre, Element.TextBox txtApellido, Element.MaskedTextBox txtCuit,
                            Element.DateTimePicker dpFecNac, Element.ComboBox cboECivil, Element.TextBox txtDomicilio,
                            Element.ComboBox cboCiudad, Element.ComboBox cboDepartamento, Element.ComboBox cboProvincia,
                            Element.ComboBox cboNacionalidad)
        {
            this.cboTipoDoc = cboTipoDoc;
            this.txtNroDni = txtNroDni;
            this.cboSexo = cboSexo;
            this.txtNombre = txtNombre;
            this.txtApellido = txtApellido;
            this.txtCuit = txtCuit;
            this.dpFecNac = dpFecNac;
            this.cboECivil = cboECivil;
            this.txtDomicilio = txtDomicilio;
            this.cboCiudad = cboCiudad;
            this.cboDepartamento = cboDepartamento;
            this.cboProvincia = cboProvincia;
            this.cboNacionalidad = cboNacionalidad;

            formatoPartes();

            con.Connect();
            ds1 = con.fillDs("SELECT * FROM DOCUMENTOS;", "PARTES");
            ds2 = con.fillDs("SELECT * FROM SEXOS;", "SEXOS");
            ds3 = con.fillDs("SELECT * FROM ESTADOS_CIVILES;", "ESTADOS");
            ds7 = con.fillDs("SELECT * FROM NACIONALIDADES;", "NACIONALIDADES");
            cboTipoDoc.DataSource = ds1.Tables[0];
            cboSexo.DataSource = ds2.Tables[0];
            cboECivil.DataSource = ds3.Tables[0];
            cboNacionalidad.DataSource = ds7.Tables[0];
        }
开发者ID:nahueld,项目名称:CoffeeAndCake,代码行数:32,代码来源:ParteHandler.cs


示例19: calculateBookingCost

        /*
         * Finding the difference between the start booking date and end booking date
         * to calculate the cost of a booking
         */
        public void calculateBookingCost(DateTimePicker startDate, DateTimePicker endDate, ComboBox cbo_Description, TextBox txt_Cost)
        {
            connection.Close();

            DateTime dt1 = Convert.ToDateTime(startDate.Text);
            DateTime dt2 = Convert.ToDateTime(endDate.Text);

            TimeSpan timeSpan = dt2 - dt1;
            int numberOfDays = timeSpan.Days;

            string query_String = "SELECT Car_Rate FROM Car_Class WHERE Description ='" + cbo_Description.Text + "'";

            connection.Open();

            try
            {
                cmd = connection.CreateCommand();
                cmd.CommandText = query_String;
                data_reader = cmd.ExecuteReader();//the reader is used to read in the required record

                if (data_reader.HasRows)
                {
                    data_reader.Read();

                    txt_Cost.Text = ("" + data_reader.GetInt32(0) * numberOfDays);

                }
                connection.Close();
            }
            catch (Exception) { }
        }
开发者ID:pafennell,项目名称:SoftwareEngineering,代码行数:35,代码来源:Booking_Query.cs


示例20: InitializeComponent

		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.labName = new System.Windows.Forms.Label();
			this.picker = new System.Windows.Forms.DateTimePicker();
			this.SuspendLayout();
			// 
			// labName
			// 
			this.labName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.labName.Location = new System.Drawing.Point(0, 0);
			this.labName.Name = "labName";
			this.labName.Size = new System.Drawing.Size(96, 16);
			this.labName.TabIndex = 0;
			// 
			// picker
			// 
			this.picker.Format = System.Windows.Forms.DateTimePickerFormat.Time;
			this.picker.Location = new System.Drawing.Point(0, 16);
			this.picker.Name = "picker";
			this.picker.Size = new System.Drawing.Size(96, 20);
			this.picker.TabIndex = 2;
			// 
			// DateTimeParam
			// 
			this.Controls.Add(this.picker);
			this.Controls.Add(this.labName);
			this.Name = "DateTimeParam";
			this.Size = new System.Drawing.Size(96, 36);
			this.Load += new System.EventHandler(this.DateTimeParam_Load);
			this.ResumeLayout(false);

		}
开发者ID:aj9251,项目名称:pandorasbox3,代码行数:36,代码来源:DateTimeParam.cs



注:本文中的System.Windows.Forms.DateTimePicker类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.Document类代码示例发布时间:2022-05-26
下一篇:
C# Forms.DateRangeEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap