public void basic_datetimepicker_render()
 {
     var html = new DateTimePicker("foo").ToString();
     html.ShouldHaveHtmlNode("foo")
         .ShouldBeNamed(HtmlTag.Input)
         .ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.DateTime);
 }
        public override void AddUI(Grid grid)
        {
            if (Config != null && Config.ShownAtRunTime)
            {
                #region
                DateTimePicker dp = new DateTimePicker() { Value = value.Value };
                dp.SetValue(Grid.RowProperty, grid.RowDefinitions.Count - 1);
                dp.SetValue(Grid.ColumnProperty, 1);
                dp.SetValue(ToolTipService.ToolTipProperty, Config.ToolTip);
                grid.Children.Add(dp);
                dp.ValueChanged += (a, b) =>
                     {
                         Value = new GPDate(Config.Name, dp.Value);
                         GPDate date = Value as GPDate;

                         // Assign "universal" date format that works for all locales with hours in military format so that it
                         // does not require AM/PM which does not work in asian languages. This is a temporary fix until something
                         // more permanent can be done in the Silverlight API.
                         if (date != null)
                             date.Format = "M/d/yyyy HH:mm:ss";

                         RaiseCanExecuteChanged();
                     };
                #endregion
            }
        }
        public DateTimePickerHtmlBuilderTests()
        {
            date = new DateTime(2009, 12, 3);

            dateTimePicker = DateTimePickerTestHelper.CreateDateTimePicker(null, null);
            dateTimePicker.Name = "DatePicker";
            renderer = new DateTimePickerHtmlBuilder(dateTimePicker);
        }
    private void RegisterCustomScripts(DateTimePicker datePickerObject)
    {
        string textBoxClientId = datePickerObject.DateTimeTextBox.ClientID;

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "DTPickerModalSelectDate" + textBoxClientId, ScriptHelper.GetScript(
            String.Format("function SelectModalDate_{0}(param, pickerId) {{ {1} }} \n", textBoxClientId, Page.ClientScript.GetCallbackEventReference(datePickerObject, "param", "SetDateModal", "pickerId"))));

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "DTPickerModalSetDate", ScriptHelper.GetScript("function SetDateModal(result, context) { $cmsj('#' + context).cmsdatepicker('setDateNoTextBox',result); } \n"));
    }
Esempio n. 5
0
	public MainForm ()
	{
		// 
		// _dateTimePicker
		// 
		_dateTimePicker = new DateTimePicker ();
		Controls.Add (_dateTimePicker);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 60);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #343966";
		Load += new EventHandler (MainForm_Load);
	}
 public bool getDateTimePickerChecked(DateTimePicker control)
 {
     #region Variable
     var result = false;
     #endregion
     if (control.InvokeRequired)
     {
         control.Invoke(new MethodInvoker(delegate
         {
             result = control.Checked;
         }));
     }
     else
     {
         result = control.Checked;
     }
     return result;
 }
    private void RegisterPickerInitScripts(DateTimePicker datePickerObject)
    {
        // If true display time
        bool displayTime = datePickerObject.EditTime;

        // Init picker settings
        var settings = new HashSet<string>();
        settings.Add(String.Format("currentText:{0}", ScriptHelper.GetLocalizedString(displayTime ? "calendar.now" : "Calendar.Today")));
        settings.Add(String.Format("NAText:{0}", ScriptHelper.GetLocalizedString("general.notavailable")));
        settings.Add(String.Format("actionPanelButtons:['ok',{0},{1}]", (datePickerObject.AllowEmptyValue ? "'na'" : ""), (datePickerObject.DisplayNow ? "'now'" : "")));
        settings.Add(String.Format("showTimePanel:{0}", displayTime.ToString().ToLowerCSafe()));
        settings.Add("showButtonPanel:true");
        settings.Add("changeMonth:true");

        string calendarInit = String.Format("$cmsj(function() {{$cmsj('#{0}').cmsdatepicker({{ {1} }})}});", datePickerObject.DateTimeTextBox.ClientID, GetScriptParameters(datePickerObject, settings));

        ScriptHelper.RegisterClientScriptBlock(Page, GetType(), ClientID + "_RegisterDatePickerFunction", ScriptHelper.GetScript(calendarInit));
    }
        public static DateTimePicker CreateDateTimePicker(IDateTimePickerHtmlBuilder renderer, ViewContext viewContext)
        {
            Mock<HttpContextBase> httpContext = TestHelper.CreateMockedHttpContext();

            httpContext.Setup(c => c.Request.Browser.CreateHtmlTextWriter(It.IsAny<TextWriter>())).Returns(new HtmlTextWriter(TextWriter.Null));

            Mock<IClientSideObjectWriterFactory> clientSideObjectWriterFactory = new Mock<IClientSideObjectWriterFactory>();
            clientSideObjectWriter = new Mock<IClientSideObjectWriter>();

            viewContext = viewContext ?? TestHelper.CreateViewContext();

            clientSideObjectWriterFactory.Setup(c => c.Create(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<TextWriter>())).Returns(clientSideObjectWriter.Object);

            DateTimePicker dateTimePicker = new DateTimePicker(viewContext, clientSideObjectWriterFactory.Object);

            renderer = renderer ?? new DateTimePickerHtmlBuilder(dateTimePicker);

            return dateTimePicker;
        }
Esempio n. 9
0
	public MainForm ()
	{
		// 
		// _components
		// 
		_components = new System.ComponentModel.Container ();
		// 
		// _menu
		// 
		_menu = new ContextMenuStrip (_components);
		_menu.Dock = DockStyle.Top;
		_menu.Size = new Size (170, 70);
		// 
		// _menuItem
		// 
		_menuItem = new ToolStripMenuItem ();
		_menuItem.Size = new Size (169, 22);
		_menuItem.Text = "Insert date...";
		_menu.Items.Add (_menuItem);
		// 
		// _dateTimePicker
		// 
		_dateTimePicker = new DateTimePicker ();
		_dateTimePicker.Value = DateTime.Now;
		_dateTimePicker.Format = DateTimePickerFormat.Custom;
		_dateTimePicker.CustomFormat = "yyyy-MM-dd";
		_menuItem.DropDownItems.Add (new ToolStripControlHost (_dateTimePicker));
		// 
		// MainForm
		// 
		ClientSize = new Size (285, 105);
		ContextMenuStrip = _menu;
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81508";
		Load += new EventHandler (MainForm_Load);
	}
 public DateTime? getDateTimePickerValue(DateTimePicker control)
 {
     #region Variable
     DateTime? result = null;
     #endregion
     if (control.InvokeRequired)
     {
         control.Invoke(new MethodInvoker(delegate
         {
             if (control.Checked)
             {
                 result = control.Value;
             }
         }));
     }
     else
     {
         if (control.Checked)
         {
             result = control.Value;
         }
     }
     return result;
 }
        private void cmdAddAlert_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var dtp = new DateTimePicker
                {
                    DateValue = DateTime.Now,
                    Format = DateBoxFormat.ShortDateAndShortTime,
                    VerticalAlignment = VerticalAlignment.Center,
                    Width = 200,
                    Margin = new Thickness(4)
                };
                grdAlerts.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });

                var st = new StackPanel { Orientation = Orientation.Horizontal };
                var check = new CheckBox
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Margin = new Thickness(4)
                };
                check.Checked += check_Checked;
                check.Unchecked += check_Unchecked;
                st.Children.Add(check);
                st.Children.Add(dtp);
                Grid.SetRow(st, grdAlerts.RowDefinitions.Count - 1);
                grdAlerts.Children.Add(st);
            }
            catch (Exception ex)
            {
                PNStatic.LogException(ex);
            }
        }
    /// <summary>
    /// Creates a field item
    /// </summary>
    /// <param name="ffi">Form field info</param>
    /// <param name="i">Field index</param>
    private void CreateField(FormFieldInfo ffi, ref int i)
    {
        // Check if is defined inherited default value
        bool doNotInherit = IsDefined(ffi.Name);
        // Get default value
        string inheritedDefaultValue = GetDefaultValue(ffi.Name);

        // Current hashtable for client id
        Hashtable currentHashTable = new Hashtable();

        // First item is name
        currentHashTable[0] = ffi.Name;
        currentHashTable[3] = ffi.Caption;

        // Begin new row and column
        Literal table2 = new Literal();
        pnlEditor.Controls.Add(table2);
        table2.Text = "<tr class=\"InheritWebPart\"><td>";

        // Property label
        Label lblName = new Label();
        pnlEditor.Controls.Add(lblName);
        lblName.Text = ResHelper.LocalizeString(ffi.Caption);
        lblName.ToolTip = ResHelper.LocalizeString(ffi.Description);
        if (!lblName.Text.EndsWithCSafe(":"))
        {
            lblName.Text += ":";
        }

        // New column
        Literal table3 = new Literal();
        pnlEditor.Controls.Add(table3);
        table3.Text = "</td><td>";

        // Type string for JavaScript function
        string jsType = "textbox";

        // Type switcher
        if (FormHelper.IsFieldOfType(ffi, FormFieldControlTypeEnum.CheckBoxControl))
        {
            // Checkbox type field
            CheckBox chk = new CheckBox();
            pnlEditor.Controls.Add(chk);
            chk.Checked = ValidationHelper.GetBoolean(ffi.DefaultValue, false);
            chk.InputAttributes.Add("disabled", "disabled");

            chk.Attributes.Add("id", chk.ClientID + "_upperSpan");

            if (doNotInherit)
            {
                chk.InputAttributes.Remove("disabled");
                chk.Enabled = true;
                chk.Checked = ValidationHelper.GetBoolean(inheritedDefaultValue, false);
            }

            jsType = "checkbox";
            currentHashTable[1] = chk.ClientID;
        }
        else if (FormHelper.IsFieldOfType(ffi, FormFieldControlTypeEnum.CalendarControl))
        {
            // Date time picker
            DateTimePicker dtPick = new DateTimePicker();
            pnlEditor.Controls.Add(dtPick);
            String value = ffi.DefaultValue;
            dtPick.Enabled = false;
            dtPick.SupportFolder = ResolveUrl("~/CMSAdminControls/Calendar");

            if (doNotInherit)
            {
                dtPick.Enabled = true;
                value = inheritedDefaultValue;
            }

            if (ValidationHelper.IsMacro(value))
            {
                dtPick.DateTimeTextBox.Text = value;
            }
            else
            {
                dtPick.SelectedDateTime = ValidationHelper.GetDateTime(value, DataHelper.DATETIME_NOT_SELECTED, CultureHelper.EnglishCulture);
            }

            jsType = "calendar";
            currentHashTable[1] = dtPick.ClientID;
        }
        else
        {
            // Other types represent by textbox
            CMSTextBox txt = new CMSTextBox();
            pnlEditor.Controls.Add(txt);

            // Convert from default culture to current culture if needed (type double, datetime)
            txt.Text = (String.IsNullOrEmpty(ffi.DefaultValue) || ValidationHelper.IsMacro(ffi.DefaultValue)) ? ffi.DefaultValue : ValidationHelper.GetString(DataHelper.ConvertValue(ffi.DefaultValue, GetDataType(ffi.Name)), String.Empty);

            txt.CssClass = "TextBoxField";
            txt.Enabled = ffi.Enabled;
            txt.Enabled = false;

            if (ffi.DataType == FormFieldDataTypeEnum.LongText)
            {
                txt.TextMode = TextBoxMode.MultiLine;
                txt.Rows = 3;
            }

            if (doNotInherit)
            {
                txt.Enabled = true;
                txt.Text = (String.IsNullOrEmpty(inheritedDefaultValue) || ValidationHelper.IsMacro(ffi.DefaultValue)) ? inheritedDefaultValue : ValidationHelper.GetString(DataHelper.ConvertValue(inheritedDefaultValue, GetDataType(ffi.Name)), String.Empty);
            }

            currentHashTable[1] = txt.ClientID;
        }

        // New column
        Literal table4 = new Literal();
        pnlEditor.Controls.Add(table4);
        table4.Text = "</td><td>" + ffi.DataType.ToString() + "</td><td>";

        // Inherit checkbox
        CheckBox chkInher = new CheckBox();
        pnlEditor.Controls.Add(chkInher);
        chkInher.Checked = true;

        // Uncheck checkbox if this property is not inherited
        if (doNotInherit)
        {
            chkInher.Checked = false;
        }

        chkInher.Text = GetString("DefaultValueEditor.Inherited");

        string defValue = (ffi.DefaultValue == null) ? String.Empty : ffi.DefaultValue;

        if (!String.IsNullOrEmpty(ffi.DefaultValue))
        {
            if (!ValidationHelper.IsMacro(ffi.DefaultValue))
            {
                defValue = ValidationHelper.GetString(DataHelper.ConvertValue(defValue, GetDataType(ffi.Name)), String.Empty);
            }
            else
            {
                defValue = MacroResolver.RemoveSecurityParameters(defValue, true, null);
            }
        }

        // Set default value for JavaScript function
        defValue = "'" + defValue.Replace("\r\n", "\\n") + "'";

        if (jsType == "checkbox")
        {
            defValue = ValidationHelper.GetBoolean(ffi.DefaultValue, false).ToString().ToLowerCSafe();
        }

        // Add JavaScript attribute with js function call
        chkInher.Attributes.Add("onclick", "CheckClick(this, '" + currentHashTable[1].ToString() + "', " + defValue + ", '" + jsType + "' );");

        // Insert current checkbox id
        currentHashTable[2] = chkInher.ClientID;

        // Add current hashtable to the controls hashtable
        ((Hashtable)Controls)[i] = currentHashTable;

        // End current row
        Literal table5 = new Literal();
        pnlEditor.Controls.Add(table5);
        table5.Text = "</td></tr>";

        i++;
    }
	// Constructors
	public DateTimePickerAccessibleObject(DateTimePicker owner) {}
Esempio n. 14
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(f404_GD_QUA_TRINH_CONG_TAC));
     this.ImageList          = new System.Windows.Forms.ImageList(this.components);
     this.m_pnl_out_place_dm = new System.Windows.Forms.Panel();
     this.m_lbl_phim_tat     = new System.Windows.Forms.Label();
     this.m_cmd_xuat_excel   = new SIS.Controls.Button.SiSButton();
     this.m_cmd_exit         = new SIS.Controls.Button.SiSButton();
     this.m_txt_tim_kiem     = new System.Windows.Forms.TextBox();
     this.m_ckb_chucvu       = new System.Windows.Forms.CheckBox();
     this.m_ckb_capbac       = new System.Windows.Forms.CheckBox();
     this.m_ckb_duan         = new System.Windows.Forms.CheckBox();
     this.label1             = new System.Windows.Forms.Label();
     this.m_cmd_search       = new SIS.Controls.Button.SiSButton();
     this.groupBox1          = new System.Windows.Forms.GroupBox();
     this.m_rdb_nhom         = new System.Windows.Forms.RadioButton();
     this.m_rdb_ko_nhom      = new System.Windows.Forms.RadioButton();
     this.m_ckb_congtac      = new System.Windows.Forms.CheckBox();
     this.label2             = new System.Windows.Forms.Label();
     this.m_dtp_den_ngay     = new System.Windows.Forms.DateTimePicker();
     this.m_lbl_thoidiem     = new System.Windows.Forms.Label();
     this.m_dtp_tu_ngay      = new System.Windows.Forms.DateTimePicker();
     this.panel1             = new System.Windows.Forms.Panel();
     this.m_fg = new C1.Win.C1FlexGrid.C1FlexGrid();
     this.m_pnl_out_place_dm.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.m_fg)).BeginInit();
     this.SuspendLayout();
     //
     // ImageList
     //
     this.ImageList.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ImageList.ImageStream")));
     this.ImageList.TransparentColor = System.Drawing.Color.Transparent;
     this.ImageList.Images.SetKeyName(0, "");
     this.ImageList.Images.SetKeyName(1, "");
     this.ImageList.Images.SetKeyName(2, "");
     this.ImageList.Images.SetKeyName(3, "");
     this.ImageList.Images.SetKeyName(4, "");
     this.ImageList.Images.SetKeyName(5, "");
     this.ImageList.Images.SetKeyName(6, "");
     this.ImageList.Images.SetKeyName(7, "");
     this.ImageList.Images.SetKeyName(8, "");
     this.ImageList.Images.SetKeyName(9, "");
     this.ImageList.Images.SetKeyName(10, "");
     this.ImageList.Images.SetKeyName(11, "");
     this.ImageList.Images.SetKeyName(12, "");
     this.ImageList.Images.SetKeyName(13, "");
     this.ImageList.Images.SetKeyName(14, "");
     this.ImageList.Images.SetKeyName(15, "");
     this.ImageList.Images.SetKeyName(16, "");
     this.ImageList.Images.SetKeyName(17, "");
     this.ImageList.Images.SetKeyName(18, "");
     this.ImageList.Images.SetKeyName(19, "");
     this.ImageList.Images.SetKeyName(20, "");
     this.ImageList.Images.SetKeyName(21, "");
     //
     // m_pnl_out_place_dm
     //
     this.m_pnl_out_place_dm.Controls.Add(this.m_lbl_phim_tat);
     this.m_pnl_out_place_dm.Controls.Add(this.m_cmd_xuat_excel);
     this.m_pnl_out_place_dm.Controls.Add(this.m_cmd_exit);
     this.m_pnl_out_place_dm.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.m_pnl_out_place_dm.Location = new System.Drawing.Point(0, 586);
     this.m_pnl_out_place_dm.Name     = "m_pnl_out_place_dm";
     this.m_pnl_out_place_dm.Padding  = new System.Windows.Forms.Padding(4);
     this.m_pnl_out_place_dm.Size     = new System.Drawing.Size(1268, 36);
     this.m_pnl_out_place_dm.TabIndex = 19;
     //
     // m_lbl_phim_tat
     //
     this.m_lbl_phim_tat.AutoSize = true;
     this.m_lbl_phim_tat.Location = new System.Drawing.Point(156, 12);
     this.m_lbl_phim_tat.Name     = "m_lbl_phim_tat";
     this.m_lbl_phim_tat.Size     = new System.Drawing.Size(206, 13);
     this.m_lbl_phim_tat.TabIndex = 1001;
     this.m_lbl_phim_tat.Text     = "Phím tắt: F6_Mở rộng-Thu gọn danh sách";
     //
     // m_cmd_xuat_excel
     //
     this.m_cmd_xuat_excel.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.m_cmd_xuat_excel.BtnShape            = SIS.Controls.Button.emunType.BtnShape.Rectangle;
     this.m_cmd_xuat_excel.BtnStyle            = SIS.Controls.Button.emunType.XPStyle.Default;
     this.m_cmd_xuat_excel.Dock       = System.Windows.Forms.DockStyle.Left;
     this.m_cmd_xuat_excel.Font       = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
     this.m_cmd_xuat_excel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.m_cmd_xuat_excel.ImageIndex = 19;
     this.m_cmd_xuat_excel.ImageList  = this.ImageList;
     this.m_cmd_xuat_excel.Location   = new System.Drawing.Point(4, 4);
     this.m_cmd_xuat_excel.Name       = "m_cmd_xuat_excel";
     this.m_cmd_xuat_excel.Size       = new System.Drawing.Size(93, 28);
     this.m_cmd_xuat_excel.TabIndex   = 6;
     this.m_cmd_xuat_excel.Text       = "Xuất Excel";
     this.m_cmd_xuat_excel.Click     += new System.EventHandler(this.m_cmd_xuat_excel_Click);
     //
     // m_cmd_exit
     //
     this.m_cmd_exit.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.m_cmd_exit.BtnShape            = SIS.Controls.Button.emunType.BtnShape.Rectangle;
     this.m_cmd_exit.BtnStyle            = SIS.Controls.Button.emunType.XPStyle.Default;
     this.m_cmd_exit.DialogResult        = System.Windows.Forms.DialogResult.Cancel;
     this.m_cmd_exit.Dock       = System.Windows.Forms.DockStyle.Right;
     this.m_cmd_exit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.m_cmd_exit.ImageIndex = 12;
     this.m_cmd_exit.ImageList  = this.ImageList;
     this.m_cmd_exit.Location   = new System.Drawing.Point(1176, 4);
     this.m_cmd_exit.Name       = "m_cmd_exit";
     this.m_cmd_exit.Size       = new System.Drawing.Size(88, 28);
     this.m_cmd_exit.TabIndex   = 7;
     this.m_cmd_exit.Text       = "Thoát (Esc)";
     //
     // m_txt_tim_kiem
     //
     this.m_txt_tim_kiem.AutoCompleteMode   = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
     this.m_txt_tim_kiem.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
     this.m_txt_tim_kiem.Location           = new System.Drawing.Point(218, 17);
     this.m_txt_tim_kiem.Name        = "m_txt_tim_kiem";
     this.m_txt_tim_kiem.Size        = new System.Drawing.Size(437, 20);
     this.m_txt_tim_kiem.TabIndex    = 1;
     this.m_txt_tim_kiem.MouseClick += new System.Windows.Forms.MouseEventHandler(this.m_txt_tim_kiem_MouseClick);
     this.m_txt_tim_kiem.KeyDown    += new System.Windows.Forms.KeyEventHandler(this.m_txt_tim_kiem_KeyDown);
     this.m_txt_tim_kiem.Leave      += new System.EventHandler(this.m_txt_tim_kiem_Leave);
     //
     // m_ckb_chucvu
     //
     this.m_ckb_chucvu.AutoSize   = true;
     this.m_ckb_chucvu.Checked    = true;
     this.m_ckb_chucvu.CheckState = System.Windows.Forms.CheckState.Checked;
     this.m_ckb_chucvu.Location   = new System.Drawing.Point(270, 43);
     this.m_ckb_chucvu.Name       = "m_ckb_chucvu";
     this.m_ckb_chucvu.Size       = new System.Drawing.Size(66, 17);
     this.m_ckb_chucvu.TabIndex   = 3;
     this.m_ckb_chucvu.Text       = "Chức vụ";
     this.m_ckb_chucvu.UseVisualStyleBackColor = true;
     this.m_ckb_chucvu.CheckedChanged         += new System.EventHandler(this.m_ckb_chucvu_CheckedChanged);
     //
     // m_ckb_capbac
     //
     this.m_ckb_capbac.AutoSize   = true;
     this.m_ckb_capbac.Checked    = true;
     this.m_ckb_capbac.CheckState = System.Windows.Forms.CheckState.Checked;
     this.m_ckb_capbac.Location   = new System.Drawing.Point(566, 44);
     this.m_ckb_capbac.Name       = "m_ckb_capbac";
     this.m_ckb_capbac.Size       = new System.Drawing.Size(66, 17);
     this.m_ckb_capbac.TabIndex   = 4;
     this.m_ckb_capbac.Text       = "Cấp bậc";
     this.m_ckb_capbac.UseVisualStyleBackColor = true;
     this.m_ckb_capbac.Visible         = false;
     this.m_ckb_capbac.CheckedChanged += new System.EventHandler(this.m_ckb_capbac_CheckedChanged);
     //
     // m_ckb_duan
     //
     this.m_ckb_duan.AutoSize   = true;
     this.m_ckb_duan.Checked    = true;
     this.m_ckb_duan.CheckState = System.Windows.Forms.CheckState.Checked;
     this.m_ckb_duan.Location   = new System.Drawing.Point(342, 43);
     this.m_ckb_duan.Name       = "m_ckb_duan";
     this.m_ckb_duan.Size       = new System.Drawing.Size(55, 17);
     this.m_ckb_duan.TabIndex   = 5;
     this.m_ckb_duan.Text       = "Dự án";
     this.m_ckb_duan.UseVisualStyleBackColor = true;
     this.m_ckb_duan.CheckedChanged         += new System.EventHandler(this.m_ckb_duan_CheckedChanged);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(218, 44);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(46, 13);
     this.label1.TabIndex = 38;
     this.label1.Text     = "Hiển thị:";
     //
     // m_cmd_search
     //
     this.m_cmd_search.AdjustImageLocation = new System.Drawing.Point(0, 0);
     this.m_cmd_search.BtnShape            = SIS.Controls.Button.emunType.BtnShape.Rectangle;
     this.m_cmd_search.BtnStyle            = SIS.Controls.Button.emunType.XPStyle.Default;
     this.m_cmd_search.ImageAlign          = System.Drawing.ContentAlignment.MiddleLeft;
     this.m_cmd_search.ImageIndex          = 5;
     this.m_cmd_search.ImageList           = this.ImageList;
     this.m_cmd_search.Location            = new System.Drawing.Point(661, 12);
     this.m_cmd_search.Name     = "m_cmd_search";
     this.m_cmd_search.Size     = new System.Drawing.Size(88, 28);
     this.m_cmd_search.TabIndex = 2;
     this.m_cmd_search.Text     = "Tìm kiếm";
     this.m_cmd_search.Click   += new System.EventHandler(this.m_cmd_search_Click);
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.m_rdb_nhom);
     this.groupBox1.Controls.Add(this.m_rdb_ko_nhom);
     this.groupBox1.Location = new System.Drawing.Point(24, 12);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(188, 65);
     this.groupBox1.TabIndex = 40;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Hiển thị:";
     //
     // m_rdb_nhom
     //
     this.m_rdb_nhom.AutoSize = true;
     this.m_rdb_nhom.Location = new System.Drawing.Point(21, 44);
     this.m_rdb_nhom.Name     = "m_rdb_nhom";
     this.m_rdb_nhom.Size     = new System.Drawing.Size(144, 17);
     this.m_rdb_nhom.TabIndex = 1;
     this.m_rdb_nhom.Text     = "Nhóm theo mã nhân viên";
     this.m_rdb_nhom.UseVisualStyleBackColor = true;
     this.m_rdb_nhom.CheckedChanged         += new System.EventHandler(this.m_rdb_nhom_CheckedChanged);
     //
     // m_rdb_ko_nhom
     //
     this.m_rdb_ko_nhom.AutoSize = true;
     this.m_rdb_ko_nhom.Checked  = true;
     this.m_rdb_ko_nhom.Location = new System.Drawing.Point(21, 20);
     this.m_rdb_ko_nhom.Name     = "m_rdb_ko_nhom";
     this.m_rdb_ko_nhom.Size     = new System.Drawing.Size(85, 17);
     this.m_rdb_ko_nhom.TabIndex = 0;
     this.m_rdb_ko_nhom.TabStop  = true;
     this.m_rdb_ko_nhom.Text     = "Không nhóm";
     this.m_rdb_ko_nhom.UseVisualStyleBackColor = true;
     //
     // m_ckb_congtac
     //
     this.m_ckb_congtac.AutoSize   = true;
     this.m_ckb_congtac.Checked    = true;
     this.m_ckb_congtac.CheckState = System.Windows.Forms.CheckState.Checked;
     this.m_ckb_congtac.Location   = new System.Drawing.Point(403, 43);
     this.m_ckb_congtac.Name       = "m_ckb_congtac";
     this.m_ckb_congtac.Size       = new System.Drawing.Size(69, 17);
     this.m_ckb_congtac.TabIndex   = 41;
     this.m_ckb_congtac.Text       = "Công tác";
     this.m_ckb_congtac.UseVisualStyleBackColor = true;
     this.m_ckb_congtac.CheckedChanged         += new System.EventHandler(this.m_ckb_congtac_CheckedChanged);
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(775, 43);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(56, 13);
     this.label2.TabIndex = 45;
     this.label2.Text     = "Đến ngày:";
     //
     // m_dtp_den_ngay
     //
     this.m_dtp_den_ngay.CustomFormat  = "dd/MM/yyyy";
     this.m_dtp_den_ngay.Format        = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.m_dtp_den_ngay.Location      = new System.Drawing.Point(837, 38);
     this.m_dtp_den_ngay.Name          = "m_dtp_den_ngay";
     this.m_dtp_den_ngay.Size          = new System.Drawing.Size(126, 20);
     this.m_dtp_den_ngay.TabIndex      = 44;
     this.m_dtp_den_ngay.ValueChanged += new System.EventHandler(this.m_dtp_den_ngay_ValueChanged);
     //
     // m_lbl_thoidiem
     //
     this.m_lbl_thoidiem.AutoSize = true;
     this.m_lbl_thoidiem.Location = new System.Drawing.Point(782, 17);
     this.m_lbl_thoidiem.Name     = "m_lbl_thoidiem";
     this.m_lbl_thoidiem.Size     = new System.Drawing.Size(49, 13);
     this.m_lbl_thoidiem.TabIndex = 43;
     this.m_lbl_thoidiem.Text     = "Từ ngày:";
     //
     // m_dtp_tu_ngay
     //
     this.m_dtp_tu_ngay.CustomFormat  = "dd/MM/yyyy";
     this.m_dtp_tu_ngay.Format        = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.m_dtp_tu_ngay.Location      = new System.Drawing.Point(837, 12);
     this.m_dtp_tu_ngay.Name          = "m_dtp_tu_ngay";
     this.m_dtp_tu_ngay.Size          = new System.Drawing.Size(126, 20);
     this.m_dtp_tu_ngay.TabIndex      = 42;
     this.m_dtp_tu_ngay.Value         = new System.DateTime(2009, 1, 1, 17, 21, 0, 0);
     this.m_dtp_tu_ngay.ValueChanged += new System.EventHandler(this.m_dtp_tu_ngay_ValueChanged);
     //
     // panel1
     //
     this.panel1.Controls.Add(this.m_cmd_search);
     this.panel1.Controls.Add(this.label2);
     this.panel1.Controls.Add(this.m_txt_tim_kiem);
     this.panel1.Controls.Add(this.m_dtp_den_ngay);
     this.panel1.Controls.Add(this.m_ckb_chucvu);
     this.panel1.Controls.Add(this.m_lbl_thoidiem);
     this.panel1.Controls.Add(this.m_ckb_capbac);
     this.panel1.Controls.Add(this.m_dtp_tu_ngay);
     this.panel1.Controls.Add(this.m_ckb_duan);
     this.panel1.Controls.Add(this.m_ckb_congtac);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.groupBox1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(1268, 83);
     this.panel1.TabIndex = 46;
     //
     // m_fg
     //
     this.m_fg.ColumnInfo = resources.GetString("m_fg.ColumnInfo");
     this.m_fg.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.m_fg.Location   = new System.Drawing.Point(0, 83);
     this.m_fg.Name       = "m_fg";
     this.m_fg.Size       = new System.Drawing.Size(1268, 503);
     this.m_fg.Styles     = new C1.Win.C1FlexGrid.CellStyleCollection(resources.GetString("m_fg.Styles"));
     this.m_fg.TabIndex   = 47;
     //
     // f404_GD_QUA_TRINH_CONG_TAC
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.CancelButton      = this.m_cmd_exit;
     this.ClientSize        = new System.Drawing.Size(1268, 622);
     this.Controls.Add(this.m_fg);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.m_pnl_out_place_dm);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Name            = "f404_GD_QUA_TRINH_CONG_TAC";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "F404 - Báo cáo quá trình công tác";
     this.Load           += new System.EventHandler(this.f404_GD_QUA_TRINH_CONG_TAC_Load);
     this.m_pnl_out_place_dm.ResumeLayout(false);
     this.m_pnl_out_place_dm.PerformLayout();
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.m_fg)).EndInit();
     this.ResumeLayout(false);
 }
        /// <summary>
        /// Displays all current publishing schedules ordered by date and time
        /// </summary>
        private void RenderAllSchedules()
        {
            StringBuilder sbHeader = new StringBuilder();
            sbHeader.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\">");
            sbHeader.Append("<col />");
            sbHeader.Append("<col />");
            sbHeader.Append("<col />");
            sbHeader.Append("<col />");
            sbHeader.Append("<tr style=\"background:#e9e9e9\">");
            sbHeader.Append("<td nowrap=\"nowrap\"><b>" + "Item" + "</b></td>");
            sbHeader.Append("<td nowrap=\"nowrap\"><b>" + "Action" + "</b></td>");
            sbHeader.Append("<td nowrap=\"nowrap\"><b>" + "Date" + "</b></td>");
            sbHeader.Append("<td nowrap=\"nowrap\"><b>" + "Delete" + "</b></td>");
            sbHeader.Append("</tr>");
            AllSchedules.Controls.Add(new LiteralControl(sbHeader.ToString()));

            IEnumerable<PublishSchedule> allSchedules = _scheduledPublishRepo.AllUnpublishedSchedules;
            foreach (var schedule in allSchedules)
            {
                if (schedule.InnerItem != null)
                {
                    StringBuilder sbItem = new StringBuilder();
                    // Item name and path
                    sbItem.Append("<tr style='background:#cedff2;border-bottom:1px solid #F0F1F2;'>");
                    Item scheduledItem = schedule.ItemToPublish;
                    sbItem.Append("<td><b>" + scheduledItem.DisplayName + "</b><br />" + scheduledItem.Paths.FullPath + "</td>");

                    // Is publishing/unpublishing
                    sbItem.Append("<td style='border-left:1px solid #F0F1F2;'>");
                    string isUnpublishing = schedule.Unpublish ? "Unpublish" : "Publish";
                    sbItem.Append(isUnpublishing);
                    sbItem.Append("</td><td style='border-left:1px solid #F0F1F2;'>");

                    // Current scheudled publish date and time
                    AllSchedules.Controls.Add(new LiteralControl(sbItem.ToString()));
                    DateTime pbDate = schedule.PublishDate;
                    AllSchedules.Controls.Add(new LiteralControl(pbDate.ToString(_culture)));

                    // Pick new date and time
                    DateTimePicker dtPicker = new DateTimePicker();
                    dtPicker.ID = "dt_" + schedule.InnerItem.ID;
                    dtPicker.Width = new Unit(100.0, UnitType.Percentage);
                    dtPicker.Value = DateUtil.ToIsoDate(schedule.PublishDate);
                    AllSchedules.Controls.Add(dtPicker);
                    AllSchedules.Controls.Add(new LiteralControl("</td>"));

                    // Delete schedule
                    AllSchedules.Controls.Add(new LiteralControl("<td style='border-left:1px solid #F0F1F2;'>"));
                    Checkbox deleteCheckbox = new Checkbox();
                    deleteCheckbox.ID = "del_" + schedule.InnerItem.ID;
                    AllSchedules.Controls.Add(deleteCheckbox);

                    AllSchedules.Controls.Add(new LiteralControl("</td></tr>"));
                }
            }

            AllSchedules.Controls.Add(new LiteralControl("</table"));
        }
 public void datetimepicker_correctly_formats_utc_date_value()
 {
     var value = new DateTime(2000, 2, 2, 14, 5, 24, 331, DateTimeKind.Utc);
     var element = new DateTimePicker("test").Value(value);
     element.ValueAttributeShouldEqual("2000-02-02T14:05:24.331Z");
 }
Esempio n. 17
0
        public void insertaVenta(TextBox id_ven, Label subtot, Label total, Label id_vende, Label id_clien, DateTimePicker dat)
        {
            string       fech = dat.Value.Year.ToString() + "-" + dat.Value.Month.ToString() + "-" + dat.Value.Day.ToString();
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();

            String query = "INSERT INTO `eliarome35436DB`.`Venta` (`id_venta`, `subtotal`, `total`, `id_Vendedor`, `Id_Cliente`, `fecha`) VALUES ('" + id_ven.Text + "','" + subtot.Text + "','" + total.Text + "','" + id_vende.Text + "','" + id_clien.Text + "','" + fech + "')";

            Coman = inserta.construye_command(query);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }
        public void HienThiLamviec(TextBoxX txtMalav, TextBoxX ten, ComboBoxEx cmbNV, ComboBoxEx cmbCV, DateTimePicker dteNgayBD, DateTimePicker dteNgayKT, TextBoxX txtNoilam, TextBoxX txtGhichu, string manv, DataGridViewX dtg, BindingNavigator bn)
        {
            BindingSource bs = new BindingSource();

            bs.DataSource    = lamviec.LayQuatrinhlamviec(manv);
            dtg.DataSource   = bs;
            bn.BindingSource = bs;

            txtMalav.DataBindings.Clear();
            txtMalav.DataBindings.Add("Text", bs, "maquatrinh");

            ten.DataBindings.Clear();
            ten.DataBindings.Add("Text", bs, "tenquatrinh");

            cmbCV.DataBindings.Clear();
            cmbCV.DataBindings.Add("SelectedValue", bs, "macongviec");

            cmbNV.DataBindings.Clear();
            cmbNV.DataBindings.Add("SelectedValue", bs, "manv");

            dteNgayBD.DataBindings.Clear();
            dteNgayBD.DataBindings.Add("Text", bs, "ngaybatdau");

            dteNgayKT.DataBindings.Clear();
            dteNgayKT.DataBindings.Add("Text", bs, "ngayketthuc");

            txtNoilam.DataBindings.Clear();
            txtNoilam.DataBindings.Add("Text", bs, "noilamviec");

            txtGhichu.DataBindings.Clear();
            txtGhichu.DataBindings.Add("Text", bs, "ghichu");
        }
Esempio n. 19
0
        private void InitializeComponent()
        {
            labelAircraft                   = new Label();
            labelComponent                  = new Label();
            labelWorkType                   = new Label();
            labelDate                       = new Label();
            labelAircraftTSNCSN             = new Label();
            labelHours                      = new Label();
            labelCycles                     = new Label();
            labelRemarks                    = new Label();
            labelMaintenanceOrganization    = new Label();
            labelReference                  = new Label();
            textBoxAircraft                 = new TextBox();
            textBoxComponent                = new TextBox();
            comboBoxWorkType                = new ComboBox();
            dateTimePickerDate              = new DateTimePicker();
            textBoxHours                    = new TextBox();
            textBoxCycles                   = new TextBox();
            textBoxRemarks                  = new TextBox();
            textBoxMaintenanceOrganization  = new TextBox();
            textBoxReference                = new TextBox();
            checkBoxOfficialRecordsReceived = new CheckBox();
            fileControl                     = new WindowsFormAttachedFileControl(currentRecord.AttachedFile, "Adobe PDF Files|*.pdf",
                                                                                 "This record does not contain a file proving the compliance. Enclose PDF file to prove the compliance.",
                                                                                 "Attached file proves the compliance.", icons.PDFSmall);
            buttonOK              = new Button();
            buttonApply           = new Button();
            buttonCancel          = new Button();
            tabControl            = new TabControl();
            tabPageGeneral        = new TabPage();
            labelSeparator        = new Label();
            labelSeparator2       = new Label();
            labelSeparator3       = new Label();
            hashTextRecordType    = new Dictionary <string, RecordType>();
            recordTypesCollection = RecordTypesCollection.Instance;
            //
            // tabControl
            //
            tabControl.Controls.Add(tabPageGeneral);
            tabControl.Location = new Point(Css.WindowsForm.Constants.LEFT_MARGIN, Css.WindowsForm.Constants.TOP_MARGIN);
            //
            // labelAircraft
            //
            labelAircraft.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelAircraft.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelAircraft.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, Css.WindowsForm.Constants.TAB_TOP_MARGIN);
            labelAircraft.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelAircraft.Text      = "Aircraft:";
            labelAircraft.TextAlign = ContentAlignment.MiddleLeft;
            //
            // textBoxAircraft
            //
            textBoxAircraft.Font      = Css.WindowsForm.Fonts.RegularFont;
            textBoxAircraft.ForeColor = Css.WindowsForm.Colors.ForeColor;
            textBoxAircraft.Location  = new Point(labelAircraft.Right, Css.WindowsForm.Constants.TAB_TOP_MARGIN);
            textBoxAircraft.ReadOnly  = true;
            //
            // labelComponent
            //
            labelComponent.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelComponent.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelComponent.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelAircraft.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            labelComponent.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelComponent.Text      = "Component:";
            labelComponent.TextAlign = ContentAlignment.MiddleLeft;
            //
            // textBoxComponent
            //
            textBoxComponent.Font      = Css.WindowsForm.Fonts.RegularFont;
            textBoxComponent.ForeColor = Css.WindowsForm.Colors.ForeColor;
            textBoxComponent.Location  = new Point(labelComponent.Right, labelAircraft.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            textBoxComponent.ReadOnly  = true;
            //
            // labelSeparator
            //
            labelSeparator.AutoSize    = false;
            labelSeparator.Location    = new Point(Css.WindowsForm.Constants.TAB_SEPARATOR_LEFT_MARGIN, labelComponent.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            labelSeparator.Height      = 2;
            labelSeparator.BorderStyle = BorderStyle.Fixed3D;
            //
            // labelWorkType
            //
            labelWorkType.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelWorkType.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelWorkType.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelSeparator.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            labelWorkType.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelWorkType.Text      = "Work Type:";
            labelWorkType.TextAlign = ContentAlignment.MiddleLeft;
            //
            // comboBoxWorkType
            //
            comboBoxWorkType.BackColor = Color.White;
            comboBoxWorkType.Font      = Css.WindowsForm.Fonts.RegularFont;
            comboBoxWorkType.ForeColor = Css.WindowsForm.Colors.ForeColor;
            comboBoxWorkType.Location  = new Point(labelWorkType.Right, labelSeparator.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            if (mode == ScreenMode.Edit)
            {
                comboBoxWorkType.Enabled = false;
            }
            //
            // labelDate
            //
            labelDate.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelDate.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelDate.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelWorkType.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            labelDate.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelDate.Text      = "Date:";
            labelDate.TextAlign = ContentAlignment.MiddleLeft;
            //
            // dateTimePickerDate
            //
            dateTimePickerDate.Font          = Css.WindowsForm.Fonts.RegularFont;
            dateTimePickerDate.ForeColor     = Css.WindowsForm.Colors.ForeColor;
            dateTimePickerDate.BackColor     = Color.White;
            dateTimePickerDate.Location      = new Point(labelDate.Right, labelWorkType.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            dateTimePickerDate.Format        = DateTimePickerFormat.Custom;
            dateTimePickerDate.CustomFormat  = new TermsProvider()["DateFormat"].ToString();
            dateTimePickerDate.ValueChanged += dateTimePickerDate_ValueChanged;
            //
            // labelAircraftTSNCSN
            //
            labelAircraftTSNCSN.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelAircraftTSNCSN.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelAircraftTSNCSN.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelAircraftTSNCSN.Text      = "TSN/CSN";
            labelAircraftTSNCSN.TextAlign = ContentAlignment.MiddleLeft;
            labelAircraftTSNCSN.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // labelHours
            //
            labelHours.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelHours.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelHours.Size      = new Size(Css.WindowsForm.Constants.LABEL_SHORT_WITH, Css.WindowsForm.Constants.DefaultLabelSize.Height);
            labelHours.Text      = "Hours:";
            labelHours.TextAlign = ContentAlignment.MiddleLeft;
            labelHours.Location  = new Point(labelAircraftTSNCSN.Right, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // textBoxHours
            //
            textBoxHours.Font         = Css.WindowsForm.Fonts.RegularFont;
            textBoxHours.ForeColor    = Css.WindowsForm.Colors.ForeColor;
            textBoxHours.BackColor    = Color.White;
            textBoxHours.Location     = new Point(labelHours.Right, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            textBoxHours.Width        = Css.WindowsForm.Constants.TEXT_BOX_SHORT_WITH;
            textBoxHours.TextChanged += ActualState_TextChanged;
            //
            // labelCycles
            //
            labelCycles.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelCycles.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelCycles.Size      = new Size(Css.WindowsForm.Constants.LABEL_SHORT_WITH, Css.WindowsForm.Constants.DefaultLabelSize.Height);
            labelCycles.Text      = "Cycles:";
            labelCycles.TextAlign = ContentAlignment.MiddleLeft;
            labelCycles.Location  = new Point(textBoxHours.Right + Css.WindowsForm.Constants.LABEL_MARGIN * 2, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // textBoxCycles
            //
            textBoxCycles.Font         = Css.WindowsForm.Fonts.RegularFont;
            textBoxCycles.ForeColor    = Css.WindowsForm.Colors.ForeColor;
            textBoxCycles.BackColor    = Color.White;
            textBoxCycles.Location     = new Point(labelCycles.Right, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            textBoxCycles.Width        = Css.WindowsForm.Constants.TEXT_BOX_SHORT_WITH;
            textBoxCycles.TextChanged += ActualState_TextChanged;
            //
            // labelRemarks
            //
            labelRemarks.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelRemarks.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelRemarks.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelRemarks.Text      = "Remarks:";
            labelRemarks.TextAlign = ContentAlignment.MiddleLeft;
            labelRemarks.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, textBoxHours.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // textBoxRemarks
            //
            textBoxRemarks.Font      = Css.WindowsForm.Fonts.RegularFont;
            textBoxRemarks.ForeColor = Css.WindowsForm.Colors.ForeColor;
            textBoxRemarks.BackColor = Color.White;
            textBoxRemarks.Multiline = true;
            textBoxRemarks.Height    = Css.WindowsForm.Constants.BIG_TEXT_BOX_HEIGHT;
            textBoxRemarks.Location  = new Point(labelRemarks.Right, textBoxHours.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // labelSeparator2
            //
            labelSeparator2.AutoSize    = false;
            labelSeparator2.Height      = 2;
            labelSeparator2.BorderStyle = BorderStyle.Fixed3D;
            labelSeparator2.Location    = new Point(Css.WindowsForm.Constants.TAB_SEPARATOR_LEFT_MARGIN, textBoxRemarks.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            //
            // labelMaintenanceOrganization
            //
            labelMaintenanceOrganization.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelMaintenanceOrganization.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelMaintenanceOrganization.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelMaintenanceOrganization.Text      = "MO:";
            labelMaintenanceOrganization.TextAlign = ContentAlignment.MiddleLeft;
            labelMaintenanceOrganization.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelSeparator2.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            //
            // textBoxMaintenanceOrganization
            //
            textBoxMaintenanceOrganization.Font      = Css.WindowsForm.Fonts.RegularFont;
            textBoxMaintenanceOrganization.ForeColor = Css.WindowsForm.Colors.ForeColor;
            textBoxMaintenanceOrganization.BackColor = Color.White;
            textBoxMaintenanceOrganization.Location  = new Point(labelMaintenanceOrganization.Right, labelSeparator2.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            //
            // labelReference
            //
            labelReference.Font      = Css.WindowsForm.Fonts.RegularFont;
            labelReference.ForeColor = Css.WindowsForm.Colors.ForeColor;
            labelReference.Size      = Css.WindowsForm.Constants.DefaultLabelSize;
            labelReference.Text      = "Reference:";
            labelReference.TextAlign = ContentAlignment.MiddleLeft;
            labelReference.Location  = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, textBoxMaintenanceOrganization.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // textBoxReference
            //
            textBoxReference.Font      = Css.WindowsForm.Fonts.RegularFont;
            textBoxReference.ForeColor = Css.WindowsForm.Colors.ForeColor;
            textBoxReference.BackColor = Color.White;
            textBoxReference.Location  = new Point(labelMaintenanceOrganization.Right, textBoxMaintenanceOrganization.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // checkBoxOfficialRecordsReceived
            //
            checkBoxOfficialRecordsReceived.Font      = Css.WindowsForm.Fonts.RegularFont;
            checkBoxOfficialRecordsReceived.ForeColor = Css.WindowsForm.Colors.ForeColor;
            checkBoxOfficialRecordsReceived.TextAlign = ContentAlignment.MiddleLeft;
            checkBoxOfficialRecordsReceived.Text      = "Official Records Received:";
            checkBoxOfficialRecordsReceived.Location  = new Point(labelReference.Right, textBoxReference.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL);
            //
            // labelSeparator3
            //
            labelSeparator3.AutoSize    = false;
            labelSeparator3.Height      = 2;
            labelSeparator3.BorderStyle = BorderStyle.Fixed3D;
            labelSeparator3.Location    = new Point(Css.WindowsForm.Constants.TAB_SEPARATOR_LEFT_MARGIN, checkBoxOfficialRecordsReceived.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            //
            // fileControl
            //
            fileControl.Location = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelSeparator3.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL);
            //
            // buttonOK
            //
            buttonOK.Font      = Css.WindowsForm.Fonts.RegularFont;
            buttonOK.ForeColor = Css.WindowsForm.Colors.ForeColor;
            buttonOK.Size      = new Size(Css.WindowsForm.Constants.BUTTON_WIDTH, Css.WindowsForm.Constants.BUTTON_HEIGHT);
            buttonOK.Text      = "OK";
            buttonOK.Click    += buttonOK_Click;
            //
            // buttonApply
            //
            buttonApply.Font      = Css.WindowsForm.Fonts.RegularFont;
            buttonApply.ForeColor = Css.WindowsForm.Colors.ForeColor;
            buttonApply.Size      = new Size(Css.WindowsForm.Constants.BUTTON_WIDTH, Css.WindowsForm.Constants.BUTTON_HEIGHT);
            buttonApply.Text      = "Apply";
            buttonApply.Click    += buttonApply_Click;
            //
            // buttonCancel
            //
            buttonCancel.Font      = Css.WindowsForm.Fonts.RegularFont;
            buttonCancel.ForeColor = Css.WindowsForm.Colors.ForeColor;
            buttonCancel.Size      = new Size(Css.WindowsForm.Constants.BUTTON_WIDTH, Css.WindowsForm.Constants.BUTTON_HEIGHT);
            buttonCancel.Text      = "Cancel";
            buttonCancel.Click    += buttonCancel_Click;
            //
            // tabPageGeneral
            //
            tabPageGeneral.BackColor = Css.WindowsForm.Colors.TabBackColor;
            tabPageGeneral.Text      = "General";
            tabPageGeneral.Controls.Add(labelAircraft);
            tabPageGeneral.Controls.Add(textBoxAircraft);
            tabPageGeneral.Controls.Add(labelComponent);
            tabPageGeneral.Controls.Add(textBoxComponent);
            tabPageGeneral.Controls.Add(labelSeparator);
            tabPageGeneral.Controls.Add(labelWorkType);
            tabPageGeneral.Controls.Add(comboBoxWorkType);
            tabPageGeneral.Controls.Add(labelDate);
            tabPageGeneral.Controls.Add(dateTimePickerDate);
            tabPageGeneral.Controls.Add(labelAircraftTSNCSN);
            tabPageGeneral.Controls.Add(labelHours);
            tabPageGeneral.Controls.Add(textBoxHours);
            tabPageGeneral.Controls.Add(labelCycles);
            tabPageGeneral.Controls.Add(textBoxCycles);
            tabPageGeneral.Controls.Add(labelRemarks);
            tabPageGeneral.Controls.Add(textBoxRemarks);
            tabPageGeneral.Controls.Add(labelSeparator2);
            tabPageGeneral.Controls.Add(labelMaintenanceOrganization);
            tabPageGeneral.Controls.Add(textBoxMaintenanceOrganization);
            tabPageGeneral.Controls.Add(labelReference);
            tabPageGeneral.Controls.Add(textBoxReference);
            tabPageGeneral.Controls.Add(checkBoxOfficialRecordsReceived);
            tabPageGeneral.Controls.Add(labelSeparator3);
            tabPageGeneral.Controls.Add(fileControl);

            string complianceText = ". Compliance";

            if (currentDetail != null)
            {
                Text = "SN " + currentDetail.SerialNumber + complianceText;
                if (!currentDetail.InUse)
                {
                    labelAircraft.Text = "Store:";
                }
            }
            else
            {
                Text = currentDirective.Title + complianceText;
            }
            AcceptButton    = buttonOK;
            CancelButton    = buttonCancel;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ClientSize      = Css.WindowsForm.Constants.DefaultFormSize;
            StartPosition   = FormStartPosition.CenterScreen;
            Controls.Add(tabControl);
            Controls.Add(buttonOK);
            Controls.Add(buttonApply);
            Controls.Add(buttonCancel);
        }
        internal static void SearchPolicy(DataGridView dataGridView1, DateTimePicker dtpDateFrom, DateTimePicker dtpDateTO)
        {
            policy       = new InsurancePolicy();
            policy.USLOV = " Cast(DateFrom as date) > cast( '" + dtpDateFrom.Value.ToString("yyyy-MM-dd") + "' as date ) and  Cast(DateFrom as date) < cast( '" + dtpDateTO.Value.ToString("yyyy-MM-dd") + "' as date ) and  Cast(ExpitarionDate as date) > cast( '" + dtpDateFrom.Value.ToString("yyyy-MM-dd") + "' as date ) and  Cast(ExpitarionDate as date) < cast( '" + dtpDateTO.Value.ToString("yyyy-MM-dd") + "' as date )";

            dataGridView1.DataSource = komunikacija.SearchPolicy(policy);
            //MessageBox.Show("System successfully find policies.");
        }
Esempio n. 21
0
 private void setDefaultDatePicker(DateTimePicker dateTimePicker, Projekt projekt)
 {
     dateTimePicker.Enabled = true;
     dateTimePicker.Value   = (DateTime)projekt.startdatumEffektiv;
 }
Esempio n. 22
0
            /// <summary>
            /// Инициализация, размещения собственных элементов управления
            /// </summary>
            private void initializeComponent()
            {
                Control        ctrl = null;
                SplitContainer stctrSignals;

                //Приостановить прорисовку текущей панели
                // ??? корректней приостановить прорисовку после создания всех дочерних элементов
                // ??? при этом потребуется объявить переменные для каждого из элементов управления
                this.SuspendLayout();

                //Создать дочерние элементы управления
                // календарь для установки текущих даты, номера часа
                ctrl      = new DateTimePicker();
                ctrl.Name = KEY_CONTROLS.DTP_CUR_DATE.ToString();
                ctrl.Dock = DockStyle.Fill;
                (ctrl as DateTimePicker).DropDownAlign = LeftRightAlignment.Right;
                (ctrl as DateTimePicker).Format        = DateTimePickerFormat.Custom;
                (ctrl as DateTimePicker).CustomFormat  = "dd MMM, yyyy";
                (ctrl as DateTimePicker).Value         = DateTime.Now.Date.AddDays(-1);
                //Добавить к текущей панели календарь
                this.Controls.Add(ctrl, 0, 0);
                this.SetColumnSpan(ctrl, 3);
                this.SetRowSpan(ctrl, 1);
                // Обработчики событий
                (ctrl as DateTimePicker).ValueChanged += new EventHandler(curDatetime_OnValueChanged);

                // список для выбора ТЭЦ
                ctrl      = new ComboBox();
                ctrl.Name = KEY_CONTROLS.CBX_TEC_LIST.ToString();
                ctrl.Dock = DockStyle.Fill;
                (ctrl as ComboBox).DropDownStyle = ComboBoxStyle.DropDownList;
                //Добавить к текущей панели список выбра ТЭЦ
                this.Controls.Add(ctrl, 3, 0);
                this.SetColumnSpan(ctrl, 3);
                this.SetRowSpan(ctrl, 1);
                // Обработчики событий
                (ctrl as ComboBox).SelectedIndexChanged += new EventHandler(cbxTECList_OnSelectionIndexChanged);

                // список для часовых поясов
                ctrl      = new ComboBox();
                ctrl.Name = KEY_CONTROLS.CBX_TIMEZONE.ToString();
                ctrl.Dock = DockStyle.Fill;
                (ctrl as ComboBox).DropDownStyle = ComboBoxStyle.DropDownList;
                ctrl.Enabled = false;
                //Добавить к текущей панели список для часовых поясов
                this.Controls.Add(ctrl, 0, 1);
                this.SetColumnSpan(ctrl, 3);
                this.SetRowSpan(ctrl, 1);
                //// Обработчики событий
                (ctrl as ComboBox).SelectedIndexChanged += new EventHandler(cbxTimezone_OnSelectedIndexChanged);

                // кнопка для инициирования экспорта
                ctrl      = new Button();
                ctrl.Name = KEY_CONTROLS.BTN_EXPORT.ToString();
                ctrl.Dock = DockStyle.Fill;
                ctrl.Text = @"Экспорт";
                //Добавить к текущей панели кнопку "Экспорт"
                this.Controls.Add(ctrl, 3, 1);
                this.SetColumnSpan(ctrl, 3);
                this.SetRowSpan(ctrl, 1);
                // Обработчики событий
                (ctrl as Button).Click += new EventHandler(btnExport_OnClick);

                // панель для управления размером списков с сигналами
                stctrSignals             = new SplitContainer();
                stctrSignals.Dock        = DockStyle.Fill;
                stctrSignals.Orientation = Orientation.Horizontal;
                //stctrSignals.Panel1MinSize = -1;
                //stctrSignals.Panel2MinSize = -1;
                stctrSignals.SplitterDistance = 46;
                //Добавить сплитер на панель управления
                this.Controls.Add(stctrSignals, 0, 2);
                this.SetColumnSpan(stctrSignals, 6);
                this.SetRowSpan(stctrSignals, 22);

                // список сигналов АИИСКУЭ
                ctrl           = new CheckedListBox();
                ctrl.Name      = KEY_CONTROLS.CLB_AIISKUE_SIGNAL.ToString();
                ctrl.Dock      = DockStyle.Fill;
                ctrl.BackColor = BackColor == SystemColors.Control ? SystemColors.Window : BackColor;
                ctrl.ForeColor = ForeColor;
                ////Добавить к текущей панели список сигналов АИИСКУЭ
                //this.Controls.Add(ctrl, 0, 2);
                //this.SetColumnSpan(ctrl, 6);
                //this.SetRowSpan(ctrl, 10);
                //Добавить с сплиттеру
                stctrSignals.Panel1.Controls.Add(ctrl);
                // Обработчики событий
                (ctrl as CheckedListBox).SelectedIndexChanged += new EventHandler(clbAIISKUESignal_OnSelectedIndexChanged);
                (ctrl as CheckedListBox).ItemCheck            += new ItemCheckEventHandler(clbAIISKUESignal_OnItemChecked);

                // список сигналов СОТИАССО
                ctrl           = new CheckedListBox();
                ctrl.Name      = KEY_CONTROLS.CLB_SOTIASSO_SIGNAL.ToString();
                ctrl.Dock      = DockStyle.Fill;
                ctrl.BackColor = BackColor == SystemColors.Control ? SystemColors.Window : BackColor;
                ctrl.ForeColor = ForeColor;
                ////Добавить к текущей панели список сигналов СОТИАССО
                //this.Controls.Add(ctrl, 0, 12);
                //this.SetColumnSpan(ctrl, 6);
                //this.SetRowSpan(ctrl, 12);
                //Добавить с сплиттеру
                stctrSignals.Panel2.Controls.Add(ctrl);
                // Обработчики событий
                (ctrl as CheckedListBox).SelectedIndexChanged += new EventHandler(clbSOTIASSOSignal_OnSelectedIndexChanged);
                (ctrl as CheckedListBox).ItemCheck            += new ItemCheckEventHandler(clbSOTIASSOSignal_OnItemChecked);

                //Возобновить прорисовку текущей панели
                this.ResumeLayout(false);
                //Принудительное применение логики макета
                this.PerformLayout();
            }
Esempio n. 23
0
        //Windows Form inital
        protected void InitializeComponent()
        {
            #region Create variable
            components = new Container();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(MainForm));
            mainMenu1           = new MainMenu(components);
            fileMenuItem        = new MenuItem();
            newMenuItem         = new MenuItem();
            openMenuItem        = new MenuItem();
            saveMenuItem        = new MenuItem();
            saveAsMenuItem      = new MenuItem();
            pageSetupMenuItem   = new MenuItem();
            printMenuItem       = new MenuItem();
            exitMenuItem        = new MenuItem();
            editMenuItem        = new MenuItem();
            undoMenuItem        = new MenuItem();
            cutMenuItem         = new MenuItem();
            copyMenuItem        = new MenuItem();
            pasteMenuItem       = new MenuItem();
            deleteMenuItem      = new MenuItem();
            findMenuItem        = new MenuItem();
            findNextMenuItem    = new MenuItem();
            replaceMenuItem     = new MenuItem();
            goToMenuItem        = new MenuItem();
            selectAllMenuItem   = new MenuItem();
            timeDateMenuItem    = new MenuItem();
            formatMenuItem      = new MenuItem();
            wordWrapMenuItem    = new MenuItem();
            fontMenuItem        = new MenuItem();
            colorMenuItem       = new MenuItem();
            viewMenuItem        = new MenuItem();
            statusBarMenuItem   = new MenuItem();
            helpMenuItem        = new MenuItem();
            aboutMenuItem       = new MenuItem();
            dateTimePicker1     = new DateTimePicker();
            txtbox              = new RichTextBox();
            contextMenu         = new ContextMenu();
            rightToLeftMenuItem = new MenuItem();
            // how to use same mentItem object to both of contextMenu and EditMenuItem?
            undoMenuItem2      = new MenuItem();
            cutMenuItem2       = new MenuItem();
            copyMenuItem2      = new MenuItem();
            pasteMenuItem2     = new MenuItem();
            deleteMenuItem2    = new MenuItem();
            selectAllMenuItem2 = new MenuItem();
            fontDialog1        = new FontDialog();
            statusBar1         = new StatusBar();
            statusBarPanel1    = new StatusBarPanel();
            statusBarPanel2    = new StatusBarPanel();
            colorDialog1       = new ColorDialog();
            ((System.ComponentModel.ISupportInitialize)(statusBarPanel1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(statusBarPanel2)).BeginInit();
            SuspendLayout();
            #endregion

            #region MainMenu
            // mainMenu1
            mainMenu1.MenuItems.Add(fileMenuItem);
            mainMenu1.MenuItems.Add(editMenuItem);
            mainMenu1.MenuItems.Add(formatMenuItem);
            mainMenu1.MenuItems.Add(viewMenuItem);
            mainMenu1.MenuItems.Add(helpMenuItem);
            #endregion

            #region FileMenuItem Setup
            // fileMenuItem
            fileMenuItem.Text = "File";
            fileMenuItem.MenuItems.Add(newMenuItem);
            fileMenuItem.MenuItems.Add(openMenuItem);
            fileMenuItem.MenuItems.Add(saveMenuItem);
            fileMenuItem.MenuItems.Add(saveAsMenuItem);
            fileMenuItem.MenuItems.Add("-");
            fileMenuItem.MenuItems.Add(pageSetupMenuItem);
            fileMenuItem.MenuItems.Add(printMenuItem);
            fileMenuItem.MenuItems.Add("-");
            fileMenuItem.MenuItems.Add(exitMenuItem);

            // newMenuItem
            newMenuItem.Shortcut = Shortcut.CtrlN;
            newMenuItem.Text     = "New";
            newMenuItem.Click   += new EventHandler(newMenuItem_Click);

            // openMenuItem
            openMenuItem.Shortcut = Shortcut.CtrlO;
            openMenuItem.Text     = "Open...";
            openMenuItem.Click   += new EventHandler(openMenuItem_Click);

            // saveMenuItem
            saveMenuItem.Shortcut = Shortcut.CtrlS;
            saveMenuItem.Text     = "Save";
            saveMenuItem.Click   += new EventHandler(saveMenuItem_Click);

            // saveAsMenuItem
            saveAsMenuItem.Text   = "Save As...";
            saveAsMenuItem.Click += new EventHandler(saveAsMenuItem_Click);

            // pageSetupMenuItem
            pageSetupMenuItem.Enabled = false;
            pageSetupMenuItem.Text    = "Page Setup...";

            // printMenuItem
            printMenuItem.Enabled  = false;
            printMenuItem.Shortcut = Shortcut.CtrlP;
            printMenuItem.Text     = "Print";

            // exitMenuItem
            exitMenuItem.Text   = "Exit";
            exitMenuItem.Click += new EventHandler(exitMenuItem_Click);
            #endregion

            #region EditMenuItem Setup
            // editMenuItem
            editMenuItem.Text = "Edit";
            editMenuItem.MenuItems.AddRange(new MenuItem[] {
                undoMenuItem,
                new MenuItem("-"),
                cutMenuItem,
                copyMenuItem,
                pasteMenuItem,
                deleteMenuItem,
                new MenuItem("-"),
                findMenuItem,
                findNextMenuItem,
                new MenuItem("-"),
                replaceMenuItem,
                goToMenuItem,
                new MenuItem("-"),
                selectAllMenuItem,
                timeDateMenuItem
            });

            // undoMenuItem
            undoMenuItem.Enabled  = false;
            undoMenuItem.Shortcut = Shortcut.CtrlZ;
            undoMenuItem.Text     = "Undo";
            undoMenuItem.Click   += new EventHandler(undoMenuItem_Click);

            // cutMenuItem
            cutMenuItem.Enabled  = false;
            cutMenuItem.Visible  = true;
            cutMenuItem.Shortcut = Shortcut.CtrlX;
            cutMenuItem.Text     = "Cut";
            cutMenuItem.Click   += new EventHandler(cutMenuItem_Click);

            // copyMenuItem
            copyMenuItem.Enabled  = false;
            copyMenuItem.Shortcut = Shortcut.CtrlC;
            copyMenuItem.Text     = "Copy";
            copyMenuItem.Click   += new EventHandler(copyMenuItem_Click);

            // pasteMenuItem
            pasteMenuItem.Shortcut = Shortcut.CtrlV;
            pasteMenuItem.Text     = "Paste";
            pasteMenuItem.Click   += new EventHandler(pasteMenuItem_Click);

            // deleteMenuItem
            deleteMenuItem.Enabled  = false;
            deleteMenuItem.Shortcut = Shortcut.Del;
            deleteMenuItem.Text     = "Delete";
            deleteMenuItem.Click   += new EventHandler(deleteMenuItem_Click);

            // findMenuItem
            findMenuItem.Enabled  = false;
            findMenuItem.Shortcut = Shortcut.CtrlF;
            findMenuItem.Text     = "Find";
            findMenuItem.Click   += new EventHandler(findMenuItem_Click);

            // findNextMenuItem
            findNextMenuItem.Enabled  = false;
            findNextMenuItem.Shortcut = Shortcut.F3;
            findNextMenuItem.Text     = "Find Next";
            findNextMenuItem.Click   += new EventHandler(findNextMenuItem_Click);

            // replaceMenuItem
            replaceMenuItem.Enabled  = false;
            replaceMenuItem.Shortcut = Shortcut.CtrlH;
            replaceMenuItem.Text     = "Replace";

            // goToMenuItem
            goToMenuItem.Enabled  = false;
            goToMenuItem.Shortcut = Shortcut.CtrlG;
            goToMenuItem.Text     = "Go to";

            // selectAllMenuItem
            selectAllMenuItem.Shortcut = Shortcut.CtrlA;
            selectAllMenuItem.Text     = "Select All";
            selectAllMenuItem.Click   += new EventHandler(selectAllMenuItem_Click);

            // timeDateMenuItem
            timeDateMenuItem.Shortcut = Shortcut.F5;
            timeDateMenuItem.Text     = "Time/Date";
            timeDateMenuItem.Click   += new EventHandler(timeDateMenuItem_Click);
            #endregion

            #region FormatMenuItem Setup
            // formatMenuItem
            formatMenuItem.MenuItems.Add(wordWrapMenuItem);
            formatMenuItem.MenuItems.Add(fontMenuItem);
            formatMenuItem.MenuItems.Add(colorMenuItem);
            formatMenuItem.Text = "Format";

            // wordWrapMenuItem
            wordWrapMenuItem.Text   = "Word Wrap";
            wordWrapMenuItem.Click += new EventHandler(wordWrapMenuItem_Click);

            // fontMenuItem
            fontMenuItem.Text   = "Font";
            fontMenuItem.Click += new EventHandler(fontMenuItem_Click);

            // colorMenuItem
            colorMenuItem.Text   = "Color";
            colorMenuItem.Click += new EventHandler(colorMenuItem_Click);
            #endregion

            #region ViewMenuItem Setup
            // viewMenuItem
            viewMenuItem.MenuItems.Add(statusBarMenuItem);
            viewMenuItem.Text = "View";

            // statusBarMenuItem
            statusBarMenuItem.Text   = "Status Bar";
            statusBarMenuItem.Click += new EventHandler(statusBarMenuItem_Click);
            #endregion

            #region HelpMenuItem Setup
            // helpMenuItem
            helpMenuItem.MenuItems.Add(aboutMenuItem);
            helpMenuItem.Text = "Help";

            // aboutMenuItem
            aboutMenuItem.Text   = "About Notepad";
            aboutMenuItem.Click += new EventHandler(aboutMenuItem_Click);
            #endregion

            // rightToLeftMenuItem
            rightToLeftMenuItem.Text   = "Right to left Reading order";
            rightToLeftMenuItem.Click += new EventHandler(rightToLeftMenuItem_Click);

            // dateTimePicker1
            dateTimePicker1.Location = new System.Drawing.Point(218, 0);
            dateTimePicker1.Name     = "dateTimePicker1";
            dateTimePicker1.Size     = new System.Drawing.Size(320, 26);
            dateTimePicker1.TabIndex = 1;

            #region ContextMenu Setup
            // contextMenu
            contextMenu.MenuItems.Add(undoMenuItem2);
            contextMenu.MenuItems.Add("-");
            contextMenu.MenuItems.Add(cutMenuItem2);
            contextMenu.MenuItems.Add(copyMenuItem2);
            contextMenu.MenuItems.Add(pasteMenuItem2);
            contextMenu.MenuItems.Add(deleteMenuItem2);
            contextMenu.MenuItems.Add("-");
            contextMenu.MenuItems.Add(selectAllMenuItem2);
            contextMenu.MenuItems.Add("-");
            contextMenu.MenuItems.Add(rightToLeftMenuItem);

            // undoMenuItem2
            undoMenuItem2.Enabled  = false;
            undoMenuItem2.Shortcut = Shortcut.CtrlZ;
            undoMenuItem2.Text     = "Undo";
            undoMenuItem2.Click   += new EventHandler(undoMenuItem_Click);

            // cutMenuItem2
            cutMenuItem2.Enabled  = false;
            cutMenuItem2.Visible  = true;
            cutMenuItem2.Shortcut = Shortcut.CtrlX;
            cutMenuItem2.Text     = "Cut";
            cutMenuItem2.Click   += new EventHandler(cutMenuItem_Click);

            // copyMenuItem2
            copyMenuItem2.Enabled  = false;
            copyMenuItem2.Shortcut = Shortcut.CtrlC;
            copyMenuItem2.Text     = "Copy";
            copyMenuItem2.Click   += new EventHandler(copyMenuItem_Click);

            // pasteMenuItem2
            pasteMenuItem2.Shortcut = Shortcut.CtrlV;
            pasteMenuItem2.Text     = "Paste";
            pasteMenuItem2.Click   += new EventHandler(pasteMenuItem_Click);

            // deleteMenuItem2
            deleteMenuItem2.Enabled  = false;
            deleteMenuItem2.Shortcut = Shortcut.Del;
            deleteMenuItem2.Text     = "Delete";
            deleteMenuItem2.Click   += new EventHandler(deleteMenuItem_Click);

            // selectAllMenuItem2
            selectAllMenuItem2.Shortcut = Shortcut.CtrlA;
            selectAllMenuItem2.Text     = "Select All";
            selectAllMenuItem2.Click   += new EventHandler(selectAllMenuItem_Click);
            #endregion

            // txtbox
            txtbox.AutoWordSelection = true;
            txtbox.ContextMenu       = contextMenu;
            txtbox.Dock         = DockStyle.Fill;
            txtbox.Font         = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
            txtbox.Location     = new System.Drawing.Point(0, 0);
            txtbox.Name         = "txtbox";
            txtbox.RightToLeft  = RightToLeft.No;
            txtbox.ScrollBars   = RichTextBoxScrollBars.ForcedBoth;
            txtbox.Size         = new System.Drawing.Size(592, 297);
            txtbox.TabIndex     = 2;
            txtbox.TabStop      = false;
            txtbox.Text         = "";
            txtbox.WordWrap     = false;
            txtbox.TextChanged += new EventHandler(txtbox_TextChanged);
            txtbox.KeyUp       += new KeyEventHandler(txtbox_KeyUp);
            txtbox.MouseUp     += new MouseEventHandler(txtbox_MouseUp);

            // fontDialog1
            fontDialog1.ShowColor = true;

            // statusBar1
            statusBar1.Location = new System.Drawing.Point(0, 297);
            statusBar1.Name     = "statusBar1";
            statusBar1.Panels.AddRange(new StatusBarPanel[] {
                statusBarPanel1,
                statusBarPanel2
            });
            statusBar1.ShowPanels = true;
            statusBar1.Size       = new System.Drawing.Size(592, 30);
            statusBar1.TabIndex   = 3;
            statusBar1.Visible    = false;

            // statusBarPanel1
            statusBarPanel1.AutoSize = StatusBarPanelAutoSize.Spring;
            statusBarPanel1.Name     = "statusBarPanel1";
            statusBarPanel1.Width    = 367;

            // statusBarPanel2
            statusBarPanel2.MinWidth = 200;
            statusBarPanel2.Name     = "statusBarPanel2";
            statusBarPanel2.Width    = 200;

            // MainForm
            this.AutoScaleBaseSize = new System.Drawing.Size(8, 19);
            this.BackColor         = System.Drawing.SystemColors.Control;
            this.ClientSize        = new System.Drawing.Size(592, 327);
            this.Controls.Add(txtbox);
            this.Controls.Add(statusBar1);
            this.Controls.Add(dateTimePicker1);
            //Icon = ((System.Drawing.Icon)(resources.GetObject("$Icon")));
            this.Menu    = mainMenu1;
            this.Name    = "MainForm";
            this.Text    = "Untitled - Notepad";
            this.Closed += new EventHandler(Form_Closed);
            ((System.ComponentModel.ISupportInitialize)(statusBarPanel1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(statusBarPanel2)).EndInit();
            ResumeLayout(false);
        }
        private Control GetVariableEditor(IDictionary variable)
        {
            var value = variable["Value"];
            var name = (string) variable["Name"];
            var editor = variable["Editor"] as string;
            var type = value.GetType();

            if (type == typeof (DateTime) ||
                (!string.IsNullOrEmpty(editor) &&
                 (editor.IndexOf("date", StringComparison.OrdinalIgnoreCase) > -1 ||
                  editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var dateTimePicker = new DateTimePicker
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    ShowTime = (variable["ShowTime"] != null && (bool) variable["ShowTime"]) ||
                               (!string.IsNullOrEmpty(editor) &&
                                editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)
                };
                if (value is DateTime)
                {
                    var date = (DateTime) value;
                    if (date != DateTime.MinValue && date != DateTime.MaxValue)
                    {
                        dateTimePicker.Value = (date.Kind != DateTimeKind.Utc)
                            ? DateUtil.ToIsoDate(TypeResolver.Resolve<IDateConverter>("IDateConverter").ToServerTime(date))
                            : DateUtil.ToIsoDate(date);
                    }
                }
                else
                {
                    dateTimePicker.Value = value as string ?? string.Empty;
                }
                return dateTimePicker;
            }

            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("rule", StringComparison.OrdinalIgnoreCase) > -1)
            {
                string editorId = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name+"_");
                Sitecore.Context.ClientPage.ServerProperties[editorId] = value;

                var rulesBorder = new Border
                {
                    Class = "rulesWrapper",
                    ID = editorId
                };

                Button rulesEditButton = new Button
                {
                    Header = "Edit rule",
                    Class = "scButton edit-button rules-edit-button",
                    Click = "EditConditionClick(\\\"" + editorId + "\\\")"
                };

                rulesBorder.Controls.Add(rulesEditButton);
                var rulesRender = new Literal
                {
                    ID = editorId + "_renderer",
                    Text = GetRuleConditionsHtml(
                        string.IsNullOrEmpty(value as string) ? "<ruleset />" : value as string)
                };
                rulesRender.Class = rulesRender.Class + " varRule";
                rulesBorder.Controls.Add(rulesRender);
                return rulesBorder;
            }

            if (!string.IsNullOrEmpty(editor) &&
                (editor.IndexOf("treelist", StringComparison.OrdinalIgnoreCase) > -1 ||
                 (editor.IndexOf("multilist", StringComparison.OrdinalIgnoreCase) > -1) ||
                 (editor.IndexOf("droplist", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                Item item = null;
                var strValue = string.Empty;
                if (value is Item)
                {
                    item = (Item) value;
                    strValue = item.ID.ToString();
                }
                else if (value is IEnumerable<object>)
                {
                    List<Item> items = (value as IEnumerable<object>).Cast<Item>().ToList();
                    item = items.FirstOrDefault();
                    strValue = string.Join("|", items.Select(i => i.ID.ToString()).ToArray());
                }

                var dbName = item == null ? Sitecore.Context.ContentDatabase.Name : item.Database.Name;
                if (editor.IndexOf("multilist", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    var multiList = new MultilistExtended
                    {
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Value = strValue,
                        Database = dbName,
                        ItemID = "{11111111-1111-1111-1111-111111111111}",
                        Source = variable["Source"] as string ?? "/sitecore",
                    };
                    multiList.SetLanguage(Sitecore.Context.Language.Name);

                    multiList.Class += "  treePicker";
                    return multiList;
                }

                if (editor.IndexOf("droplist", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    var lookup = new LookupEx
                    {
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Database = dbName,
                        ItemID = (item != null ? item.ID.ToString() : "{11111111-1111-1111-1111-111111111111}"),
                        Source = variable["Source"] as string ?? "/sitecore",
                        ItemLanguage = Sitecore.Context.Language.Name,
                        Value = (item != null ? item.ID.ToString() : "{11111111-1111-1111-1111-111111111111}")
                    };
                    lookup.Class += " textEdit";
                    return lookup;
                }
                var treeList = new TreeList
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Value = strValue,
                    AllowMultipleSelection = true,
                    DatabaseName = dbName,
                    Database = dbName,
                    Source = variable["Source"] as string ?? "/sitecore",
                    DisplayFieldName = variable["DisplayFieldName"] as string ?? "__DisplayName"
                };
                treeList.Class += " treePicker";
                return treeList;
            }
            if (type == typeof (Item) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("item", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var item = value as Item;
                var source = variable["Source"] as string;
                var root = variable["Root"] as string;
                var sourceRoot = string.IsNullOrEmpty(source)
                    ? "/sitecore"
                    : StringUtil.ExtractParameter("DataSource", source);
                var dataContext = item != null
                    ? new DataContext
                    {
                        DefaultItem = item.Paths.Path,
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("dataContext"),
                        Parameters = string.IsNullOrEmpty(source) ? "databasename=" + item.Database.Name : source,
                        DataViewName = "Master",
                        Root = string.IsNullOrEmpty(root) ? sourceRoot : root,
                        Database = item.Database.Name,
                        Selected = new[] {new DataUri(item.ID, item.Language, item.Version)},
                        Folder = item.ID.ToString(),
                        Language = item.Language,
                        Version = item.Version
                    }
                    : new DataContext
                    {
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("dataContext"),
                        Parameters = string.IsNullOrEmpty(source) ? "databasename=master" : source,
                        DataViewName = "Master",
                        Root = string.IsNullOrEmpty(root) ? sourceRoot : root
                    };

                DataContextPanel.Controls.Add(dataContext);

                var treePicker = new TreePicker
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Value = item != null ? item.ID.ToString() : string.Empty,
                    DataContext = dataContext.ID,
                    AllowNone = !string.IsNullOrEmpty(editor) && (editor.IndexOf("allownone", StringComparison.OrdinalIgnoreCase) > -1)
                };
                treePicker.Class += " treePicker";
                return treePicker;
            }

            if (type == typeof (bool) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("bool", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var checkboxBorder = new Border
                {
                    Class = "checkBoxWrapper",
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_")
                };
                var checkBox = new Checkbox
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Header = (string) variable["Title"],
                    HeaderStyle = "display:inline-block;",
                    Checked = (bool) value,
                    Class = "varCheckbox"
                };
                checkboxBorder.Controls.Add(checkBox);
                return checkboxBorder;
            }

            if (!string.IsNullOrEmpty(editor))
            {
                var showRoles = editor.IndexOf("role", StringComparison.OrdinalIgnoreCase) > -1;
                var showUsers = editor.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
                var multiple = editor.IndexOf("multiple", StringComparison.OrdinalIgnoreCase) > -1;
                if (showRoles || showUsers)
                {
                    var picker = new UserPicker();
                    picker.Style.Add("float", "left");
                    picker.ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
                    picker.Class += " scContentControl textEdit clr" + value.GetType().Name;
                    picker.Value = (value is IEnumerable<object>) ? String.Join("|", ((IEnumerable<object>)value).Select(x => x.ToString()).ToArray()) : value.ToString();
                    picker.ExcludeRoles = !showRoles;
                    picker.ExcludeUsers = !showUsers;
                    picker.DomainName = variable["Domain"] as string ?? variable["DomainName"] as string;
                    picker.Multiple = multiple;
                    picker.Click = "UserPickerClick(" + picker.ID + ")";
                    return picker;
                }
            }

            Sitecore.Web.UI.HtmlControls.Control edit;
            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("info", StringComparison.OrdinalIgnoreCase) > -1)
            {
                return new Literal {Text = value.ToString(), Class = "varHint"};
            }

            if (variable["lines"] != null && ((int) variable["lines"] > 1))
            {
                edit = new Memo();
                edit.Attributes.Add("rows", variable["lines"].ToString());
            }
            else if (variable["Options"] != null)
            {
                var psOptions = variable["Options"].BaseObject();
                var options = new OrderedDictionary();
                if (psOptions is OrderedDictionary)
                {
                    options = psOptions as OrderedDictionary;
                }
                else if (psOptions is string)
                {
                    var strOptions = ((string) variable["Options"]).Split('|');
                    var i = 0;
                    while (i < strOptions.Length)
                    {
                        options.Add(strOptions[i++], strOptions[i++]);
                    }
                }
                else if (psOptions is Hashtable)
                {
                    var hashOptions = variable["Options"] as Hashtable;
                    foreach (var key in hashOptions.Keys)
                    {
                        options.Add(key, hashOptions[key]);
                    }
                }
                else
                {
                    throw new Exception("Checklist options format unrecognized.");
                }

                if (!string.IsNullOrEmpty(editor))
                {
                    if (editor.IndexOf("radio", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var radioList = new Groupbox
                        {
                            ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                            // Header = (string) variable["Title"],
                            Class = "scRadioGroup"
                        };

                        foreach (var option in options.Keys)
                        {
                            var optionName = option.ToString();
                            var optionValue = options[optionName].ToString();
                            var item = new Radiobutton
                            {
                                Header = optionName,
                                Value = optionValue,
                                ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID(radioList.ID),
                                Name = radioList.ID,
                                Checked = optionValue == value.ToString()
                            };
                            radioList.Controls.Add(item);
                            radioList.Controls.Add(new Literal("<br/>"));
                        }

                        return radioList;
                    }

                    if (editor.IndexOf("check", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var checkList = new PSCheckList
                        {
                            ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                            HeaderStyle = "margin-top:20px; display:inline-block;",
                            ItemID = "{11111111-1111-1111-1111-111111111111}"
                        };
                        checkList.SetItemLanguage(Sitecore.Context.Language.Name);
                        string[] values;
                        if (value is string)
                        {
                            values = value.ToString().Split('|');
                        }
                        else if (value is IEnumerable)
                        {
                            values = ((value as IEnumerable).Cast<object>().Select(s => s == null ? "" : s.ToString())).ToArray();
                        }
                        else
                        {
                            values = new[] {value.ToString()};
                        }
                        foreach (var item in from object option in options.Keys
                            select option.ToString()
                            into optionName
                            let optionValue = options[optionName].ToString()
                            select new ChecklistItem
                            {
                                ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID(checkList.ID),
                                Header = optionName,
                                Value = optionValue,
                                Checked = values.Contains(optionValue, StringComparer.OrdinalIgnoreCase)
                            })
                        {
                            checkList.Controls.Add(item);
                        }

                        checkList.TrackModified = false;
                        checkList.Disabled = false;
                        return checkList;
                    }
                }

                edit = new Combobox();
                var placeholder = variable["Placeholder"];
                if (placeholder is string)
                {
                    var option = new ListItem
                    {
                        Header = placeholder.ToString(),
                        Value = "",
                        Selected = true
                    };
                    edit.Controls.Add(option);
                }

                foreach (var option in options.Keys)
                {
                    var optionName = option.ToString();
                    var optionValue = options[optionName].ToString();
                    var item = new ListItem
                    {
                        Header = optionName,
                        Value = optionValue
                    };
                    edit.Controls.Add(item);
                }
            }
            else
            {
                var placeholder = variable["Placeholder"];
                if (!string.IsNullOrEmpty(editor) && editor.IndexOf("pass", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    edit = new PasswordExtended();
                    if (placeholder is string)
                    {
                        ((PasswordExtended)edit).PlaceholderText = placeholder.ToString();
                    }
                }
                else
                {
                    edit = new EditExtended();
                    if (placeholder is string)
                    {
                        ((EditExtended)edit).PlaceholderText = placeholder.ToString();
                    }
                }
            }
            var tip = (variable["Tooltip"] as string);
            if (!String.IsNullOrEmpty(tip))
            {
                edit.ToolTip = tip.RemoveHtmlTags();
            }
            edit.Style.Add("float", "left");
            edit.ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
            edit.Class += " scContentControl textEdit clr" + value.GetType().Name;
            edit.Value = value.ToString();

            return edit;
        }
	private void InitializeComponent(EmployeeTrainingClient externalHandler){
		_mainTablePanel = new TableLayoutPanel();
		_mainTablePanel.RowCount = 2;
		_mainTablePanel.ColumnCount = 2;
		_mainTablePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | 
														 AnchorStyles.Right | AnchorStyles.Left;
		_mainTablePanel.Height = 500;
		_mainTablePanel.Width = 700;
		_infoTablePanel = new TableLayoutPanel();
		_infoTablePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | 
														 AnchorStyles.Right | AnchorStyles.Left;
		_infoTablePanel.RowCount = 2;
		_infoTablePanel.ColumnCount = 2;
		_infoTablePanel.Height = 200;
		_infoTablePanel.Width = 400;
		_buttonPanel = new FlowLayoutPanel();
		_buttonPanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | 
													AnchorStyles.Right | AnchorStyles.Left;
		_buttonPanel.Width = 500;
		_buttonPanel.Height = 200;

		_pictureBox = new PictureBox();
		_pictureBox.Height = 200;
		_pictureBox.Width = 200;
		_pictureBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | 
												 AnchorStyles.Right | AnchorStyles.Left;

		_firstNameLabel = new Label();
		_firstNameLabel.Text = "First Name:";
		_middleNameLabel = new Label();
		_middleNameLabel.Text = "Middle Name:";
		_lastNameLabel = new Label();
		_lastNameLabel.Text = "Last Name:";
		_birthdayLabel = new Label();
		_birthdayLabel.Text = "Birthday:";
		_genderLabel = new Label();
		_genderLabel.Text = "Gender:";
		_firstNameTextBox = new TextBox();
		_firstNameTextBox.Width = 200;
		_middleNameTextBox = new TextBox();
		_middleNameTextBox.Width = 200;
		_lastNameTextBox = new TextBox();
		_lastNameTextBox.Width = 200;
		_birthdayPicker = new DateTimePicker();
		_genderBox = new GroupBox();
		_genderBox.Text = "Gender";
		_genderBox.Height = 75;
		_genderBox.Width = 200;
		_maleRadioButton = new RadioButton();
		_maleRadioButton.Text = "Male";
		_maleRadioButton.Checked = true;
		_maleRadioButton.Location = new Point(10, 20);
		_femaleRadioButton = new RadioButton();
		_femaleRadioButton.Text = "Female";
		_femaleRadioButton.Location = new Point(10, 40);
		_genderBox.Controls.Add(_maleRadioButton);
		_genderBox.Controls.Add(_femaleRadioButton);
		_clearButton = new Button();
		_clearButton.Text = "Clear";
		_clearButton.Click += this.ClearButtonHandler;
		_loadPictureButton = new Button();
		_loadPictureButton.Text = "Load Picture";
		_loadPictureButton.AutoSize = true;
		_loadPictureButton.Click += this.LoadPictureButtonHandler;
		_submitButton = new Button();
		_submitButton.Text = "Submit";
		_submitButton.Click += externalHandler.EmployeeSubmitButtonHandler;
		_submitButton.Enabled = false;

		_infoTablePanel.SuspendLayout();
		_infoTablePanel.Controls.Add(_firstNameLabel);
		_infoTablePanel.Controls.Add(_firstNameTextBox);
		_infoTablePanel.Controls.Add(_middleNameLabel);
		_infoTablePanel.Controls.Add(_middleNameTextBox);
		_infoTablePanel.Controls.Add(_lastNameLabel);
		_infoTablePanel.Controls.Add(_lastNameTextBox);
		_infoTablePanel.Controls.Add(_birthdayLabel);
		_infoTablePanel.Controls.Add(_birthdayPicker);
		_infoTablePanel.Controls.Add(_genderLabel);
		_infoTablePanel.Controls.Add(_genderBox);
		_infoTablePanel.Dock = DockStyle.Top;

		_buttonPanel.SuspendLayout();
		_buttonPanel.Controls.Add(_clearButton);
		_buttonPanel.Controls.Add(_loadPictureButton);
		_buttonPanel.Controls.Add(_submitButton);

		_mainTablePanel.SuspendLayout();
		_mainTablePanel.Controls.Add(_pictureBox);
		_mainTablePanel.Controls.Add(_infoTablePanel);
		_mainTablePanel.Controls.Add(_buttonPanel);
		_mainTablePanel.SetColumnSpan(_buttonPanel, 2);

		this.SuspendLayout();
		this.Controls.Add(_mainTablePanel); 
		this.Width = WINDOW_WIDTH;
		this.Height = WINDOW_HEIGHT;
		this.Text = "Employee Form";
		_infoTablePanel.ResumeLayout();
		_buttonPanel.ResumeLayout();
		_mainTablePanel.ResumeLayout();
		this.ResumeLayout();
		_dialog = new OpenFileDialog();
		_dialog.FileOk += this.LoadPicture;
	}
 private void InitializeComponent()
 {
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
     this.checkBoxNonCompletedPaiement = new System.Windows.Forms.CheckBox();
     this.checkBoxCompletedPaiements   = new System.Windows.Forms.CheckBox();
     this.numericUpDownMaxPrice        = new System.Windows.Forms.NumericUpDown();
     this.numericUpDownMinPrice        = new System.Windows.Forms.NumericUpDown();
     this.label4 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.checkBoxNonConfirmedbooking = new System.Windows.Forms.CheckBox();
     this.checkBoxConfirmedbooking    = new System.Windows.Forms.CheckBox();
     this.dateTimePickerEnd           = new System.Windows.Forms.DateTimePicker();
     this.label2 = new System.Windows.Forms.Label();
     this.label1 = new System.Windows.Forms.Label();
     this.dateTimePickerStart = new System.Windows.Forms.DateTimePicker();
     this.comboBoxArea        = new System.Windows.Forms.ComboBox();
     this.labelArea           = new System.Windows.Forms.Label();
     this.comboBoxUsers       = new System.Windows.Forms.ComboBox();
     this.labelUsers          = new System.Windows.Forms.Label();
     this.buttonFilter        = new System.Windows.Forms.Button();
     this.buttonClearFilter   = new System.Windows.Forms.Button();
     this._dgvSearch          = new System.Windows.Forms.DataGridView();
     this.ColumnArea          = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.ColumnUser          = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.ColumnPrice         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.ColumnPaid          = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.ColumnConfirmed     = new System.Windows.Forms.DataGridViewCheckBoxColumn();
     this.ColumnCheckIn       = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.ColumnCheckOut      = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.ColumnEdit          = new System.Windows.Forms.DataGridViewImageColumn();
     this.ColumnDelete        = new System.Windows.Forms.DataGridViewImageColumn();
     this.ColumnDetails       = new System.Windows.Forms.DataGridViewImageColumn();
     ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxPrice)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMinPrice)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this._dgvSearch)).BeginInit();
     this.SuspendLayout();
     //
     // checkBoxNonCompletedPaiement
     //
     this.checkBoxNonCompletedPaiement.AutoSize  = true;
     this.checkBoxNonCompletedPaiement.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.checkBoxNonCompletedPaiement.ForeColor = System.Drawing.Color.White;
     this.checkBoxNonCompletedPaiement.Location  = new System.Drawing.Point(400, 86);
     this.checkBoxNonCompletedPaiement.Name      = "checkBoxNonCompletedPaiement";
     this.checkBoxNonCompletedPaiement.Size      = new System.Drawing.Size(222, 21);
     this.checkBoxNonCompletedPaiement.TabIndex  = 32;
     this.checkBoxNonCompletedPaiement.Text      = "Filter on non completed paiements";
     this.checkBoxNonCompletedPaiement.UseVisualStyleBackColor = true;
     //
     // checkBoxCompletedPaiements
     //
     this.checkBoxCompletedPaiements.AutoSize  = true;
     this.checkBoxCompletedPaiements.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.checkBoxCompletedPaiements.ForeColor = System.Drawing.Color.White;
     this.checkBoxCompletedPaiements.Location  = new System.Drawing.Point(400, 57);
     this.checkBoxCompletedPaiements.Name      = "checkBoxCompletedPaiements";
     this.checkBoxCompletedPaiements.Size      = new System.Drawing.Size(198, 21);
     this.checkBoxCompletedPaiements.TabIndex  = 31;
     this.checkBoxCompletedPaiements.Text      = "Filter on completed paiements";
     this.checkBoxCompletedPaiements.UseVisualStyleBackColor = true;
     //
     // numericUpDownMaxPrice
     //
     this.numericUpDownMaxPrice.Font     = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.numericUpDownMaxPrice.Location = new System.Drawing.Point(791, 27);
     this.numericUpDownMaxPrice.Maximum  = new decimal(new int[] {
         999,
         0,
         0,
         0
     });
     this.numericUpDownMaxPrice.Name     = "numericUpDownMaxPrice";
     this.numericUpDownMaxPrice.Size     = new System.Drawing.Size(77, 24);
     this.numericUpDownMaxPrice.TabIndex = 30;
     this.numericUpDownMaxPrice.Value    = new decimal(new int[] {
         999,
         0,
         0,
         0
     });
     //
     // numericUpDownMinPrice
     //
     this.numericUpDownMinPrice.Font     = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.numericUpDownMinPrice.Location = new System.Drawing.Point(791, -2);
     this.numericUpDownMinPrice.Name     = "numericUpDownMinPrice";
     this.numericUpDownMinPrice.Size     = new System.Drawing.Size(77, 24);
     this.numericUpDownMinPrice.TabIndex = 29;
     //
     // label4
     //
     this.label4.AutoSize  = true;
     this.label4.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label4.ForeColor = System.Drawing.Color.White;
     this.label4.Location  = new System.Drawing.Point(700, 29);
     this.label4.Margin    = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.label4.Name      = "label4";
     this.label4.Size      = new System.Drawing.Size(74, 17);
     this.label4.TabIndex  = 28;
     this.label4.Text      = "Max price : ";
     //
     // label3
     //
     this.label3.AutoSize  = true;
     this.label3.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label3.ForeColor = System.Drawing.Color.White;
     this.label3.Location  = new System.Drawing.Point(700, 0);
     this.label3.Margin    = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.label3.Name      = "label3";
     this.label3.Size      = new System.Drawing.Size(71, 17);
     this.label3.TabIndex  = 27;
     this.label3.Text      = "Min price : ";
     //
     // checkBoxNonConfirmedbooking
     //
     this.checkBoxNonConfirmedbooking.AutoSize  = true;
     this.checkBoxNonConfirmedbooking.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.checkBoxNonConfirmedbooking.ForeColor = System.Drawing.Color.White;
     this.checkBoxNonConfirmedbooking.Location  = new System.Drawing.Point(400, 28);
     this.checkBoxNonConfirmedbooking.Name      = "checkBoxNonConfirmedbooking";
     this.checkBoxNonConfirmedbooking.Size      = new System.Drawing.Size(209, 21);
     this.checkBoxNonConfirmedbooking.TabIndex  = 26;
     this.checkBoxNonConfirmedbooking.Text      = "Filter on non confirmed bookings";
     this.checkBoxNonConfirmedbooking.UseVisualStyleBackColor = true;
     //
     // checkBoxConfirmedbooking
     //
     this.checkBoxConfirmedbooking.AutoSize  = true;
     this.checkBoxConfirmedbooking.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.checkBoxConfirmedbooking.ForeColor = System.Drawing.Color.White;
     this.checkBoxConfirmedbooking.Location  = new System.Drawing.Point(400, -1);
     this.checkBoxConfirmedbooking.Name      = "checkBoxConfirmedbooking";
     this.checkBoxConfirmedbooking.Size      = new System.Drawing.Size(185, 21);
     this.checkBoxConfirmedbooking.TabIndex  = 25;
     this.checkBoxConfirmedbooking.Text      = "Filter on confirmed bookings";
     this.checkBoxConfirmedbooking.UseVisualStyleBackColor = true;
     //
     // dateTimePickerEnd
     //
     this.dateTimePickerEnd.Font     = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.dateTimePickerEnd.Location = new System.Drawing.Point(103, 84);
     this.dateTimePickerEnd.Name     = "dateTimePickerEnd";
     this.dateTimePickerEnd.Size     = new System.Drawing.Size(272, 24);
     this.dateTimePickerEnd.TabIndex = 24;
     //
     // label2
     //
     this.label2.AutoSize  = true;
     this.label2.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label2.ForeColor = System.Drawing.Color.White;
     this.label2.Location  = new System.Drawing.Point(4, 87);
     this.label2.Margin    = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(72, 17);
     this.label2.TabIndex  = 23;
     this.label2.Text      = "Max date : ";
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.White;
     this.label1.Location  = new System.Drawing.Point(4, 58);
     this.label1.Margin    = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(69, 17);
     this.label1.TabIndex  = 22;
     this.label1.Text      = "Min date : ";
     //
     // dateTimePickerStart
     //
     this.dateTimePickerStart.Font     = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.dateTimePickerStart.Location = new System.Drawing.Point(103, 55);
     this.dateTimePickerStart.Name     = "dateTimePickerStart";
     this.dateTimePickerStart.Size     = new System.Drawing.Size(272, 24);
     this.dateTimePickerStart.TabIndex = 21;
     //
     // comboBoxArea
     //
     this.comboBoxArea.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.comboBoxArea.FormattingEnabled = true;
     this.comboBoxArea.Location          = new System.Drawing.Point(103, 26);
     this.comboBoxArea.Margin            = new System.Windows.Forms.Padding(4);
     this.comboBoxArea.Name     = "comboBoxArea";
     this.comboBoxArea.Size     = new System.Drawing.Size(272, 23);
     this.comboBoxArea.TabIndex = 20;
     //
     // labelArea
     //
     this.labelArea.AutoSize  = true;
     this.labelArea.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelArea.ForeColor = System.Drawing.Color.White;
     this.labelArea.Location  = new System.Drawing.Point(4, 29);
     this.labelArea.Margin    = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.labelArea.Name      = "labelArea";
     this.labelArea.Size      = new System.Drawing.Size(45, 17);
     this.labelArea.TabIndex  = 19;
     this.labelArea.Text      = "Area : ";
     //
     // comboBoxUsers
     //
     this.comboBoxUsers.Font = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.comboBoxUsers.FormattingEnabled = true;
     this.comboBoxUsers.Location          = new System.Drawing.Point(103, -3);
     this.comboBoxUsers.Margin            = new System.Windows.Forms.Padding(4);
     this.comboBoxUsers.Name     = "comboBoxUsers";
     this.comboBoxUsers.Size     = new System.Drawing.Size(272, 23);
     this.comboBoxUsers.TabIndex = 18;
     //
     // labelUsers
     //
     this.labelUsers.AutoSize  = true;
     this.labelUsers.Font      = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelUsers.ForeColor = System.Drawing.Color.White;
     this.labelUsers.Location  = new System.Drawing.Point(4, 0);
     this.labelUsers.Margin    = new System.Windows.Forms.Padding(4, 0, 4, 0);
     this.labelUsers.Name      = "labelUsers";
     this.labelUsers.Size      = new System.Drawing.Size(49, 17);
     this.labelUsers.TabIndex  = 17;
     this.labelUsers.Text      = "Users : ";
     //
     // buttonFilter
     //
     this.buttonFilter.Font     = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonFilter.Location = new System.Drawing.Point(793, 82);
     this.buttonFilter.Name     = "buttonFilter";
     this.buttonFilter.Size     = new System.Drawing.Size(75, 28);
     this.buttonFilter.TabIndex = 33;
     this.buttonFilter.Text     = "Filter";
     this.buttonFilter.UseVisualStyleBackColor = true;
     this.buttonFilter.Click += new System.EventHandler(this.buttonFilter_Click);
     //
     // buttonClearFilter
     //
     this.buttonClearFilter.Font     = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonClearFilter.Location = new System.Drawing.Point(679, 82);
     this.buttonClearFilter.Name     = "buttonClearFilter";
     this.buttonClearFilter.Size     = new System.Drawing.Size(108, 28);
     this.buttonClearFilter.TabIndex = 34;
     this.buttonClearFilter.Text     = "Clear filter";
     this.buttonClearFilter.UseVisualStyleBackColor = true;
     this.buttonClearFilter.Click += new System.EventHandler(this.buttonClearFilter_Click);
     //
     // _dgvSearch
     //
     this._dgvSearch.AllowUserToAddRows       = false;
     this._dgvSearch.AllowUserToDeleteRows    = false;
     this._dgvSearch.AllowUserToResizeColumns = false;
     this._dgvSearch.AllowUserToResizeRows    = false;
     dataGridViewCellStyle1.Alignment         = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
     dataGridViewCellStyle1.BackColor         = System.Drawing.Color.DarkRed;
     dataGridViewCellStyle1.Font                   = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     dataGridViewCellStyle1.ForeColor              = System.Drawing.Color.White;
     dataGridViewCellStyle1.SelectionBackColor     = System.Drawing.SystemColors.Highlight;
     dataGridViewCellStyle1.SelectionForeColor     = System.Drawing.SystemColors.HighlightText;
     dataGridViewCellStyle1.WrapMode               = System.Windows.Forms.DataGridViewTriState.True;
     this._dgvSearch.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
     this._dgvSearch.ColumnHeadersHeightSizeMode   = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this._dgvSearch.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
         this.ColumnArea,
         this.ColumnUser,
         this.ColumnPrice,
         this.ColumnPaid,
         this.ColumnConfirmed,
         this.ColumnCheckIn,
         this.ColumnCheckOut,
         this.ColumnEdit,
         this.ColumnDelete,
         this.ColumnDetails
     });
     dataGridViewCellStyle4.Alignment          = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
     dataGridViewCellStyle4.BackColor          = System.Drawing.SystemColors.Window;
     dataGridViewCellStyle4.Font               = new System.Drawing.Font("Calibri", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     dataGridViewCellStyle4.ForeColor          = System.Drawing.SystemColors.ControlText;
     dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
     dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
     dataGridViewCellStyle4.WrapMode           = System.Windows.Forms.DataGridViewTriState.False;
     this._dgvSearch.DefaultCellStyle          = dataGridViewCellStyle4;
     this._dgvSearch.Location          = new System.Drawing.Point(7, 116);
     this._dgvSearch.MultiSelect       = false;
     this._dgvSearch.Name              = "_dgvSearch";
     this._dgvSearch.ReadOnly          = true;
     this._dgvSearch.RowHeadersVisible = false;
     this._dgvSearch.ScrollBars        = System.Windows.Forms.ScrollBars.Vertical;
     this._dgvSearch.SelectionMode     = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
     this._dgvSearch.Size              = new System.Drawing.Size(861, 292);
     this._dgvSearch.TabIndex          = 1;
     this._dgvSearch.CellClick        += new System.Windows.Forms.DataGridViewCellEventHandler(this._dgvSearch_CellClick);
     //
     // ColumnArea
     //
     this.ColumnArea.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnArea.HeaderText   = "Area";
     this.ColumnArea.Name         = "ColumnArea";
     this.ColumnArea.ReadOnly     = true;
     this.ColumnArea.Width        = 66;
     //
     // ColumnUser
     //
     this.ColumnUser.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
     this.ColumnUser.HeaderText   = "User";
     this.ColumnUser.Name         = "ColumnUser";
     this.ColumnUser.ReadOnly     = true;
     //
     // ColumnPrice
     //
     dataGridViewCellStyle2.Alignment  = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     this.ColumnPrice.DefaultCellStyle = dataGridViewCellStyle2;
     this.ColumnPrice.HeaderText       = "Price";
     this.ColumnPrice.Name             = "ColumnPrice";
     this.ColumnPrice.ReadOnly         = true;
     //
     // ColumnPaid
     //
     dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     this.ColumnPaid.DefaultCellStyle = dataGridViewCellStyle3;
     this.ColumnPaid.HeaderText       = "Paid";
     this.ColumnPaid.Name             = "ColumnPaid";
     this.ColumnPaid.ReadOnly         = true;
     //
     // ColumnConfirmed
     //
     this.ColumnConfirmed.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnConfirmed.HeaderText   = "Confirmed";
     this.ColumnConfirmed.Name         = "ColumnConfirmed";
     this.ColumnConfirmed.ReadOnly     = true;
     this.ColumnConfirmed.Resizable    = System.Windows.Forms.DataGridViewTriState.True;
     this.ColumnConfirmed.SortMode     = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
     this.ColumnConfirmed.Width        = 103;
     //
     // ColumnCheckIn
     //
     this.ColumnCheckIn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnCheckIn.HeaderText   = "Check In";
     this.ColumnCheckIn.Name         = "ColumnCheckIn";
     this.ColumnCheckIn.ReadOnly     = true;
     this.ColumnCheckIn.Width        = 92;
     //
     // ColumnCheckOut
     //
     this.ColumnCheckOut.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnCheckOut.HeaderText   = "Chek Out";
     this.ColumnCheckOut.Name         = "ColumnCheckOut";
     this.ColumnCheckOut.ReadOnly     = true;
     this.ColumnCheckOut.Width        = 95;
     //
     // ColumnEdit
     //
     this.ColumnEdit.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnEdit.HeaderText   = "";
     this.ColumnEdit.Name         = "ColumnEdit";
     this.ColumnEdit.ReadOnly     = true;
     this.ColumnEdit.Resizable    = System.Windows.Forms.DataGridViewTriState.True;
     this.ColumnEdit.SortMode     = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
     this.ColumnEdit.Width        = 19;
     //
     // ColumnDelete
     //
     this.ColumnDelete.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnDelete.HeaderText   = "";
     this.ColumnDelete.Name         = "ColumnDelete";
     this.ColumnDelete.ReadOnly     = true;
     this.ColumnDelete.Resizable    = System.Windows.Forms.DataGridViewTriState.True;
     this.ColumnDelete.SortMode     = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
     this.ColumnDelete.Width        = 19;
     //
     // ColumnDetails
     //
     this.ColumnDetails.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
     this.ColumnDetails.HeaderText   = "";
     this.ColumnDetails.Name         = "ColumnDetails";
     this.ColumnDetails.ReadOnly     = true;
     this.ColumnDetails.Width        = 5;
     //
     // ViewBookSearch
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor           = System.Drawing.Color.Transparent;
     this.Controls.Add(this.checkBoxNonCompletedPaiement);
     this.Controls.Add(this.checkBoxCompletedPaiements);
     this.Controls.Add(this.numericUpDownMaxPrice);
     this.Controls.Add(this.numericUpDownMinPrice);
     this.Controls.Add(this.label4);
     this.Controls.Add(this.label3);
     this.Controls.Add(this.checkBoxNonConfirmedbooking);
     this.Controls.Add(this.checkBoxConfirmedbooking);
     this.Controls.Add(this.dateTimePickerEnd);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.dateTimePickerStart);
     this.Controls.Add(this.comboBoxArea);
     this.Controls.Add(this.labelArea);
     this.Controls.Add(this.comboBoxUsers);
     this.Controls.Add(this.labelUsers);
     this.Controls.Add(this.buttonClearFilter);
     this.Controls.Add(this.buttonFilter);
     this.Controls.Add(this._dgvSearch);
     this.Name = "ViewBookSearch";
     this.Size = new System.Drawing.Size(873, 411);
     ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxPrice)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMinPrice)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this._dgvSearch)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Esempio n. 27
0
        //used to provide color to various controls.
        //will move through each control and sub controls and adjust each control properties as required.
        public static void UpdateControls(Control control, List <Control> excludes = null)
        {
            foreach (Control c in control.Controls)
            {
                if (excludes != null && excludes.Contains(c))
                {
                    continue;
                }

                if (c is GroupBox | c is Panel | c is Label | c is ToolStripEx | c is ToolStrip | c is RadioButton | c is CheckBox | c is TreeView | c.ToString().Contains("PropertyGrid"))
                {
                    c.ForeColor = ThemeColorTable.ForeColor;
                    c.BackColor = ThemeColorTable.BackgroundColor;
                }
                if (c is Button)
                {
                    Button btn = c as Button;
                    btn.FlatStyle = FlatStyle.Flat;
                    btn.FlatAppearance.BorderSize = 0;
                    if (btn.BackgroundImage == null && btn.Image == null)
                    {
                        btn.BackgroundImageLayout = ImageLayout.Stretch;
                        btn.BackgroundImage       = Resources.Properties.Resources.ButtonBackgroundImage;
                        btn.BackColor             = Color.Transparent;
                        btn.ForeColor             = ThemeColorTable.ForeColor;
                    }
                }
                if (c is TextBox & !c.ToString().Contains("UpDown"))
                {
                    TextBox btn = c as TextBox;
                    btn.ForeColor   = ThemeColorTable.ForeColor;
                    btn.BackColor   = ThemeColorTable.TextBoxBackgroundColor;
                    btn.BorderStyle = BorderStyle.FixedSingle;
                }
                if (c is MaskedTextBox & !c.ToString().Contains("UpDown"))
                {
                    MaskedTextBox btn = c as MaskedTextBox;
                    btn.ForeColor   = ThemeColorTable.ForeColor;
                    btn.BackColor   = ThemeColorTable.TextBoxBackgroundColor;
                    btn.BorderStyle = BorderStyle.FixedSingle;
                }
                if (c is ComboBox)
                {
                    ComboBox btn = c as ComboBox;
                    btn.BackColor = ThemeColorTable.ComboBoxBackColor;
                    btn.ForeColor = ThemeColorTable.ForeColor;
                    btn.FlatStyle = FlatStyle.Flat;
                }
                if (c.ToString().Contains("DateTimePicker"))
                {
                    DateTimePicker btn = c as DateTimePicker;
                    btn.CalendarTitleBackColor = ThemeColorTable.TextBoxBackgroundColor;
                    btn.CalendarTitleForeColor = ThemeColorTable.ForeColor;
                }
                if (c is ListBox | c is ListView | c is MultiSelectTreeview)
                {
                    c.BackColor = ThemeColorTable.ListBoxBackColor;
                    c.ForeColor = ThemeColorTable.ForeColor;
                }
                if (c.ToString().Contains("NumericUpDown"))
                {
                    c.BackColor = ThemeColorTable.NumericBackColor;
                    c.ForeColor = ThemeColorTable.ForeColor;
                }
                if (c.Controls.Count > 0)
                {
                    UpdateControls(c, excludes);
                }
            }
        }
Esempio n. 28
0
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(fmPrintConversation));

            this.radioButtonDisplayed = new RadioButton();
            this.radioButtonDate      = new RadioButton();
            this.buttonPrint          = new Button();
            this.buttonCancel         = new Button();
            this.dateTimePickerFrom   = new DateTimePicker();
            this.dateTimePickerTo     = new DateTimePicker();
            this.labelFrom            = new Label();
            this.labelTo = new Label();
            this.radioButtonEntireConversation = new RadioButton();
            base.SuspendLayout();
            this.radioButtonDisplayed.AutoSize = true;
            this.radioButtonDisplayed.Checked  = true;
            this.radioButtonDisplayed.Location = new Point(0x12, 12);
            this.radioButtonDisplayed.Name     = "radioButtonDisplayed";
            this.radioButtonDisplayed.Size     = new Size(0x5f, 0x11);
            this.radioButtonDisplayed.TabIndex = 0;
            this.radioButtonDisplayed.TabStop  = true;
            this.radioButtonDisplayed.Text     = "Print Displayed";
            this.radioButtonDisplayed.UseVisualStyleBackColor = true;
            this.radioButtonDate.AutoSize = true;
            this.radioButtonDate.Location = new Point(0x12, 0x49);
            this.radioButtonDate.Name     = "radioButtonDate";
            this.radioButtonDate.Size     = new Size(0x8f, 0x11);
            this.radioButtonDate.TabIndex = 1;
            this.radioButtonDate.Text     = "Print Select Date Range:";
            this.radioButtonDate.UseVisualStyleBackColor = true;
            this.radioButtonDate.CheckedChanged         += new EventHandler(this.radioButtonDate_CheckedChanged);
            this.buttonPrint.Font     = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.buttonPrint.Location = new Point(0xbd, 0xab);
            this.buttonPrint.Name     = "buttonPrint";
            this.buttonPrint.Size     = new Size(0x4b, 0x1b);
            this.buttonPrint.TabIndex = 2;
            this.buttonPrint.Text     = "Print";
            this.buttonPrint.UseVisualStyleBackColor = true;
            this.buttonPrint.Click    += new EventHandler(this.buttonPrint_Click);
            this.buttonCancel.Font     = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.buttonCancel.Location = new Point(0x12, 0xab);
            this.buttonCancel.Name     = "buttonCancel";
            this.buttonCancel.Size     = new Size(0x4b, 0x1b);
            this.buttonCancel.TabIndex = 3;
            this.buttonCancel.Text     = "Cancel";
            this.buttonCancel.UseVisualStyleBackColor = true;
            this.buttonCancel.Click         += new EventHandler(this.buttonCancel_Click);
            this.dateTimePickerFrom.Enabled  = false;
            this.dateTimePickerFrom.Location = new Point(0x40, 0x63);
            this.dateTimePickerFrom.Name     = "dateTimePickerFrom";
            this.dateTimePickerFrom.Size     = new Size(200, 20);
            this.dateTimePickerFrom.TabIndex = 4;
            this.dateTimePickerTo.Enabled    = false;
            this.dateTimePickerTo.Location   = new Point(0x40, 0x86);
            this.dateTimePickerTo.Name       = "dateTimePickerTo";
            this.dateTimePickerTo.Size       = new Size(200, 20);
            this.dateTimePickerTo.TabIndex   = 5;
            this.labelFrom.AutoSize          = true;
            this.labelFrom.Location          = new Point(0x19, 0x66);
            this.labelFrom.Name     = "labelFrom";
            this.labelFrom.Size     = new Size(0x21, 13);
            this.labelFrom.TabIndex = 6;
            this.labelFrom.Text     = "From:";
            this.labelTo.AutoSize   = true;
            this.labelTo.Location   = new Point(0x23, 0x89);
            this.labelTo.Name       = "labelTo";
            this.labelTo.Size       = new Size(0x17, 13);
            this.labelTo.TabIndex   = 7;
            this.labelTo.Text       = "To:";
            this.radioButtonEntireConversation.AutoSize = true;
            this.radioButtonEntireConversation.Location = new Point(0x12, 0x29);
            this.radioButtonEntireConversation.Name     = "radioButtonEntireConversation";
            this.radioButtonEntireConversation.Size     = new Size(0x8d, 0x11);
            this.radioButtonEntireConversation.TabIndex = 8;
            this.radioButtonEntireConversation.Text     = "Print Entire Conversation";
            this.radioButtonEntireConversation.UseVisualStyleBackColor = true;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode       = AutoScaleMode.Font;
            base.ClientSize          = new Size(0x11c, 0xd4);
            base.Controls.Add(this.radioButtonEntireConversation);
            base.Controls.Add(this.labelTo);
            base.Controls.Add(this.labelFrom);
            base.Controls.Add(this.dateTimePickerTo);
            base.Controls.Add(this.dateTimePickerFrom);
            base.Controls.Add(this.buttonCancel);
            base.Controls.Add(this.buttonPrint);
            base.Controls.Add(this.radioButtonDate);
            base.Controls.Add(this.radioButtonDisplayed);
            base.Icon        = (Icon)manager.GetObject("$this.Icon");
            base.MaximizeBox = false;
            this.MaximumSize = new Size(300, 250);
            base.MinimizeBox = false;
            this.MinimumSize = new Size(300, 250);
            base.Name        = "fmPrintConversation";
            this.Text        = "Print Conversation";
            base.Load       += new EventHandler(this.fmPrintConversation_Load);
            base.ResumeLayout(false);
            base.PerformLayout();
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        public MetaTrader4Import()
        {
            LblIntro         = new Label();
            TxbDataDirectory = new TextBox();
            BtnBrowse        = new Button();
            PnlSettings      = new FancyPanel();
            PnlInfoBase      = new FancyPanel(Language.T("Imported Files"));
            TbxInfo          = new TextBox();
            BtnHelp          = new Button();
            BtnClose         = new Button();
            BtnImport        = new Button();
            ProgressBarFile  = new ProgressBar();
            ProgressBar      = new ProgressBar();
            LblDestFolder    = new Label();
            TxbDestFolder    = new TextBox();
            BtnDestFolder    = new Button();

            LblStartingDate = new Label();
            DtpStartingDate = new DateTimePicker();
            LblEndingDate   = new Label();
            DtpEndingDate   = new DateTimePicker();

            Color colorText = LayoutColors.ColorControlText;

            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            Icon            = Data.Icon;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AcceptButton    = BtnImport;
            CancelButton    = BtnClose;
            Text            = Language.T("MetaTrader 4 Import");

            // Label Intro
            LblIntro.Parent    = PnlSettings;
            LblIntro.ForeColor = colorText;
            LblIntro.BackColor = Color.Transparent;
            LblIntro.AutoSize  = true;
            LblIntro.Text      = Language.T("Directory containing MetaTrader 4 HST files:");

            // Data Directory
            TxbDataDirectory.Parent    = PnlSettings;
            TxbDataDirectory.BackColor = LayoutColors.ColorControlBack;
            TxbDataDirectory.ForeColor = colorText;
            TxbDataDirectory.Text      = Configs.MetaTrader4DataPath;

            // Button Browse
            BtnBrowse.Parent = PnlSettings;
            BtnBrowse.Name   = "Browse";
            BtnBrowse.Text   = Language.T("Browse");
            BtnBrowse.Click += BtnBrowseClick;
            BtnBrowse.UseVisualStyleBackColor = true;

            // Label Starting Date
            LblStartingDate.Parent    = PnlSettings;
            LblStartingDate.ForeColor = colorText;
            LblStartingDate.BackColor = Color.Transparent;
            LblStartingDate.AutoSize  = true;
            LblStartingDate.Text      = Language.T("Starting Date:");

            // Starting Date
            DtpStartingDate.Parent     = PnlSettings;
            DtpStartingDate.ForeColor  = LayoutColors.ColorCaptionText;
            DtpStartingDate.ShowUpDown = true;

            // Label Ending Date
            LblEndingDate.Parent    = PnlSettings;
            LblEndingDate.ForeColor = colorText;
            LblEndingDate.BackColor = Color.Transparent;
            LblEndingDate.AutoSize  = true;
            LblEndingDate.Text      = Language.T("Ending Date:");

            // Ending Date
            DtpEndingDate.Parent     = PnlSettings;
            DtpEndingDate.ForeColor  = LayoutColors.ColorCaptionText;
            DtpEndingDate.ShowUpDown = true;

            // LblDestFolder
            LblDestFolder.Parent    = PnlSettings;
            LblDestFolder.ForeColor = LayoutColors.ColorControlText;
            LblDestFolder.BackColor = Color.Transparent;
            LblDestFolder.AutoSize  = true;
            LblDestFolder.Text      = Language.T("Select a destination folder") + ":";

            // TxbDestFolder
            TxbDestFolder.Parent    = PnlSettings;
            TxbDestFolder.BackColor = LayoutColors.ColorControlBack;
            TxbDestFolder.ForeColor = LayoutColors.ColorControlText;
            TxbDestFolder.Text      = String.IsNullOrEmpty(Configs.MT4ImportDestFolder)
                                     ? Data.OfflineDataDir
                                     : Configs.MT4ImportDestFolder;

            // BtnDestFolder
            BtnDestFolder.Parent = PnlSettings;
            BtnDestFolder.Name   = "BtnDestFolder";
            BtnDestFolder.Text   = Language.T("Browse");
            BtnDestFolder.Click += BtnDestFolderClick;
            BtnDestFolder.UseVisualStyleBackColor = true;

            // PnlSettings
            PnlSettings.Parent = this;

            // PnlInfoBase
            PnlInfoBase.Parent  = this;
            PnlInfoBase.Padding = new Padding(4, (int)PnlInfoBase.CaptionHeight, 2, 2);

            // TbxInfo
            TbxInfo.Parent        = PnlInfoBase;
            TbxInfo.BorderStyle   = BorderStyle.None;
            TbxInfo.Dock          = DockStyle.Fill;
            TbxInfo.BackColor     = LayoutColors.ColorControlBack;
            TbxInfo.ForeColor     = LayoutColors.ColorControlText;
            TbxInfo.Multiline     = true;
            TbxInfo.AcceptsReturn = true;
            TbxInfo.AcceptsTab    = true;
            TbxInfo.ScrollBars    = ScrollBars.Vertical;

            // ProgressBarFile
            ProgressBarFile.Parent = this;

            // ProgressBar
            ProgressBar.Parent = this;

            // Button Help
            BtnHelp.Parent = this;
            BtnHelp.Name   = "Help";
            BtnHelp.Text   = Language.T("Help");
            BtnHelp.Click += BtnHelpClick;
            BtnHelp.UseVisualStyleBackColor = true;

            // Button Close
            BtnClose.Parent                  = this;
            BtnClose.Text                    = Language.T("Close");
            BtnClose.DialogResult            = DialogResult.Cancel;
            BtnClose.UseVisualStyleBackColor = true;

            // Button Import
            BtnImport.Parent = this;
            BtnImport.Name   = "Import";
            BtnImport.Text   = Language.T("Import");
            BtnImport.Click += BtnImportClick;
            BtnImport.UseVisualStyleBackColor = true;

            // BackGroundWorker
            bgWorker = new BackgroundWorker {
                WorkerReportsProgress = true, WorkerSupportsCancellation = true
            };
            bgWorker.DoWork             += BgWorkerDoWork;
            bgWorker.RunWorkerCompleted += BgWorkerRunWorkerCompleted;
        }
Esempio n. 30
0
 private void InitializeComponent()
 {
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
     this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
     this.label1          = new System.Windows.Forms.Label();
     this.dataGridView1   = new System.Windows.Forms.DataGridView();
     this.Column5         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column6         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column2         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Description     = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column8         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column1         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column3         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column4         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.Column7         = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
     this.label12         = new System.Windows.Forms.Label();
     this.groupBox1       = new System.Windows.Forms.GroupBox();
     this.labelStock      = new System.Windows.Forms.Label();
     this.panel1          = new System.Windows.Forms.Panel();
     this.radioButton3    = new System.Windows.Forms.RadioButton();
     this.radioButton2    = new System.Windows.Forms.RadioButton();
     this.radioButton1    = new System.Windows.Forms.RadioButton();
     this.buttonPrint     = new System.Windows.Forms.Button();
     this.buttonSave      = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
     this.groupBox1.SuspendLayout();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // dateTimePicker2
     //
     this.dateTimePicker2.CustomFormat  = "dd-MM-yyyy";
     this.dateTimePicker2.Font          = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.dateTimePicker2.Format        = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dateTimePicker2.Location      = new System.Drawing.Point(249, 15);
     this.dateTimePicker2.Name          = "dateTimePicker2";
     this.dateTimePicker2.Size          = new System.Drawing.Size(85, 22);
     this.dateTimePicker2.TabIndex      = 44;
     this.dateTimePicker2.ValueChanged += new System.EventHandler(this.dateTimePicker2_ValueChanged);
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.BackColor = System.Drawing.Color.DarkSeaGreen;
     this.label1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.Location  = new System.Drawing.Point(176, 20);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(64, 16);
     this.label1.TabIndex  = 43;
     this.label1.Text      = "End Date";
     //
     // dataGridView1
     //
     this.dataGridView1.AllowUserToAddRows            = false;
     this.dataGridView1.BackgroundColor               = System.Drawing.Color.DarkSeaGreen;
     this.dataGridView1.BorderStyle                   = System.Windows.Forms.BorderStyle.None;
     dataGridViewCellStyle2.Alignment                 = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
     dataGridViewCellStyle2.BackColor                 = System.Drawing.SystemColors.Control;
     dataGridViewCellStyle2.Font                      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     dataGridViewCellStyle2.ForeColor                 = System.Drawing.SystemColors.WindowText;
     dataGridViewCellStyle2.SelectionBackColor        = System.Drawing.SystemColors.Highlight;
     dataGridViewCellStyle2.SelectionForeColor        = System.Drawing.SystemColors.HighlightText;
     dataGridViewCellStyle2.WrapMode                  = System.Windows.Forms.DataGridViewTriState.True;
     this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
     this.dataGridView1.ColumnHeadersHeightSizeMode   = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
         this.Column5,
         this.Column6,
         this.Column2,
         this.Description,
         this.Column8,
         this.Column1,
         this.Column3,
         this.Column4,
         this.Column7
     });
     this.dataGridView1.Location = new System.Drawing.Point(6, 39);
     this.dataGridView1.Name     = "dataGridView1";
     this.dataGridView1.ReadOnly = true;
     this.dataGridView1.Size     = new System.Drawing.Size(1014, 460);
     this.dataGridView1.TabIndex = 42;
     this.dataGridView1.RowHeaderMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_RowHeaderMouseDoubleClick);
     //
     // Column5
     //
     this.Column5.HeaderText = "S/N";
     this.Column5.Name       = "Column5";
     this.Column5.ReadOnly   = true;
     this.Column5.Width      = 40;
     //
     // Column6
     //
     this.Column6.HeaderText = "Model";
     this.Column6.Name       = "Column6";
     this.Column6.ReadOnly   = true;
     //
     // Column2
     //
     this.Column2.FillWeight = 250F;
     this.Column2.HeaderText = "Parts No";
     this.Column2.Name       = "Column2";
     this.Column2.ReadOnly   = true;
     this.Column2.Width      = 200;
     //
     // Description
     //
     this.Description.HeaderText = "Description";
     this.Description.Name       = "Description";
     this.Description.ReadOnly   = true;
     this.Description.Width      = 250;
     //
     // Column8
     //
     this.Column8.HeaderText = "Opening";
     this.Column8.Name       = "Column8";
     this.Column8.ReadOnly   = true;
     this.Column8.Width      = 80;
     //
     // Column1
     //
     this.Column1.FillWeight = 110F;
     this.Column1.HeaderText = "Received";
     this.Column1.Name       = "Column1";
     this.Column1.ReadOnly   = true;
     this.Column1.Width      = 80;
     //
     // Column3
     //
     this.Column3.FillWeight = 50F;
     this.Column3.HeaderText = "Total";
     this.Column3.Name       = "Column3";
     this.Column3.ReadOnly   = true;
     this.Column3.Width      = 60;
     //
     // Column4
     //
     this.Column4.FillWeight = 80F;
     this.Column4.HeaderText = "Sale";
     this.Column4.Name       = "Column4";
     this.Column4.ReadOnly   = true;
     this.Column4.Width      = 60;
     //
     // Column7
     //
     this.Column7.HeaderText = "Closing";
     this.Column7.Name       = "Column7";
     this.Column7.ReadOnly   = true;
     this.Column7.Width      = 80;
     //
     // dateTimePicker1
     //
     this.dateTimePicker1.CustomFormat  = "dd-MM-yyyy";
     this.dateTimePicker1.Font          = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.dateTimePicker1.Format        = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dateTimePicker1.Location      = new System.Drawing.Point(84, 15);
     this.dateTimePicker1.Name          = "dateTimePicker1";
     this.dateTimePicker1.Size          = new System.Drawing.Size(85, 22);
     this.dateTimePicker1.TabIndex      = 38;
     this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
     //
     // label12
     //
     this.label12.AutoSize  = true;
     this.label12.BackColor = System.Drawing.Color.DarkSeaGreen;
     this.label12.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label12.Location  = new System.Drawing.Point(10, 20);
     this.label12.Name      = "label12";
     this.label12.Size      = new System.Drawing.Size(67, 16);
     this.label12.TabIndex  = 37;
     this.label12.Text      = "Start Date";
     //
     // groupBox1
     //
     this.groupBox1.BackColor = System.Drawing.Color.DarkSeaGreen;
     this.groupBox1.Controls.Add(this.buttonSave);
     this.groupBox1.Controls.Add(this.labelStock);
     this.groupBox1.Controls.Add(this.panel1);
     this.groupBox1.Controls.Add(this.buttonPrint);
     this.groupBox1.Controls.Add(this.dateTimePicker2);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Controls.Add(this.dataGridView1);
     this.groupBox1.Controls.Add(this.dateTimePicker1);
     this.groupBox1.Controls.Add(this.label12);
     this.groupBox1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox1.Location = new System.Drawing.Point(5, 5);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(1028, 505);
     this.groupBox1.TabIndex = 3;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Monthly Stock Report";
     //
     // labelStock
     //
     this.labelStock.AutoSize  = true;
     this.labelStock.BackColor = System.Drawing.Color.DarkSeaGreen;
     this.labelStock.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.labelStock.Location  = new System.Drawing.Point(912, 18);
     this.labelStock.Name      = "labelStock";
     this.labelStock.Size      = new System.Drawing.Size(45, 16);
     this.labelStock.TabIndex  = 49;
     this.labelStock.Text      = "Total: ";
     //
     // panel1
     //
     this.panel1.Controls.Add(this.radioButton3);
     this.panel1.Controls.Add(this.radioButton2);
     this.panel1.Controls.Add(this.radioButton1);
     this.panel1.Location = new System.Drawing.Point(353, 15);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(347, 22);
     this.panel1.TabIndex = 46;
     //
     // radioButton3
     //
     this.radioButton3.AutoSize = true;
     this.radioButton3.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.radioButton3.Location = new System.Drawing.Point(213, 1);
     this.radioButton3.Name     = "radioButton3";
     this.radioButton3.Size     = new System.Drawing.Size(54, 20);
     this.radioButton3.TabIndex = 2;
     this.radioButton3.TabStop  = true;
     this.radioButton3.Text     = "Zero";
     this.radioButton3.UseVisualStyleBackColor = true;
     this.radioButton3.CheckedChanged         += new System.EventHandler(this.radioButton3_CheckedChanged);
     //
     // radioButton2
     //
     this.radioButton2.AutoSize = true;
     this.radioButton2.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.radioButton2.Location = new System.Drawing.Point(90, 1);
     this.radioButton2.Name     = "radioButton2";
     this.radioButton2.Size     = new System.Drawing.Size(83, 20);
     this.radioButton2.TabIndex = 1;
     this.radioButton2.TabStop  = true;
     this.radioButton2.Text     = "Available";
     this.radioButton2.UseVisualStyleBackColor = true;
     this.radioButton2.CheckedChanged         += new System.EventHandler(this.radioButton2_CheckedChanged);
     //
     // radioButton1
     //
     this.radioButton1.AutoSize = true;
     this.radioButton1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.radioButton1.Location = new System.Drawing.Point(4, 1);
     this.radioButton1.Name     = "radioButton1";
     this.radioButton1.Size     = new System.Drawing.Size(41, 20);
     this.radioButton1.TabIndex = 0;
     this.radioButton1.TabStop  = true;
     this.radioButton1.Text     = "All";
     this.radioButton1.UseVisualStyleBackColor = true;
     this.radioButton1.CheckedChanged         += new System.EventHandler(this.radioButton1_CheckedChanged);
     //
     // buttonPrint
     //
     this.buttonPrint.BackColor = System.Drawing.Color.MediumSeaGreen;
     this.buttonPrint.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonPrint.Location  = new System.Drawing.Point(712, 11);
     this.buttonPrint.Name      = "buttonPrint";
     this.buttonPrint.Size      = new System.Drawing.Size(75, 27);
     this.buttonPrint.TabIndex  = 48;
     this.buttonPrint.Text      = "Print";
     this.buttonPrint.UseVisualStyleBackColor = false;
     this.buttonPrint.Click += new System.EventHandler(this.buttonPrint_Click);
     //
     // buttonSave
     //
     this.buttonSave.BackColor = System.Drawing.Color.MediumSeaGreen;
     this.buttonSave.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonSave.Location  = new System.Drawing.Point(793, 11);
     this.buttonSave.Name      = "buttonSave";
     this.buttonSave.Size      = new System.Drawing.Size(75, 27);
     this.buttonSave.TabIndex  = 50;
     this.buttonSave.Text      = "Save";
     this.buttonSave.UseVisualStyleBackColor = false;
     this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
     //
     // StockPartsReport
     //
     this.BackColor  = System.Drawing.Color.MediumSeaGreen;
     this.ClientSize = new System.Drawing.Size(1037, 516);
     this.Controls.Add(this.groupBox1);
     this.Name          = "StockPartsReport";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Stock Report Parts Monthly";
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.ResumeLayout(false);
 }
Esempio n. 31
0
 public override void addcustomer(TextBox customerid, TextBox name, TextBox faname, TextBox dob, ComboBox sex, TextBox pincode, TextBox cellnum, TextBox cntry, TextBox cit, TextBox adress, TextBox stret, TextBox em, TextBox zip, TextBox depo, DateTimePicker dtp)
 {
     base.addcustomer(customerid, name, faname, dob, sex, pincode, cellnum, cntry, cit, adress, stret, em, zip, depo, dtp);
 }
Esempio n. 32
0
        public frmFilter(Form parent, DataGridView dg, IKeptable keeper)
        {
            InitializeComponent();
            //Let's create filter columns based on given data grid view
            _this  = new Filter();
            Keeper = keeper;
            int i = 0;

            foreach (DataGridViewColumn col in dg.Columns)
            {
                FilterColumnValueType cType;
                if (col.ValueType == typeof(int) || col.ValueType == typeof(float) || col.ValueType == typeof(Nullable <int>) || col.ValueType == typeof(Nullable <float>) || col.ValueType == typeof(decimal) || col.ValueType == typeof(Nullable <decimal>))
                {
                    cType = FilterColumnValueType.Number;
                }
                else if (col.ValueType == typeof(DateTime) || col.ValueType == typeof(Nullable <DateTime>))
                {
                    cType = FilterColumnValueType.Date;
                }
                else if (col.ValueType == typeof(Boolean) || col.ValueType == typeof(Nullable <Boolean>))
                {
                    cType = FilterColumnValueType.Boolean;
                }
                else
                {
                    cType = FilterColumnValueType.Text;
                }
                FilterColumn nCol = new FilterColumn(col.Name, _this, cType, i, col.HeaderText);
                i++;
            }

            if (_this != null && _this.Columns.Any())
            {
                tlpItems.RowStyles.Clear();
                int counter = 0;

                foreach (FilterColumn col in _this.Columns)
                {
                    int rowIndex = 0;
                    if (counter > 0)
                    {
                        rowIndex = AddTableRow();
                    }


                    Label nLabel = new Label();
                    nLabel.Text = col.Text;
                    tlpItems.Controls.Add(nLabel, 0, rowIndex);
                    nLabel.Anchor = (AnchorStyles.Left | AnchorStyles.Right);
                    List <string> Options = new List <string>();

                    ComboBox nComb = new ComboBox();
                    nComb.Name = "RangeCombo" + counter;

                    if (col.Type == FilterColumnType.List)
                    {
                        Options.Add("Zawiera");
                        Options.Add("Nie zawiera");
                        ComboBox nCombo = new ComboBox();
                        nCombo.Name                  = col.Name;
                        nCombo.DataSource            = col.Items;
                        nCombo.ValueMember           = "ValueMember";
                        nCombo.DisplayMember         = "DisplayMember";
                        nCombo.SelectedIndexChanged += new EventHandler(nCombobox_SelectedIndexChanged);
                        tlpItems.Controls.Add(nCombo, 2, rowIndex);
                        nCombo.Anchor          = (AnchorStyles.Left | AnchorStyles.Right);
                        nCombo.SelectionLength = 0;
                    }
                    else
                    {
                        if (col.ValueType == FilterColumnValueType.Date)
                        {
                            DateTimePicker nDTPicker = new DateTimePicker();
                            nDTPicker.Name          = col.Name;
                            nDTPicker.CustomFormat  = " ";
                            nDTPicker.ValueChanged += new EventHandler(nDTPicker_ValueChanged);
                            nDTPicker.Format        = DateTimePickerFormat.Custom;
                            tlpItems.Controls.Add(nDTPicker, 2, rowIndex);
                            nDTPicker.Anchor = (AnchorStyles.Left | AnchorStyles.Right);
                            Options.Add("Jest równe");
                            Options.Add("Wcześniej niż");
                            Options.Add("Później niż");
                            Options.Add("Jest puste");
                            Options.Add("Nie jest puste");
                        }
                        else if (col.ValueType == FilterColumnValueType.Boolean)
                        {
                            CheckBox nCheckBox = new CheckBox();
                            nCheckBox.CheckState = CheckState.Indeterminate;
                            nCheckBox.Name       = col.Name;
                            tlpItems.Controls.Add(nCheckBox, 1, rowIndex);
                        }
                        else
                        {
                            TextBox nText = new TextBox();
                            nText.Name = col.Name;
                            tlpItems.Controls.Add(nText, 2, rowIndex);
                            nText.Anchor = (AnchorStyles.Left | AnchorStyles.Right);
                            if (col.ValueType == FilterColumnValueType.Text)
                            {
                                Options.Add("Zawiera");
                                Options.Add("Nie zawiera");
                                Options.Add("Jest równe");
                                Options.Add("Jest różne od");
                                Options.Add("Jest puste");
                                Options.Add("Nie jest puste");
                            }
                            else if (col.ValueType == FilterColumnValueType.Boolean)
                            {
                                Options.Add("Jest równe");
                                Options.Add("Jest różne od");
                            }
                            else
                            {
                                Options.Add("Mniejsze lub równe niż");
                                Options.Add("Mniejsze niż");
                                Options.Add("Jest równe");
                                Options.Add("Jest różne od");
                                Options.Add("Większe niż");
                                Options.Add("Większe lub równe niż");
                                Options.Add("Jest puste");
                                Options.Add("Nie jest puste");
                            }
                        }
                    }
                    if (Options.Any())
                    {
                        nComb.DataSource            = Options;
                        nComb.Name                  = "cmbOptions" + col.Ordinal;
                        nComb.SelectedIndexChanged += new EventHandler(nCombobox_SelectedIndexChanged);
                        tlpItems.Controls.Add(nComb, 1, rowIndex);
                        nComb.Anchor          = (AnchorStyles.Left | AnchorStyles.Right);
                        nComb.SelectionLength = 0;
                    }

                    counter++;
                }
            }
        }
        private System.Web.UI.Control GetVariableEditor(Hashtable variable)
        {
            object value = variable["Value"];
            string name = (string) variable["Name"];
            string editor = variable["Editor"] as string;
            Type type = value.GetType();

            if (type == typeof (DateTime) ||
                (!string.IsNullOrEmpty(editor) &&
                 (editor.IndexOf("date", StringComparison.OrdinalIgnoreCase) > -1 ||
                  editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var dateTimePicker = new DateTimePicker
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    ShowTime = (variable["ShowTime"] != null && (bool) variable["ShowTime"]) ||
                               (!string.IsNullOrEmpty(editor) &&
                                editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1),
                };
                dateTimePicker.Value = value is DateTime ? DateUtil.ToIsoDate((DateTime)value) : (string)value;
                return dateTimePicker;
            }

            if (type == typeof (Item) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("item", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var item = (Item) value;
                var dataContext = new DataContext
                {
                    DefaultItem = item.Paths.Path,
                    ID = Control.GetUniqueID("dataContext"),
                    DataViewName = "Master",
                    Root = variable["Root"] as string ?? "/sitecore",
                    Parameters = "databasename=" + item.Database.Name,
                    Database = item.Database.Name,
                    Selected = new[] {new DataUri(item.ID, item.Language, item.Version)},
                    Folder = item.ID.ToString(),
                    Language = item.Language,
                    Version = item.Version
                };
                DataContextPanel.Controls.Add(dataContext);

                var treePicker = new TreePicker
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    Value = item.ID.ToString(),
                    DataContext = dataContext.ID
                };
                treePicker.Class += " treePicker";
                return treePicker;
            }

            if (type == typeof(bool) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("bool", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var checkBox = new Checkbox
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    Header = (string) variable["Title"],
                    HeaderStyle = "margin-top:20px; display:inline-block;",
                    Checked = (bool) value
                };
                checkBox.Class = "varCheckbox";
                return checkBox;
            }

            if (!string.IsNullOrEmpty(editor))
            {
                bool showRoles = editor.IndexOf("role", StringComparison.OrdinalIgnoreCase) > -1;
                bool showUsers = editor.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
                bool multiple = editor.IndexOf("multiple", StringComparison.OrdinalIgnoreCase) > -1;
                if (showRoles || showUsers)
                {
                    UserPicker picker = new UserPicker();
                    picker.Style.Add("float", "left");
                    picker.ID = Control.GetUniqueID("variable_" + name + "_");
                    picker.Class += " scContentControl textEdit clr" + value.GetType().Name;
                    picker.Value = value.ToString();
                    picker.ExcludeRoles = !showRoles;
                    picker.ExcludeUsers = !showUsers;
                    picker.DomainName = variable["Domain"] as string ?? variable["DomainName"] as string;
                    picker.Multiple = multiple;
                    picker.Click = "UserPickerClick(" + picker.ID + ")";
                    return picker;
                }
            }

            Control edit;
            if (variable["lines"] != null && ((int)variable["lines"] > 1))
            {
                edit = new Memo();
                edit.Attributes.Add("rows", variable["lines"].ToString());
            }
            else if (variable["Options"] != null)
            {
                edit = new Combobox();
                string[] options = ((string) variable["Options"]).Split('|');
                int i = 0;
                while (i < options.Length)
                {
                    var item = new ListItem()
                    {
                        Header = options[i++],
                        Value = options[i++],
                    };
                    edit.Controls.Add(item);
                }
            }
            else
            {
                edit = new Edit();
            }
            if (!string.IsNullOrEmpty((string)variable["Tooltip"]))
            {
                edit.ToolTip = (string)variable["Tooltip"];
            }
            edit.Style.Add("float", "left");
            edit.ID = Control.GetUniqueID("variable_" + name + "_");
            edit.Class += " scContentControl textEdit clr"+value.GetType().Name;
            edit.Value = value.ToString();

            return edit;
        }
Esempio n. 34
0
        public void insertEmployee(TextBox id, TextBox fname, TextBox lname, TextBox email, DateTimePicker joinDate, TextBox mobile, DateTimePicker dateofBirth, TextBox address, TextBox salary, TextBox jobType, TextBox image)
        {
            Emp e = new Emp();

            e.Id     = int.Parse(id.Text);
            e.F_Name = fname.Text;
            e.L_Name = lname.Text;
            e.Email  = email.Text;
            string jD = joinDate.Value.Date.ToString("dd.MM.yyyy");

            e.JoinDate = jD;
            e.Mobile   = mobile.Text;
            string doB = dateofBirth.Value.Date.ToString("dd.MM.yyyy");

            e.DateofBirth = doB;

            e.Address = address.Text;
            e.Salary  = float.Parse(salary.Text);
            e.JobType = jobType.Text;
            e.Image   = image.Text;

            con.Emps.InsertOnSubmit(e);
            con.SubmitChanges();
        }
    public EstimatedDeliveryTimeTabPage()
    {
        this.Text = "Estimated Delivery Time";

        if (File.Exists(this.EstimatedDeliveryTimeTxtPath))
        {
            edtc = new EstimatedDeliveryTimeCalculator(
                this.EstimatedDeliveryTimeTxtPath);
            calBtn = new Button();
            rstBtn = new Button();
            OrigCountryCombo = new ComboBox();
            DestCountryCombo = new ComboBox();
            lblOrigCountry = new Label();
            lblDestCountry = new Label();
            lblDate = new Label();
            lblError = new Label();
            datePicker = new DateTimePicker();

            calBtn.Text = "Calculate";
            calBtn.Size = new Size(75, 23);

            rstBtn.Text = "Reset";
            rstBtn.Size = new Size(75, 23);
            this.rstBtn.Click += new EventHandler(rstBtn_Click);

            edtc.InitOriginCountriesComboBox(OrigCountryCombo);
            OrigCountryCombo.SelectedIndex = 0;
            // init the locations box.
            OrigCountryCombo_SelectedIndexChanged(null, null);

            lblOrigCountry.Text = "Origin Country: ";
            lblOrigCountry.Location = new Point(6, 41);
            OrigCountryCombo.Location = new Point(135, 41);

            lblDestCountry.Text = "Destination Country: ";
            lblDestCountry.Size = new Size(110,23);
            lblDestCountry.Location = new Point(6, 78);
            DestCountryCombo.Location = new Point(135, 78);
            DestCountryCombo.SelectedIndex = 0;

            lblDate.Text = "Date(DD/MM/YYYY)";
            lblDate.Location = new Point(6, 117);
            lblDate.Size = new Size(114, 18);

            lblError.Text = "";
            lblError.ForeColor = Color.Red;
            lblError.Location = new Point(6, 250);
            lblError.Size = new Size(400, 18);

            datePicker.Location = new Point(135, 117);
            datePicker.Name = "dateTimePicker";
            datePicker.Size = new Size(140, 20);
            datePicker.CustomFormat = "dd/MM/yyyy";
            datePicker.Format = DateTimePickerFormat.Custom;
            datePicker.MaxDate = new DateTime(2020, 12, 31, 0, 0, 0, 0);
            datePicker.MinDate = new DateTime(2010, 3, 1, 0, 0, 0, 0);
            datePicker.ValueChanged += new EventHandler(dateTimePicker_ValueChanged);

            calBtn.Location = new Point(6, 195);
            calBtn.Size = new Size(75, 23);
            rstBtn.Location = new Point(135, 195);
            rstBtn.Size = new Size(75, 23);

            OrigCountryCombo.SelectedIndexChanged += new EventHandler(OrigCountryCombo_SelectedIndexChanged);
            DestCountryCombo.SelectedIndexChanged += new EventHandler(DestCountryCombo_SelectedIndexChanged);
            calBtn.Click += new EventHandler(calBtn_Click);
            rstBtn.Click += new EventHandler(rstBtn_Click);

            this.Controls.Add(calBtn);
            this.Controls.Add(rstBtn);
            this.Controls.Add(datePicker);
            this.Controls.Add(OrigCountryCombo);
            this.Controls.Add(DestCountryCombo);
            this.Controls.Add(lblOrigCountry);
            this.Controls.Add(lblDestCountry);
            this.Controls.Add(lblDate);
            this.Controls.Add(lblError);
        }
        else
        {
            Label lblError = new Label();
            lblError.Text = this.EstimatedDeliveryTimeTxtPath +
                " is not found alongside with this program. Feature disabled.";
            lblError.Size = new Size(500, 30);
            lblError.Location = new Point(50, 130);
            this.Controls.Add(lblError);
        }
    }
Esempio n. 36
0
        public void updateCustomer(TextBox id, TextBox fname, TextBox lname, TextBox email, TextBox mobile, TextBox address, TextBox carId, DateTimePicker byingDate)
        {
            var str = from a in con.Customers
                      where a.Id == int.Parse(id.Text)
                      select a;

            Customer cus = str.First();

            cus.F_Name  = fname.Text;
            cus.L_Name  = lname.Text;
            cus.Email   = email.Text;
            cus.Mobile  = mobile.Text;
            cus.Address = address.Text;
            string bdate = byingDate.Value.Date.ToString("dd.MM.yyyy");

            cus.Buying_Date = bdate;

            con.SubmitChanges();
        }
        private void fillCommonProperties()
        {
            try
            {
                int index;

                foreach (var tz in TimeZoneInfo.GetSystemTimeZones())
                    cboTimeZone.Items.Add(tz);

                cboSoundFile.Items.Add(PNSchedule.DEF_SOUND);
                if (Directory.Exists(PNPaths.Instance.SoundsDir))
                {
                    var fi = new DirectoryInfo(PNPaths.Instance.SoundsDir).GetFiles("*.wav");
                    foreach (
                        var fName in
                            from f in fi
                            where !string.IsNullOrEmpty(f.Name)
                            select Path.GetFileNameWithoutExtension(f.Name))
                    {
                        cboSoundFile.Items.Add(fName);
                    }
                }

                foreach (var s in PNStatic.Voices)
                {
                    cboSoundText.Items.Add(s);
                }
                chkTrak.IsChecked = !_Schedule.Track;
                optSoundFile.IsChecked = !_Schedule.UseTts;
                optSoundText.IsChecked = _Schedule.UseTts;
                chkRepeat.IsChecked = _Schedule.SoundInLoop;
                if (!_Schedule.UseTts)
                {
                    index = cboSoundFile.Items.IndexOf(_Schedule.Sound);
                    cboSoundFile.SelectedIndex = index > -1 ? index : 0;
                }
                else
                {
                    index = cboSoundText.Items.IndexOf(_Schedule.Sound);
                    cboSoundText.SelectedIndex = index > -1 ? index : 0;
                }
                cboStopAlert.SelectedIndex = _StopValues.ContainsValue(_Schedule.StopAfter)
                    ? _StopValues.FirstOrDefault(sv => sv.Value == _Schedule.StopAfter).Key
                    : 0;
                cboRunExternal.Items.Add(PNLang.Instance.GetControlText("noExternal", "(Run nothing)"));
                foreach (var ext in PNStatic.Externals)
                {
                    cboRunExternal.Items.Add(ext.Name);
                }
                index = cboRunExternal.Items.IndexOf(_Schedule.ProgramToRunOnAlert);
                cboRunExternal.SelectedIndex = index > 0 ? index : 0;

                chkHideUntilAlert.IsChecked = _Schedule.CloseOnNotification;

                chkW0.Content = _DayNamesAbbr[0];
                chkW0.Tag = _DaysOfWeek[0];
                chkW1.Content = _DayNamesAbbr[1];
                chkW1.Tag = _DaysOfWeek[1];
                chkW2.Content = _DayNamesAbbr[2];
                chkW2.Tag = _DaysOfWeek[2];
                chkW3.Content = _DayNamesAbbr[3];
                chkW3.Tag = _DaysOfWeek[3];
                chkW4.Content = _DayNamesAbbr[4];
                chkW4.Tag = _DaysOfWeek[4];
                chkW5.Content = _DayNamesAbbr[5];
                chkW5.Tag = _DaysOfWeek[5];
                chkW6.Content = _DayNamesAbbr[6];
                chkW6.Tag = _DaysOfWeek[6];

                cboExactDate.SelectedIndex = 0;

                foreach (var dwr in _DwRealFull)
                {
                    cboDW.Items.Add(dwr);
                }
                cboDW.SelectedIndex = 0;
                cboOrdinal.SelectedIndex = 0;

                switch (_Schedule.Type)
                {
                    case ScheduleType.Once:
                        dtpOnce.DateValue = _Schedule.AlarmDate;
                        break;
                    case ScheduleType.RepeatEvery:
                        dtpRepeat.DateValue = _Schedule.StartDate;
                        updRepeatYears.Value = _Schedule.AlarmAfter.Years;
                        updRepeatMonths.Value = _Schedule.AlarmAfter.Months;
                        updRepeatWeeks.Value = _Schedule.AlarmAfter.Weeks;
                        updRepeatDays.Value = _Schedule.AlarmAfter.Days;
                        updRepeatHours.Value = _Schedule.AlarmAfter.Hours;
                        updRepeatMinutes.Value = _Schedule.AlarmAfter.Minutes;
                        updRepeatSeconds.Value = _Schedule.AlarmAfter.Seconds;
                        if (_Schedule.StartFrom == ScheduleStart.ExactTime)
                        {
                            optRepeatExact.IsChecked = true;
                            dtpEvery.DateValue = _Schedule.StartDate;
                        }
                        else
                        {
                            optRepeatProgram.IsChecked = true;
                            dtpEvery.IsEnabled = false;
                        }
                        break;
                    case ScheduleType.After:
                        dtpAfter.DateValue = _Schedule.StartDate;
                        updAfterYears.Value = _Schedule.AlarmAfter.Years;
                        updAfterMonths.Value = _Schedule.AlarmAfter.Months;
                        updAfterWeeks.Value = _Schedule.AlarmAfter.Weeks;
                        updAfterDays.Value = _Schedule.AlarmAfter.Days;
                        updAfterHours.Value = _Schedule.AlarmAfter.Hours;
                        updAfterMinutes.Value = _Schedule.AlarmAfter.Minutes;
                        updAfterSeconds.Value = _Schedule.AlarmAfter.Seconds;
                        if (_Schedule.StartFrom == ScheduleStart.ExactTime)
                        {
                            optAfterExact.IsChecked = true;
                            dtpAfter.DateValue = _Schedule.StartDate;
                        }
                        else
                        {
                            optAfterProgram.IsChecked = true;
                            dtpAfter.IsEnabled = false;
                        }
                        break;
                    case ScheduleType.EveryDay:
                        dtpEvery.DateValue = _Schedule.AlarmDate;
                        break;
                    case ScheduleType.Weekly:
                        dtpWeekly.DateValue = _Schedule.AlarmDate;
                        chkW0.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[0]);
                        chkW1.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[1]);
                        chkW2.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[2]);
                        chkW3.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[3]);
                        chkW4.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[4]);
                        chkW5.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[5]);
                        chkW6.IsChecked = _Schedule.Weekdays.Contains(_DaysOfWeek[6]);
                        break;
                    case ScheduleType.MonthlyDayOfWeek:
                        for (var i = 0; i < cboDW.Items.Count; i++)
                        {
                            var dwReal = cboDW.Items[i] as DwReal;
                            if (dwReal == null || dwReal.DayW != _Schedule.MonthDay.WeekDay) continue;
                            cboDW.SelectedIndex = i;
                            break;
                        }
                        cboOrdinal.SelectedIndex = (int)_Schedule.MonthDay.OrdinalNumber - 1;
                        dtpDW.DateValue = _Schedule.AlarmDate;
                        break;
                    case ScheduleType.MonthlyExact:
                        cboExactDate.SelectedIndex = _Schedule.AlarmDate.Day - 1;
                        dtpMonthExact.DateValue = _Schedule.AlarmDate;
                        break;
                    case ScheduleType.MultipleAlerts:
                        var alerts = _Schedule.MultiAlerts.OrderBy(a => a.Date).ToArray();
                        for (var i = 0; i < alerts.Length; i++)
                            grdAlerts.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
                        var row = 0;
                        foreach (var ma in alerts)
                        {
                            var dtp = new DateTimePicker
                            {
                                Format = DateBoxFormat.ShortDateAndShortTime,
                                DateValue = ma.Date,
                                VerticalAlignment = VerticalAlignment.Center,
                                Width = cboSoundFile.ActualWidth,
                                Margin = new Thickness(4)
                            };
                            if (ma.Raised)
                            {
                                dtp.BlackoutDates.Add(new CalendarDateRange(ma.Date));
                            }
                            var st = new StackPanel {Orientation = Orientation.Horizontal};
                            var check = new CheckBox
                            {
                                VerticalAlignment = VerticalAlignment.Center,
                                Margin = new Thickness(4)
                            };
                            check.Checked += check_Checked;
                            check.Unchecked += check_Unchecked;
                            st.Children.Add(check);
                            st.Children.Add(dtp);
                            Grid.SetRow(st, row++);
                            grdAlerts.Children.Add(st);
                        }
                        break;
                }

                for (var i = 0; i < cboTimeZone.Items.Count; i++)
                {
                    var tz = cboTimeZone.Items[i] as TimeZoneInfo;
                    if (tz == null || _Schedule.TimeZone.Id != tz.Id) continue;
                    cboTimeZone.SelectedIndex = i;
                    break;
                }
            }
            catch (Exception ex)
            {
                PNStatic.LogException(ex);
            }
        }
Esempio n. 38
0
        public void updateEmp(TextBox id, TextBox fname, TextBox lname, TextBox email, DateTimePicker joinDate, TextBox mobile, DateTimePicker dateofBirth, TextBox address, TextBox salary, TextBox jobType, TextBox image)
        {
            var str = from a in con.Emps
                      where a.Id == int.Parse(id.Text)
                      select a;
            Emp e = str.First();

            e.F_Name = fname.Text;
            e.L_Name = lname.Text;
            e.Email  = email.Text;
            string jD = joinDate.Value.Date.ToString("dd.MM.yyyy");

            e.JoinDate = jD;
            e.Mobile   = mobile.Text;
            string doB = dateofBirth.Value.Date.ToString("dd.MM.yyyy");

            e.DateofBirth = doB;
            e.Address     = address.Text;
            e.Salary      = float.Parse(salary.Text);
            e.JobType     = jobType.Text;
            e.Image       = image.Text;
            con.SubmitChanges();
        }
Esempio n. 39
0
        /// <summary>
        /// Creates Control control from given IXAttribute.
        /// </summary>
        /// <param name="attribute">Given IXAttribute.</param>
        /// <returns>Label control according to given IXAttribute.</returns>
        internal Control GetControl(IXAttribute attribute)
        {
            var control = new Control();

            if (attribute is XAttribute <string> )
            {
                var stringAttribute = (XAttribute <string>)attribute;
                var textBox         = new TextBox();
                control = textBox;
                control.DataBindings.Add("Text", stringAttribute, "Value");
            }
            else if (attribute is XAttribute <int> )
            {
                var intAttribute  = (XAttribute <int>)attribute;
                var numericUpDown = new NumericUpDown();
                numericUpDown.DataBindings.Add("Value", intAttribute, "Value");
                control = numericUpDown;
            }
            else if (attribute is XAttribute <bool> )
            {
                var boolAttribute = (XAttribute <bool>)attribute;
                var checkBox      = new CheckBox();
                control = checkBox;
                checkBox.DataBindings.Add("Checked", boolAttribute, "Value");
            }
            else if (attribute is XAttribute <DateTime> )
            {
                var dateTimeAttribute = (XAttribute <DateTime>)attribute;
                var dateTimePicker    = new DateTimePicker();

                if (!dateTimeAttribute.Value.HasMeaning())
                {
                    dateTimeAttribute.Value = DateTime.Now;
                }

                dateTimePicker.DataBindings.Add("Value", dateTimeAttribute, "Value");
                control = dateTimePicker;
            }
            else if (attribute is XEnumerationAttribute <string> )
            {
                var enumerationAttribute = (XEnumerationAttribute <string>)attribute;
                var enumeration          = enumerationAttribute.Enumeration;

                var comboBox = new ComboBox();

                comboBox.BeginUpdate();
                comboBox.Items.Clear();
                foreach (var item in enumeration)
                {
                    comboBox.Items.Add(item);
                }
                comboBox.EndUpdate();

                comboBox.SelectedItem = enumerationAttribute.Value;
                comboBox.DataBindings.Add("Text", enumerationAttribute, "Value");
                control = comboBox;
            }

            control.Name = attribute.Name;
            control.Tag  = attribute;


            return(control);
        }
Esempio n. 40
0
        public void insertCustomer(TextBox id, TextBox fname, TextBox lname, TextBox email, TextBox mobile, TextBox address, TextBox carid, DateTimePicker bdate)
        {
            Customer cus = new Customer();

            cus.Id      = int.Parse(id.Text);
            cus.F_Name  = fname.Text;
            cus.L_Name  = lname.Text;
            cus.Email   = email.Text;
            cus.Mobile  = mobile.Text;
            cus.Address = address.Text;
            cus.CarId   = int.Parse(carid.Text);
            string Date = bdate.Value.Date.ToString("dd.MM.yyyy");

            cus.Buying_Date = Date;


            con.Customers.InsertOnSubmit(cus);
            con.SubmitChanges();
        }
    /// <summary>
    /// Load resources for calendar control.
    /// </summary>
    /// <param name="datePickerObject">Calendar control with settings</param>
    private void LoadResources(DateTimePicker datePickerObject)
    {
        if (Directory.Exists(Server.MapPath(datePickerObject.CustomCalendarSupportFolder)))
        {
            // Register JS files
            string[] files = Directory.GetFiles(Server.MapPath(datePickerObject.CustomCalendarSupportFolder), "*.js");
            string path = Server.MapPath("~/");
            foreach (string file in files)
            {
                string relative = "~/" + file.Substring(path.Length).Replace(@"\", "/"); ;
                ScriptHelper.RegisterScriptFile(Page, relative);
            }

            // Register CSS files
            files = Directory.GetFiles(Server.MapPath(datePickerObject.CustomCalendarSupportFolder), "*.css");
            foreach (string file in files)
            {
                string relative = "~/" + file.Substring(path.Length).Replace(@"\", "/"); ;
                CSSHelper.RegisterCSSLink(Page, relative);
            }
        }
    }
Esempio n. 42
0
        private void InitializeComponent()
        {
            DataGridViewCellStyle style  = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();

            this.comboBoxEmployee = new ComboBox();
            this.label1           = new Label();
            this.dataGridView1    = new DataGridView();
            this.Column1          = new DataGridViewTextBoxColumn();
            this.Column2          = new DataGridViewTextBoxColumn();
            this.Column3          = new DataGridViewTextBoxColumn();
            this.Column5          = new DataGridViewTextBoxColumn();
            this.Column4          = new DataGridViewTextBoxColumn();
            this.Column6          = new DataGridViewTextBoxColumn();
            this.buttonSearch     = new Button();
            this.dateTimePicker2  = new DateTimePicker();
            this.label2           = new Label();
            this.dateTimePicker1  = new DateTimePicker();
            this.label12          = new Label();
            ((ISupportInitialize)this.dataGridView1).BeginInit();
            base.SuspendLayout();
            this.comboBoxEmployee.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            this.comboBoxEmployee.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.comboBoxEmployee.BackColor          = SystemColors.ControlLight;
            this.comboBoxEmployee.Font = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.comboBoxEmployee.FormattingEnabled = true;
            this.comboBoxEmployee.Location          = new Point(0x37, 9);
            this.comboBoxEmployee.Name                  = "comboBoxEmployee";
            this.comboBoxEmployee.Size                  = new Size(0x127, 0x18);
            this.comboBoxEmployee.TabIndex              = 0x3d;
            this.comboBoxEmployee.SelectedIndexChanged += new EventHandler(this.comboBoxEmployee_SelectedIndexChanged);
            this.label1.AutoSize  = true;
            this.label1.BackColor = Color.MediumSeaGreen;
            this.label1.Font      = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.label1.Location  = new Point(10, 12);
            this.label1.Name      = "label1";
            this.label1.Size      = new Size(0x2d, 0x10);
            this.label1.TabIndex  = 60;
            this.label1.Text      = "Name";
            this.dataGridView1.AllowUserToAddRows = false;
            this.dataGridView1.BackgroundColor    = Color.DarkSeaGreen;
            this.dataGridView1.BorderStyle        = BorderStyle.None;
            style.Alignment          = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor          = SystemColors.Control;
            style.Font               = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            style.ForeColor          = SystemColors.WindowText;
            style.SelectionBackColor = SystemColors.Highlight;
            style.SelectionForeColor = SystemColors.HighlightText;
            style.WrapMode           = DataGridViewTriState.True;
            this.dataGridView1.ColumnHeadersDefaultCellStyle = style;
            this.dataGridView1.ColumnHeadersHeightSizeMode   = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView1.Columns.AddRange(new DataGridViewColumn[] { this.Column1, this.Column2, this.Column3, this.Column5, this.Column4, this.Column6 });
            this.dataGridView1.Location               = new Point(10, 0x2a);
            this.dataGridView1.Name                   = "dataGridView1";
            this.dataGridView1.ReadOnly               = true;
            this.dataGridView1.Size                   = new Size(0x330, 0x1c8);
            this.dataGridView1.TabIndex               = 0x25;
            style2.Alignment                          = DataGridViewContentAlignment.MiddleCenter;
            this.Column1.DefaultCellStyle             = style2;
            this.Column1.HeaderText                   = "Month";
            this.Column1.Name                         = "Column1";
            this.Column1.ReadOnly                     = true;
            this.Column1.Width                        = 250;
            style3.Alignment                          = DataGridViewContentAlignment.MiddleRight;
            this.Column2.DefaultCellStyle             = style3;
            this.Column2.FillWeight                   = 120f;
            this.Column2.HeaderText                   = "Salary";
            this.Column2.Name                         = "Column2";
            this.Column2.ReadOnly                     = true;
            this.Column2.Width                        = 120;
            this.Column3.FillWeight                   = 250f;
            this.Column3.HeaderText                   = "Advance";
            this.Column3.Name                         = "Column3";
            this.Column3.ReadOnly                     = true;
            style4.Alignment                          = DataGridViewContentAlignment.MiddleRight;
            this.Column5.DefaultCellStyle             = style4;
            this.Column5.HeaderText                   = "Loan";
            this.Column5.Name                         = "Column5";
            this.Column5.ReadOnly                     = true;
            style5.Alignment                          = DataGridViewContentAlignment.MiddleRight;
            this.Column4.DefaultCellStyle             = style5;
            this.Column4.HeaderText                   = "Deduction";
            this.Column4.Name                         = "Column4";
            this.Column4.ReadOnly                     = true;
            style6.Alignment                          = DataGridViewContentAlignment.MiddleRight;
            this.Column6.DefaultCellStyle             = style6;
            this.Column6.HeaderText                   = "Net Salary";
            this.Column6.Name                         = "Column6";
            this.Column6.ReadOnly                     = true;
            this.buttonSearch.BackColor               = Color.MediumSeaGreen;
            this.buttonSearch.Font                    = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.buttonSearch.Location                = new Point(0x2e1, 6);
            this.buttonSearch.Name                    = "buttonSearch";
            this.buttonSearch.Size                    = new Size(0x4b, 0x1b);
            this.buttonSearch.TabIndex                = 0x42;
            this.buttonSearch.Text                    = "Search";
            this.buttonSearch.UseVisualStyleBackColor = false;
            this.buttonSearch.Click                  += new EventHandler(this.buttonSearch_Click);
            this.dateTimePicker2.CustomFormat         = "yyyy-MM-dd";
            this.dateTimePicker2.Font                 = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.dateTimePicker2.Format               = DateTimePickerFormat.Custom;
            this.dateTimePicker2.Location             = new Point(620, 9);
            this.dateTimePicker2.Name                 = "dateTimePicker2";
            this.dateTimePicker2.Size                 = new Size(0x6b, 0x16);
            this.dateTimePicker2.TabIndex             = 0x41;
            this.label2.AutoSize                      = true;
            this.label2.BackColor                     = Color.MediumSeaGreen;
            this.label2.Font                          = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.label2.Location                      = new Point(0x223, 14);
            this.label2.Name                          = "label2";
            this.label2.Size                          = new Size(0x40, 0x10);
            this.label2.TabIndex                      = 0x40;
            this.label2.Text                          = "End Date";
            this.dateTimePicker1.CustomFormat         = "yyyy-MM-dd";
            this.dateTimePicker1.Font                 = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.dateTimePicker1.Format               = DateTimePickerFormat.Custom;
            this.dateTimePicker1.Location             = new Point(0x1b0, 9);
            this.dateTimePicker1.Name                 = "dateTimePicker1";
            this.dateTimePicker1.Size                 = new Size(0x6b, 0x16);
            this.dateTimePicker1.TabIndex             = 0x3f;
            this.label12.AutoSize                     = true;
            this.label12.BackColor                    = Color.MediumSeaGreen;
            this.label12.Font                         = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.label12.Location                     = new Point(0x166, 14);
            this.label12.Name                         = "label12";
            this.label12.Size                         = new Size(0x43, 0x10);
            this.label12.TabIndex                     = 0x3e;
            this.label12.Text                         = "Start Date";
            base.AutoScaleDimensions                  = new SizeF(6f, 13f);
            ////base.AutoScaleMode = AutoScaleMode.Font;
            this.BackColor  = Color.MediumSeaGreen;
            base.ClientSize = new Size(0x346, 510);
            base.Controls.Add(this.buttonSearch);
            base.Controls.Add(this.dateTimePicker2);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.dateTimePicker1);
            base.Controls.Add(this.label12);
            base.Controls.Add(this.dataGridView1);
            base.Controls.Add(this.comboBoxEmployee);
            base.Controls.Add(this.label1);
            //base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            base.Name          = "EmployeeReport";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text          = "Employee Salary Report";
            ((ISupportInitialize)this.dataGridView1).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
Esempio n. 43
0
        private void GenerarControles(string formaPago, Control control)
        {
            var lblMonto = new Label();

            lblMonto.AutoSize = true;
            lblMonto.Location = new Point(32, 19);
            lblMonto.Name     = "lblMonto";
            lblMonto.Size     = new Size(76, 13);
            lblMonto.TabIndex = 15;
            lblMonto.Text     = "Monto a pagar";
            control.Controls.Add(lblMonto);

            //Numeric Up Down de Monto Efectivo
            var nudMonto = new NumericUpDown();

            nudMonto.Location      = new Point(114, 17);
            nudMonto.Maximum       = 9999999999;
            nudMonto.Name          = "nudMonto";
            nudMonto.Size          = new Size(124, 20);
            nudMonto.TabIndex      = 16;
            nudMonto.ValueChanged += nudMonto_ValueChanged;
            control.Controls.Add(nudMonto);
            switch (formaPago.ToLower())
            {
            case "cuenta corriente":
            {
                //TextBox de cliente
                var txtCliente = new TextBox();
                txtCliente.Location  = new Point(114, 44);
                txtCliente.Name      = "txtCliente";
                txtCliente.ReadOnly  = true;
                txtCliente.Size      = new Size(120, 20);
                txtCliente.TabIndex  = 25;
                txtCliente.KeyPress += txtCliente_KeyPress;
                control.Controls.Add(txtCliente);
                //Label de cliente
                var lblCliente = new Label();
                lblCliente.AutoSize = true;
                lblCliente.Location = new Point(69, 47);
                lblCliente.Name     = "label7";
                lblCliente.Size     = new Size(39, 13);
                lblCliente.TabIndex = 26;
                lblCliente.Text     = "Cliente";
                control.Controls.Add(lblCliente);
                //Button de cliente
                var btnNuevoCliente = new Button();
                btnNuevoCliente.Location = new Point(240, 43);
                btnNuevoCliente.Name     = "btnNuevoCliente";
                btnNuevoCliente.Size     = new Size(25, 21);
                btnNuevoCliente.TabIndex = 27;
                btnNuevoCliente.Text     = "+";
                btnNuevoCliente.UseVisualStyleBackColor = true;
                btnNuevoCliente.Click += btnNuevoCliente_Click;
                control.Controls.Add(btnNuevoCliente);
            }
            break;

            case "tarjeta":
            {
                //Label Numero tarjeta
                var lblNumeroTarjeta = new Label();
                lblNumeroTarjeta.AutoSize = true;
                lblNumeroTarjeta.Location = new Point(17, 47);
                lblNumeroTarjeta.Name     = "label1";
                lblNumeroTarjeta.Size     = new Size(91, 13);
                lblNumeroTarjeta.TabIndex = 23;
                lblNumeroTarjeta.Text     = "Numero de tarjeta";
                control.Controls.Add(lblNumeroTarjeta);
                //TextBox Numero Tarjeta
                var txtNumeroTarjeta = new TextBox();
                txtNumeroTarjeta.Location = new Point(114, 44);
                txtNumeroTarjeta.Name     = "txtNumeroTarjeta";
                txtNumeroTarjeta.Size     = new Size(124, 20);
                txtNumeroTarjeta.TabIndex = 22;
                control.Controls.Add(txtNumeroTarjeta);
                //Label plan
                var lblPlan = new Label();
                lblPlan.AutoSize = true;
                lblPlan.Location = new Point(80, 73);
                lblPlan.Name     = "label4";
                lblPlan.Size     = new Size(28, 13);
                lblPlan.TabIndex = 25;
                lblPlan.Text     = "Plan";
                control.Controls.Add(lblPlan);
                //Button agregar plan
                var btnNuevoPlan = new Button();
                btnNuevoPlan.Location = new Point(242, 69);
                btnNuevoPlan.Name     = "cmbNuevoPlan";
                btnNuevoPlan.Size     = new Size(25, 21);
                btnNuevoPlan.TabIndex = 28;
                btnNuevoPlan.Text     = "+";
                btnNuevoPlan.UseVisualStyleBackColor = true;
                btnNuevoPlan.Click += cmbNuevoPlan_Click;
                control.Controls.Add(btnNuevoPlan);
                //ComboBox plan
                var cmbPlanDeTarjeta = new ComboBox();
                cmbPlanDeTarjeta.DropDownStyle     = ComboBoxStyle.DropDownList;
                cmbPlanDeTarjeta.FormattingEnabled = true;
                cmbPlanDeTarjeta.Location          = new Point(114, 70);
                cmbPlanDeTarjeta.Name     = "cmbPlanDeTarjeta";
                cmbPlanDeTarjeta.Size     = new Size(124, 21);
                cmbPlanDeTarjeta.TabIndex = 24;
                control.Controls.Add(cmbPlanDeTarjeta);
                CargarComboBox(cmbPlanDeTarjeta, _planTarjetaServicio.Obtener(string.Empty), "Descripcion", "Id");
                // txtCodigo
                var txtCodigo = new TextBox();
                txtCodigo.Location = new Point(114, 97);
                txtCodigo.Name     = "txtCodigo";
                txtCodigo.Size     = new Size(58, 20);
                txtCodigo.TabIndex = 26;
                control.Controls.Add(txtCodigo);
                // lblCodigo
                var lblCodigo = new Label();
                lblCodigo.AutoSize = true;
                lblCodigo.Location = new Point(68, 100);
                lblCodigo.Name     = "lblCodigo";
                lblCodigo.Size     = new Size(40, 13);
                lblCodigo.TabIndex = 27;
                lblCodigo.Text     = "Codigo";
                control.Controls.Add(lblCodigo);
            }
            break;

            case "cheque":
            {
                // lblDias
                var lblDias = new Label();
                lblDias.AutoSize = true;
                lblDias.Location = new Point(80, 150);
                lblDias.Name     = "label18";
                lblDias.Size     = new Size(28, 13);
                lblDias.TabIndex = 39;
                lblDias.Text     = "Dias";
                control.Controls.Add(lblDias);
                // lblFecha
                var lblFecha = new Label();
                lblFecha.AutoSize = true;
                lblFecha.Location = new Point(18, 128);
                lblFecha.Name     = "label17";
                lblFecha.Size     = new Size(90, 13);
                lblFecha.TabIndex = 38;
                lblFecha.Text     = "Fecha de emision";
                control.Controls.Add(lblFecha);
                // lblNumeroCheque
                var lblNumeroCheque = new Label();
                lblNumeroCheque.AutoSize = true;
                lblNumeroCheque.Location = new Point(50, 47);
                lblNumeroCheque.Name     = "label10";
                lblNumeroCheque.Size     = new Size(58, 13);
                lblNumeroCheque.TabIndex = 33;
                lblNumeroCheque.Text     = "N° cheque";
                control.Controls.Add(lblNumeroCheque);
                // lblEntidad
                var lblEntidad = new Label();
                lblEntidad.AutoSize = true;
                lblEntidad.Location = new Point(21, 99);
                lblEntidad.Name     = "label11";
                lblEntidad.Size     = new Size(87, 13);
                lblEntidad.TabIndex = 31;
                lblEntidad.Text     = "Entidad bancaria";
                control.Controls.Add(lblEntidad);
                // lblEnteEmisor
                var lblEnteEmisor = new Label();
                lblEnteEmisor.AutoSize = true;
                lblEnteEmisor.Location = new Point(46, 73);
                lblEnteEmisor.Name     = "label5";
                lblEnteEmisor.Size     = new Size(62, 13);
                lblEnteEmisor.TabIndex = 36;
                lblEnteEmisor.Text     = "Ente emisor";
                control.Controls.Add(lblEnteEmisor);
                // nudDias
                var nudDias = new NumericUpDown();
                nudDias.Location = new Point(114, 148);
                nudDias.Maximum  = 9999;
                nudDias.Name     = "nudDias";
                nudDias.Size     = new Size(124, 20);
                nudDias.TabIndex = 40;
                control.Controls.Add(nudDias);
                // txtBancos
                var txtBancos = new TextBox();
                txtBancos.Location  = new Point(114, 96);
                txtBancos.Name      = "txtBancos";
                txtBancos.ReadOnly  = true;
                txtBancos.Size      = new Size(124, 20);
                txtBancos.TabIndex  = 30;
                txtBancos.KeyPress += txtBancos_KeyPress;
                control.Controls.Add(txtBancos);
                // txtNumeroCheque
                var txtNumeroCheque = new TextBox();
                txtNumeroCheque.Location = new Point(114, 44);
                txtNumeroCheque.Name     = "txtNumeroCheque";
                txtNumeroCheque.Size     = new Size(124, 20);
                txtNumeroCheque.TabIndex = 32;
                control.Controls.Add(txtNumeroCheque);
                // btnNuevoBanco
                var btnNuevoBanco = new Button();
                btnNuevoBanco.Location = new Point(242, 95);
                btnNuevoBanco.Name     = "btnNuevoBanco";
                btnNuevoBanco.Size     = new Size(25, 21);
                btnNuevoBanco.TabIndex = 34;
                btnNuevoBanco.Text     = "+";
                btnNuevoBanco.UseVisualStyleBackColor = true;
                btnNuevoBanco.Click += btnNuevoBanco_Click;
                control.Controls.Add(btnNuevoBanco);
                // txtEnteEmisorCheque
                var txtEnteEmisorCheque = new TextBox();
                txtEnteEmisorCheque.Location = new Point(114, 70);
                txtEnteEmisorCheque.Name     = "txtEnteEmisorCheque";
                txtEnteEmisorCheque.Size     = new Size(124, 20);
                txtEnteEmisorCheque.TabIndex = 35;
                control.Controls.Add(txtEnteEmisorCheque);
                // dtpFechaCheque
                var dtpFechaCheque = new DateTimePicker();
                dtpFechaCheque.Format   = DateTimePickerFormat.Short;
                dtpFechaCheque.Location = new Point(114, 122);
                dtpFechaCheque.Name     = "dtpFechaCheque";
                dtpFechaCheque.Size     = new Size(124, 20);
                dtpFechaCheque.TabIndex = 37;
                control.Controls.Add(dtpFechaCheque);
            }
            break;
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.textAmount = new Gizmox.WebGUI.Forms.TextBox();
     this.label2 = new Gizmox.WebGUI.Forms.Label();
     this.label1 = new Gizmox.WebGUI.Forms.Label();
     this.datepicDateOfDone = new Gizmox.WebGUI.Forms.DateTimePicker();
     this.label3 = new Gizmox.WebGUI.Forms.Label();
     this.txtNote = new Gizmox.WebGUI.Forms.TextBox();
     this.checkBox1 = new Gizmox.WebGUI.Forms.CheckBox();
     this.SuspendLayout();
     //
     // textAmount
     //
     this.textAmount.Location = new System.Drawing.Point(398, 33);
     this.textAmount.Name = "textAmount";
     this.textAmount.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
     this.textAmount.Size = new System.Drawing.Size(53, 20);
     this.textAmount.TabIndex = 3;
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(337, 39);
     this.label2.Name = "label2";
     this.label2.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
     this.label2.Size = new System.Drawing.Size(35, 13);
     this.label2.TabIndex = 2;
     this.label2.Text = "כמות :";
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(18, 43);
     this.label1.Name = "label1";
     this.label1.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
     this.label1.Size = new System.Drawing.Size(35, 13);
     this.label1.TabIndex = 0;
     this.label1.Text = "תאריך ביצוע :";
     //
     // datepicDateOfDone
     //
     this.datepicDateOfDone.CalendarFirstDayOfWeek = Gizmox.WebGUI.Forms.Day.Default;
     this.datepicDateOfDone.CustomFormat = "MM/dd/yyyy";
     this.datepicDateOfDone.Location = new System.Drawing.Point(112, 34);
     this.datepicDateOfDone.Name = "datepicDateOfDone";
     this.datepicDateOfDone.Size = new System.Drawing.Size(200, 21);
     this.datepicDateOfDone.TabIndex = 6;
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(18, 79);
     this.label3.Name = "label3";
     this.label3.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
     this.label3.Size = new System.Drawing.Size(35, 13);
     this.label3.TabIndex = 0;
     this.label3.Text = "הערות";
     //
     // txtNote
     //
     this.txtNote.Location = new System.Drawing.Point(112, 59);
     this.txtNote.Name = "txtNote";
     this.txtNote.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
     this.txtNote.Size = new System.Drawing.Size(339, 63);
     this.txtNote.TabIndex = 3;
     //
     // checkBox1
     //
     this.checkBox1.AutoSize = true;
     this.checkBox1.CheckState = Gizmox.WebGUI.Forms.CheckState.Unchecked;
     this.checkBox1.Location = new System.Drawing.Point(132, 7);
     this.checkBox1.Name = "checkBox1";
     this.checkBox1.Size = new System.Drawing.Size(79, 17);
     this.checkBox1.TabIndex = 7;
     this.checkBox1.Text = "לא רלוונטי";
     //
     // ListViewControlPanel
     //
     this.Controls.Add(this.checkBox1);
     this.Controls.Add(this.txtNote);
     this.Controls.Add(this.label3);
     this.Controls.Add(this.datepicDateOfDone);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.textAmount);
     this.DockPadding.All = 3;
     this.Padding = new Gizmox.WebGUI.Forms.Padding(3);
     this.RightToLeft = Gizmox.WebGUI.Forms.RightToLeft.Yes;
     this.Size = new System.Drawing.Size(478, 158);
     this.ResumeLayout(false);
 }
Esempio n. 45
0
        private void dataUsers_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == -1)
            {
                return;
            }

            if (this.dataUsers.Columns[e.ColumnIndex].DataPropertyName == nameof(User.dateBirth))
            {
                dtp         = new DateTimePicker();
                dtp.Format  = DateTimePickerFormat.Short;
                dtp.Visible = true;
                Rectangle rec = this.dataUsers.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
                dtp.Location = new Point(rec.X, rec.Y);
                dtp.Size     = new Size(rec.Width, rec.Height);

                //test empty cell
                try
                {
                    dtp.Value = DateTime.Parse(this.dataUsers.CurrentCell.Value.ToString());
                }
                catch
                {
                    dtp.Value = DateTime.Now;
                }
                //dispose control
                dtp.CloseUp     += Dtp_CloseUp;
                dtp.TextChanged += Dtp_TextChanged;

                this.dataUsers.Controls.Add(dtp);
            }

            if (e.ColumnIndex == 0)
            {
                if (temp != null)
                {
                    temp = this.dataUsers.CurrentRow.Cells[0].Value.ToString();
                }
                else
                {
                    temp = null;
                }

                /*
                 * try
                 * {
                 *  temp = this.dataUsers.CurrentRow.Cells[0].Value.ToString();
                 * }
                 * catch
                 * {
                 *  temp = null;
                 * }
                 */
            }
            //else
            //{
            //    try
            //    {
            //        temp = this.dataUsers.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
            //    }
            //    catch
            //    {
            //        temp = null;
            //    }
            //}
            choose = e.RowIndex;
        }
        /// <summary>
        /// When overridden in a derived class, gets an editing element that is bound to the column's <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding"/> property value.
        /// </summary>
        /// <param name="cell">The cell that will contain the generated element.</param>
        /// <param name="dataItem">The data item represented by the row that contains the intended cell.</param>
        /// <returns>
        /// A new editing element that is bound to the column's <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding"/> property value.
        /// </returns>
        protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
        {
            #if !SILVERLIGHT
            _isEditing = false;
            #endif
            if(!string.IsNullOrEmpty(Field))
            {
                var codedValueSources = Utilities.DynamicCodedValueSource.GetCodedValueSources(LookupField, FieldInfo, dataItem, DynamicCodedValueSource, nullableSources);
                if (codedValueSources != null)
                {
                    ComboBox box = new ComboBox
                    {
                        Margin = new Thickness(4.0),
                        VerticalAlignment = VerticalAlignment.Center,
                        VerticalContentAlignment = VerticalAlignment.Center,
                        DisplayMemberPath = "DisplayName"
                    };
                    if (!string.IsNullOrEmpty(LookupField) && DynamicCodedValueSource != null)
                    {
                        // Item Source Binding
                        lookupConverter.LookupField = this.LookupField;
                        lookupConverter.Field = this.FieldInfo;
                        lookupConverter.NullableSources = this.nullableSources;
                        Binding binding = new Binding();
                        binding.Mode = BindingMode.OneWay;
                        binding.Converter = lookupConverter;
                        binding.ConverterParameter = DynamicCodedValueSource;
                        box.SetBinding(ComboBox.ItemsSourceProperty, binding);

                        // Selected Item Binding
                        selectedConverter.Field = Field;
                        selectedConverter.LookupField = LookupField;
                        selectedConverter.NullableSources = this.nullableSources;
                        Binding selectedBinding = new Binding();
                        selectedBinding.Mode = BindingMode.OneWay;
                        selectedBinding.Converter = selectedConverter;
                        selectedBinding.ConverterParameter = this.DynamicCodedValueSource;
                        box.SetBinding(ComboBox.SelectedItemProperty, selectedBinding);

                        box.SelectionChanged += box_SelectionChanged;
                    }
                    return box;
                }
                else if(FieldInfo.Type == Client.Field.FieldType.Date)
                {
                    DateTimePicker dtp = new DateTimePicker
                    {
                        Margin = new Thickness(4.0),
                        VerticalAlignment = VerticalAlignment.Center,
                        VerticalContentAlignment = VerticalAlignment.Center,
                        DateTimeFormat = this.DateTimeFormat,
                        DateTimeKind = this.DateTimeKind,
                        Language = cell.Language
                    };

                    Binding selectedBinding =
            #if SILVERLIGHT
                    new Binding(Field);
            #else
                    new Binding("Attributes["+Field+"]");
                    if (FieldDomainUtils.IsDynamicDomain(FieldInfo, LayerInfo))
                    {
                        selectedBinding.ValidationRules.Add(new DynamicRangeDomainValidationRule()
                        {
                            ValidationStep = ValidationStep.ConvertedProposedValue,
                            Field = FieldInfo,
                            LayerInfo = LayerInfo,
                            Graphic = dataItem as Graphic
                        });
                    }
            #endif
                    selectedBinding.Mode = BindingMode.TwoWay;
                    selectedBinding.ValidatesOnExceptions = true;
                    selectedBinding.NotifyOnValidationError = true;
                    dtp.SetBinding(DateTimePicker.SelectedDateProperty, selectedBinding);

                    return dtp;
                }
                else
                {
                    TextBox box = new TextBox
                    {
                        Margin = new Thickness(4.0),
                        VerticalAlignment = VerticalAlignment.Center,
                        VerticalContentAlignment = VerticalAlignment.Center,
                    };

                    box.MaxLength = Field.Length;

                    Binding binding =
            #if SILVERLIGHT
                    new Binding(Field);
                    binding.Mode = BindingMode.TwoWay;
                    binding.ValidatesOnExceptions = true;
                    binding.NotifyOnValidationError = true;
                    binding.Converter = emptyStringToNullConverter;
            #else
                    new Binding("Attributes["+Field+"]");
                    binding.Mode = BindingMode.TwoWay;
                    stringToPrimitiveTypeConverter.FieldType = FieldInfo.Type;
                    binding.Converter = stringToPrimitiveTypeConverter;

                    // Validates that the value entered into the text box can be
                    // converted to the corrected field type without error.
                    // if value cannot be converted to the correct type validation
                    // error will be triggered based on binding trigger below.
                    binding.ValidationRules.Add(new FeatureValidationRule()
                    {
                        ValidationStep = ValidationStep.ConvertedProposedValue,
                        FieldType = FieldInfo.Type,
                        Nullable = FieldInfo.Nullable
                    });

                    if (FieldDomainUtils.IsDynamicDomain(FieldInfo, LayerInfo))
                    {
                        binding.ValidationRules.Add(new DynamicRangeDomainValidationRule()
                        {
                            ValidationStep = ValidationStep.ConvertedProposedValue,
                            Field = FieldInfo,
                            LayerInfo = LayerInfo,
                            Graphic = dataItem as Graphic
                        });
                    }

                    // Build a data trigger to show the validation error i.e. red outline around textbox
                    // with message content in tooltip.
                    var setterBinding = new Binding("(Validation.Errors)[0].ErrorContent");
                    setterBinding.RelativeSource = RelativeSource.Self;

                    var setter = new Setter();
                    setter.Property = TextBox.ToolTipProperty;
                    setter.Value = setterBinding;

                    var trigger = new Trigger();
                    trigger.Property = Validation.HasErrorProperty;
                    trigger.Value = true;
                    trigger.Setters.Add(setter);

                    var style = new Style(typeof(TextBox));
                    style.Triggers.Add(trigger);
                    box.Style = style;
            #endif
                    box.SetBinding(TextBox.TextProperty, binding);
                    return box;
                }
            }
            return new TextBlock(); // Should never reach this line.
        }
 public void datetimepicker_correctly_formats_local_date_value()
 {
     var value = new DateTime(2000, 2, 2, 14, 5, 24, 331, DateTimeKind.Local);
     var element = new DateTimePicker("test").Value(value);
     var timeZoneOffset = string.Format("{0:xK}", value).Substring(1, 6); //Note: 'K' by itself blows up.
     var expectedValue = string.Format("2000-02-02T14:05:24.331{0}", timeZoneOffset);
     element.ValueAttributeShouldEqual(expectedValue);
 }
Esempio n. 48
0
        //log history
        public void insertToLogHistory(string empID, DateTimePicker logDate, DateTimePicker logTime, DateTimePicker endShiftDate, DateTimePicker endShiftTime, string statues = "Login")
        {
            try
            {
                string sql = "INSERT INTO LogHistory(empID,logDate,logTime,endShiftDate,endShiftTime,statues)VALUES(@empID,@logDate,@logTime,@endShiftDate,@endShiftTime,@statues)";
                con = new SqlConnection(dbPath);
                con.Open();
                cmd = new SqlCommand(sql, con);
                cmd.Parameters.AddWithValue("@empID", empID.Trim());
                cmd.Parameters.AddWithValue("@logDate", logDate.Value.Date);
                cmd.Parameters.AddWithValue("@logTime", logTime.Value.ToShortDateString());
                cmd.Parameters.AddWithValue("@endShiftDate", endShiftDate.Value.Date);
                cmd.Parameters.AddWithValue("@endShiftTime", endShiftTime.Value.ToShortTimeString());
                cmd.Parameters.AddWithValue("@statues", statues.Trim());

                cmd.ExecuteNonQuery();
            }

            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Throwing Exception - King BBQ Restaurant", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                con.Close();
            }
        }
 public void datetimepicker_limit_sets_limits()
 {
     var element = new DateTimePicker("x").Limit(new DateTime(2000, 1, 1), new DateTime(2000, 12, 31, 10, 20, 30, 331), 3).ToString()
         .ShouldHaveHtmlNode("x");
     element.ShouldHaveAttribute(HtmlAttribute.Min).WithValue("2000-01-01T00:00:00.000Z");
     element.ShouldHaveAttribute(HtmlAttribute.Max).WithValue("2000-12-31T10:20:30.331Z");
     element.ShouldHaveAttribute(HtmlAttribute.Step).WithValue("3");
 }
Esempio n. 50
0
 public void actualizar_inconsistencia(int secuencia, string estado, DateTimePicker fecenturne, DateTimePicker fecsolicita, DateTimePicker fecingresa, DateTimePicker fecsalida, string plogin)
 {
     _datos.registro("PK_CONTROL_FLOTA.ATENDER_INCONSISTENCIA", secuencia, estado, fecenturne, fecsolicita, fecingresa, fecsalida, plogin);
 }
Esempio n. 51
0
        private FrameworkElement CreateControl(DataFieldItem dfItem)
        {
            ControlType cType = dfItem.CType;
            Binding binding = new Binding();
            binding.Path = new PropertyPath(dfItem.PropertyName);
            binding.Mode = BindingMode.TwoWay;
            binding.Converter = new CommonConvert(dfItem);
            
            FrameworkElement c = null;
            switch (cType)
            {
                case ControlType.Label:
                    TextBlock tbx = new TextBlock();
                    
                    if (dfItem.ReferenceDataInfo != null)
                    {
                        binding.Path = new PropertyPath(dfItem.ReferenceDataInfo.ReferencedMember + ".Text");
                    }
                    tbx.SetBinding(TextBlock.TextProperty, binding);
                    
                    c = tbx;
                    break;
                case ControlType.TextBox:
                    TextBox tb = new TextBox();
                    tb.SetBinding(TextBox.TextProperty, binding);
                    tb.IsReadOnly = (IsReadOnly || dfItem.IsReadOnly);
                    tb.MaxLength = dfItem.MaxLength;
                    if ( dfItem.DataType.ToLower() == "decimal" || dfItem.DataType.ToLower() == "datetime")
                    {
                        tb.TextAlignment = TextAlignment.Right;
                    }
                    c = tb;
                    break;
                case ControlType.Combobox:

                    ComboBox cbb = new ComboBox();

                    if (dfItem.ReferenceDataInfo != null)
                    {
                        cbb.ItemsSource = this.GetItemSource(dfItem.ReferenceDataInfo.Type);
                        cbb.DisplayMemberPath = "Text";
                        binding.Path = new PropertyPath(dfItem.ReferenceDataInfo.ReferencedMember);
                    }

                    cbb.SetBinding(ComboBox.SelectedItemProperty, binding);
                    cbb.IsEnabled = !(IsReadOnly || dfItem.IsReadOnly);
                   
                    c = cbb;
                    
                    break;
                case ControlType.LookUp:
                    FBLookUp lookUp = new FBLookUp();
                    lookUp.OperationType = this.OperationType;
                    lookUp.DisplayMemberPath = dfItem.PropertyName;
                    if (dfItem.ReferenceDataInfo != null)
                    {
                        lookUp.DisplayMemberPath = dfItem.ReferenceDataInfo.ReferencedMember + ".Text";
                        if (!string.IsNullOrEmpty(dfItem.ReferenceDataInfo.TextPath))
                        {
                            lookUp.DisplayMemberPath = dfItem.ReferenceDataInfo.TextPath;
                        }
                        lookUp.LookUpType = dfItem.ReferenceDataInfo.Type;
                        binding.Path = new PropertyPath(dfItem.ReferenceDataInfo.ReferencedMember);
                    }
                    lookUp.SetBinding(LookUp.SelectItemProperty, binding);
                    lookUp.ReferencedDataInfo = dfItem.ReferenceDataInfo;
                    lookUp.Parameters = dfItem.ReferenceDataInfo.Parameters;
                    lookUp.IsReadOnly = (IsReadOnly || dfItem.IsReadOnly);
                    c = lookUp;
                    break;
                case ControlType.Remark:
                    TextBox tbRemark = new TextBox();
                    tbRemark.AcceptsReturn = true;
                    tbRemark.TextWrapping = TextWrapping.Wrap;
                    //tbRemark.Height = 66;
                    //tbRemark.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
                    //tbRemark.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                    tbRemark.SetBinding(TextBox.TextProperty, binding);
                    c = tbRemark;

                    tbRemark.IsReadOnly = (IsReadOnly || dfItem.IsReadOnly);

                    tbRemark.MaxLength = dfItem.MaxLength;
                    
                    break;
                case ControlType.DatePicker:
                    DatePicker datePicker = new DatePicker();
                    datePicker.SelectedDateFormat = DatePickerFormat.Short;
                    datePicker.SetBinding(DatePicker.SelectedDateProperty, binding);                    
                    c = datePicker;
                    datePicker.IsEnabled = !(IsReadOnly || dfItem.IsReadOnly);
                    break;
                case ControlType.DateTimePicker:
                    DateTimePicker dateTimePicker = new DateTimePicker();
                    dateTimePicker.SetBinding(DateTimePicker.ValueProperty, binding);
                    c = dateTimePicker;
                    dateTimePicker.IsEnabled = !(IsReadOnly || dfItem.IsReadOnly);
                    break;
                // Add By LVCHAO 2011.01.30 14:46
                case ControlType.HyperlinkButton:
                    HyperlinkButton hb = new HyperlinkButton();
                    if (dfItem.ReferenceDataInfo != null)
                    {
                        binding.Path = new PropertyPath(dfItem.ReferenceDataInfo.ReferencedMember + ".Text");
                    }
                    hb.Click += (o, e) =>
                        {
                            var sourceOjb = hb.DataContext.GetObjValue(dfItem.ReferenceDataInfo.ReferencedMember + ".Value");
                            CommonFunction.ShowExtendForm(sourceOjb);
                        };
                    hb.SetBinding(HyperlinkButton.ContentProperty, binding);
                    c = hb;
                    break;
            }
            return c;

        }
Esempio n. 52
0
    /// <summary>
    /// Generate editor table.
    /// </summary>
    public void GenerateEditor()
    {
        // Get parent web part info
        WebPartInfo wpi = WebPartInfoProvider.GetWebPartInfo(this.ParentWebPartID);
        FormInfo fi = null;
        if (wpi != null)
        {
            // Create form info and load xml definition
            fi = FormHelper.GetWebPartFormInfo(wpi.WebPartName + FormHelper.CORE, wpi.WebPartProperties, null, null, false);
        }
        else
        {
            fi = new FormInfo(SourceXMLDefinition);
        }

        if (fi != null)
        {
            // Get defintion elements
            ArrayList infos = fi.GetFormElements(true, false);

            // create table part
            Literal table1 = new Literal();
            pnlEditor.Controls.Add(table1);
            table1.Text = "<table cellpadding=\"3\" >";

            // Hashtable counter
            int i = 0;

            // Check all items in object array
            foreach (object contrl in infos)
            {
                // Generate row for form category
                if (contrl is FormCategoryInfo)
                {
                    // Load castegory info
                    FormCategoryInfo fci = contrl as FormCategoryInfo;
                    if (fci != null)
                    {
                        // Create row html code
                        Literal tabCat = new Literal();
                        pnlEditor.Controls.Add(tabCat);
                        tabCat.Text = "<tr class=\"InheritCategory\"><td>";

                        // Create label control and insert it to the page
                        Label lblCat = new Label();
                        this.pnlEditor.Controls.Add(lblCat);
                        lblCat.Text = fci.CategoryName;
                        lblCat.Font.Bold = true;

                        // End row html code
                        Literal tabCat2 = new Literal();
                        pnlEditor.Controls.Add(tabCat2);
                        tabCat2.Text = "</td><td></td><td></td>";
                    }
                }
                else
                {
                    // Get form field info
                    FormFieldInfo ffi = contrl as FormFieldInfo;

                    if (ffi != null)
                    {
                        // Check if is defined inherited default value
                        bool doNotInherit = IsDefined(ffi.Name);
                        // Get default value
                        string inheritedDefaultValue = GetDefaultValue(ffi.Name);

                        // Current hastable for client id
                        Hashtable currentHashTable = new Hashtable();

                        // First item is name
                        currentHashTable[0] = ffi.Name;

                        // Begin new row and column
                        Literal table2 = new Literal();
                        pnlEditor.Controls.Add(table2);
                        table2.Text = "<tr class=\"InheritWebPart\"><td>";

                        // Property label
                        Label lblName = new Label();
                        pnlEditor.Controls.Add(lblName);
                        lblName.Text = ffi.Caption;
                        if (!lblName.Text.EndsWith(":"))
                        {
                            lblName.Text += ":";
                        }

                        // New column
                        Literal table3 = new Literal();
                        pnlEditor.Controls.Add(table3);
                        table3.Text = "</td><td>";

                        // Type string for javascript function
                        string jsType = "textbox";

                        // Type switcher
                        if (FormHelper.IsFieldOfType(ffi, FormFieldControlTypeEnum.CheckBoxControl))
                        {
                            // Checkbox type field
                            CheckBox chk = new CheckBox();
                            pnlEditor.Controls.Add(chk);
                            chk.Checked = ValidationHelper.GetBoolean(ffi.DefaultValue, false);
                            chk.InputAttributes.Add("disabled", "disabled");

                            chk.Attributes.Add("id", chk.ClientID + "_upperSpan");

                            if (doNotInherit)
                            {
                                chk.InputAttributes.Remove("disabled");
                                chk.Enabled = true;
                                chk.Checked = ValidationHelper.GetBoolean(inheritedDefaultValue, false);
                            }

                            jsType = "checkbox";
                            currentHashTable[1] = chk.ClientID;
                        }
                        else if (FormHelper.IsFieldOfType(ffi, FormFieldControlTypeEnum.CalendarControl))
                        {
                            // Date time picker
                            DateTimePicker dtPick = new DateTimePicker();
                            pnlEditor.Controls.Add(dtPick);
                            dtPick.SelectedDateTime = ValidationHelper.GetDateTime(ffi.DefaultValue, DataHelper.DATETIME_NOT_SELECTED);
                            dtPick.Enabled = false;
                            dtPick.SupportFolder = ResolveUrl("~/CMSAdminControls/Calendar");

                            if (doNotInherit)
                            {
                                dtPick.Enabled = true;
                                dtPick.SelectedDateTime = ValidationHelper.GetDateTime(inheritedDefaultValue, DataHelper.DATETIME_NOT_SELECTED);
                            }

                            jsType = "calendar";
                            currentHashTable[1] = dtPick.ClientID;
                        }
                        else
                        {
                            // Other types represent by textbox
                            TextBox txt = new TextBox();
                            pnlEditor.Controls.Add(txt);
                            txt.Text = ffi.DefaultValue;
                            txt.CssClass = "TextBoxField";
                            txt.Enabled = ffi.Enabled;
                            txt.Enabled = false;

                            if (ffi.DataType == FormFieldDataTypeEnum.LongText)
                            {
                                txt.TextMode = TextBoxMode.MultiLine;
                                txt.Rows = 3;
                            }

                            if (doNotInherit)
                            {
                                txt.Enabled = true;
                                txt.Text = inheritedDefaultValue;
                            }

                            currentHashTable[1] = txt.ClientID;
                        }

                        // New column
                        Literal table4 = new Literal();
                        pnlEditor.Controls.Add(table4);
                        table4.Text = "</td><td>" + ffi.DataType.ToString() + "</td><td>";

                        // Inherit chk
                        CheckBox chkInher = new CheckBox();
                        pnlEditor.Controls.Add(chkInher);
                        chkInher.Checked = true;

                        // Uncheck checkbox if this property is not inherited
                        if (doNotInherit)
                        {
                            chkInher.Checked = false;
                        }

                        chkInher.Text = GetString("DefaultValueEditor.Inherited");

                        // Set default value for javascript function
                        string defValue = "'" + ffi.DefaultValue + "'";

                        if (jsType == "checkbox")
                        {
                            defValue = ValidationHelper.GetBoolean(ffi.DefaultValue, false).ToString().ToLower();
                        }

                        // Add javascript attribute with js function call
                        chkInher.Attributes.Add("onclick", "CheckClick(this, '" + currentHashTable[1].ToString() + "', " + defValue + ", '" + jsType + "' );");

                        // Inser current checkbox id
                        currentHashTable[2] = chkInher.ClientID;

                        // Add current hastable to the controls hashtable
                        ((Hashtable)Controls)[i] = currentHashTable;

                        // End current row
                        Literal table5 = new Literal();
                        pnlEditor.Controls.Add(table5);
                        table5.Text = "</td></tr>";

                        i++;
                    }
                }
            }

            // End table part
            Literal table6 = new Literal();
            pnlEditor.Controls.Add(table6);
            table6.Text = "</table>";
        }
    }
Esempio n. 53
0
 private void setEmptyCustomDatePicker(DateTimePicker dateTimePicker)
 {
     dateTimePicker.Enabled      = false;
     dateTimePicker.Format       = DateTimePickerFormat.Custom;
     dateTimePicker.CustomFormat = " ";
 }
Esempio n. 54
0
        public void Generate(WrapPanel parent, DataTableBackedList <ControlRow> templateTable)
        {
            // used for styling all content and label controls except ComboBoxes since the combo box style is commented out in DataEntryControls.xaml
            // and defined instead in MainWindow.xaml as an exception workaround
            DataEntryControls styleProvider = new DataEntryControls();

            parent.Children.Clear();
            foreach (ControlRow control in templateTable)
            {
                // instantiate control UX objects
                StackPanel stackPanel;
                switch (control.Type)
                {
                case Constant.Control.Note:
                case Constant.DatabaseColumn.Date:
                case Constant.DatabaseColumn.File:
                case Constant.DatabaseColumn.Folder:
                case Constant.DatabaseColumn.RelativePath:
                case Constant.DatabaseColumn.Time:
                    Label   noteLabel   = EditorControls.CreateLabel(styleProvider, control);
                    TextBox noteContent = EditorControls.CreateTextBox(styleProvider, control);
                    stackPanel = EditorControls.CreateStackPanel(styleProvider, noteLabel, noteContent);
                    break;

                case Constant.Control.Counter:
                    RadioButton   counterLabel   = EditorControls.CreateCounterLabelButton(styleProvider, control);
                    IntegerUpDown counterContent = EditorControls.CreateIntegerUpDown(styleProvider, control);
                    stackPanel                = EditorControls.CreateStackPanel(styleProvider, counterLabel, counterContent);
                    counterLabel.IsTabStop    = false;
                    counterContent.GotFocus  += this.Control_GotFocus;
                    counterContent.LostFocus += this.Control_LostFocus;
                    break;

                case Constant.Control.Flag:
                case Constant.DatabaseColumn.DeleteFlag:
                    Label    flagLabel   = EditorControls.CreateLabel(styleProvider, control);
                    CheckBox flagContent = this.CreateFlag(styleProvider, control);
                    flagContent.IsChecked = String.Equals(control.DefaultValue, Constant.BooleanValue.True, StringComparison.OrdinalIgnoreCase);
                    stackPanel            = EditorControls.CreateStackPanel(styleProvider, flagLabel, flagContent);
                    break;

                case Constant.Control.FixedChoice:
                case Constant.DatabaseColumn.ImageQuality:
                    Label    choiceLabel   = EditorControls.CreateLabel(styleProvider, control);
                    ComboBox choiceContent = EditorControls.CreateComboBox(styleProvider, control);
                    stackPanel = EditorControls.CreateStackPanel(styleProvider, choiceLabel, choiceContent);
                    break;

                case Constant.DatabaseColumn.DateTime:
                    Label          dateTimeLabel   = EditorControls.CreateLabel(styleProvider, control);
                    DateTimePicker dateTimeContent = this.CreateDateTimePicker(control);
                    stackPanel = EditorControls.CreateStackPanel(styleProvider, dateTimeLabel, dateTimeContent);
                    break;

                case Constant.DatabaseColumn.UtcOffset:
                    Label           utcOffsetLabel   = EditorControls.CreateLabel(styleProvider, control);
                    UtcOffsetUpDown utcOffsetContent = this.CreateUtcOffsetPicker(control);
                    // We don't show UtcOffset any more, so just collapse it.
                    utcOffsetLabel.Visibility   = Visibility.Collapsed;
                    utcOffsetContent.Visibility = Visibility.Collapsed;
                    stackPanel = EditorControls.CreateStackPanel(styleProvider, utcOffsetLabel, utcOffsetContent);
                    break;

                default:
                    throw new NotSupportedException(String.Format("Unhandled control type {0}.", control.Type));
                }

                stackPanel.Tag = control.DataLabel;
                if (control.Visible == false)
                {
                    stackPanel.Visibility = Visibility.Collapsed;
                }

                // add control to wrap panel
                parent.Children.Add(stackPanel);
            }
        }
 /// <summary>
 /// When overridden in a derived class, gets an editing element that is bound to the column's <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding"/> property value.
 /// </summary>
 /// <param name="cell">The cell that will contain the generated element.</param>
 /// <param name="dataItem">The data item represented by the row that contains the intended cell.</param>
 /// <returns>
 /// A new editing element that is bound to the column's <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding"/> property value.
 /// </returns>
 protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
 {
     DateTimePicker dtp = new DateTimePicker
     {
         Margin = new Thickness(4.0),
         VerticalAlignment = VerticalAlignment.Center,
         VerticalContentAlignment = VerticalAlignment.Center,
         DateTimeFormat = this.DateTimeFormat,
         DateTimeKind = this.DateTimeKind,
         Language = cell.Language
     };
     if (!string.IsNullOrEmpty(Field))
     {
         Binding selectedBinding =
     #if SILVERLIGHT
         new Binding(Field);
     #else
         new Binding("Attributes["+Field+"]");
         if(FieldInfo != null && FieldInfo.Domain != null && FieldInfo.Domain is RangeDomain<DateTime>)
         {
             RangeDomainValidationRule rangeValidator = new RangeDomainValidationRule();
             rangeValidator.MinValue = (FieldInfo.Domain as RangeDomain<DateTime>).MinimumValue;
             rangeValidator.MaxValue = (FieldInfo.Domain as RangeDomain<DateTime>).MaximumValue;
             rangeValidator.ValidationStep = ValidationStep.ConvertedProposedValue;
             selectedBinding.ValidationRules.Add(rangeValidator);
         }
     #endif
         selectedBinding.Mode = BindingMode.TwoWay;
         selectedBinding.ValidatesOnExceptions = true;
         selectedBinding.NotifyOnValidationError = true;
         dtp.SetBinding(DateTimePicker.SelectedDateProperty, selectedBinding);
     }
     return dtp;
 }
Esempio n. 56
0
 private void setDefaultDatePicker(DateTimePicker dateTimePicker, DateTime?dateEffektiv)
 {
     dateTimePicker.Enabled = true;
     dateTimePicker.Value   = dateEffektiv.Value;
 }
        public SpeedrunComSubmitDialog(RunMetadata metadata)
        {
            this.metadata = metadata;

            InitializeComponent();

            hasPersonalBestDateTime = SpeedrunCom.FindPersonalBestAttemptDate(metadata.LiveSplitRun).HasValue;

            var row = 2;

            if (!hasPersonalBestDateTime)
            {
                var dateLabel = new Label();
                dateLabel.Text = "Date:";
                tableLayoutPanel.Controls.Add(dateLabel, 0, row);
                dateLabel.Anchor   = AnchorStyles.Left;
                dateLabel.AutoSize = true;

                datePicker          = new DateTimePicker();
                datePicker.Anchor   = AnchorStyles.Left | AnchorStyles.Right;
                datePicker.TabIndex = row;
                tableLayoutPanel.Controls.Add(datePicker, 1, row);
                tableLayoutPanel.SetColumnSpan(datePicker, 2);

                MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height + datePicker.Height);
                Size        = new Size(Size.Width, Size.Height + datePicker.Height);

                row++;
            }

            var runTime = metadata.LiveSplitRun.Last().PersonalBestSplitTime;

            var timingMethods    = metadata.Game.Ruleset.TimingMethods;
            var usesGameTime     = timingMethods.Contains(SpeedrunComSharp.TimingMethod.GameTime);
            var usesWithoutLoads = timingMethods.Contains(SpeedrunComSharp.TimingMethod.RealTimeWithoutLoads);
            var usesBoth         = usesGameTime && usesWithoutLoads;

            if (!runTime.GameTime.HasValue || usesBoth)
            {
                if (usesWithoutLoads)
                {
                    var label = new Label();
                    label.Text = "Without Loads:";
                    tableLayoutPanel.Controls.Add(label, 0, row);
                    label.Anchor   = AnchorStyles.Left;
                    label.AutoSize = true;

                    txtWithoutLoads          = new TextBox();
                    txtWithoutLoads.Anchor   = AnchorStyles.Left | AnchorStyles.Right;
                    txtWithoutLoads.TabIndex = row;
                    tableLayoutPanel.Controls.Add(txtWithoutLoads, 1, row);
                    tableLayoutPanel.SetColumnSpan(txtWithoutLoads, 2);

                    MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height + txtWithoutLoads.Height);
                    Size        = new Size(Size.Width, Size.Height + txtWithoutLoads.Height);

                    row++;
                }

                if (usesGameTime)
                {
                    var label = new Label();
                    label.Text = "Game Time:";
                    tableLayoutPanel.Controls.Add(label, 0, row);
                    label.Anchor   = AnchorStyles.Left;
                    label.AutoSize = true;

                    txtGameTime          = new TextBox();
                    txtGameTime.Anchor   = AnchorStyles.Left | AnchorStyles.Right;
                    txtGameTime.TabIndex = row;
                    tableLayoutPanel.Controls.Add(txtGameTime, 1, row);
                    tableLayoutPanel.SetColumnSpan(txtGameTime, 2);

                    MinimumSize = new Size(MinimumSize.Width, MinimumSize.Height + txtGameTime.Height);
                    Size        = new Size(Size.Width, Size.Height + txtGameTime.Height);

                    row++;
                }
            }
        }
Esempio n. 58
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            _dgTrendPens = GetTemplateChild("dgTrendPens") as DataGrid;
            if (_dgTrendPens != null)
            {
                UpdateDgPensColumnsVisibility();
            }

            _gTrendPresenters = (Grid) GetTemplateChild("gTrendPresenters");
            if (_gTrendPresenters != null)
            {
                _gTrendPresenters.MouseLeftButtonDown += GTrendPresentersMouseLeftButtonDown;
                _gTrendPresenters.MouseLeftButtonUp += GTrendPresentersMouseLeftButtonUp;
                _gTrendPresenters.MouseMove += GTrendPresentersMouseMove;
            }

            _gVerticalAxes = (Grid)GetTemplateChild("gVerticalAxes");
            _cVerticalAxes = (Canvas)GetTemplateChild("cVerticalAxes");
            if (_cVerticalAxes != null)
            {
                _cVerticalAxes.SizeChanged += CVerticalAxesSizeChanged;
            }
            _cHorizontalAxes = (Canvas)GetTemplateChild("cHorizontalAxes");
            if (_cHorizontalAxes != null)
            {
                _cHorizontalAxes.SizeChanged += CHorizontalAxesSizeChanged;
            }
            _spHorisontalAxes = (StackPanel)GetTemplateChild("spHorisontalAxes");

            #region Slider

            _slSlider = GetTemplateChild("slSlider") as Slider;
            if (_slSlider != null)
            {
                var sliderBinding = new Binding("CursorPosition") { Source = this, Mode = BindingMode.TwoWay };
                _slSlider.SetBinding(RangeBase.ValueProperty, sliderBinding);
            }

            _cdSliderOffset = (ColumnDefinition)GetTemplateChild("cdSliderOffset");
            _gSlider = (Grid)GetTemplateChild("gSlider");
            if (_gSlider != null)
                _gSlider.SizeChanged += GSliderSizeChanged;
            _cSlider = (Canvas)GetTemplateChild("cSlider");
            if (_cSlider != null)
            {
                var presentersVisibilityBinding = new Binding("ShowCursorPresenters") { Source = this, Converter = new BooleanToVisibilityConverter() };
                _cSlider.SetBinding(VisibilityProperty, presentersVisibilityBinding);
                _cSlider.SizeChanged += CSliderSizeChanged;
            }
            _spSlider = (Panel)GetTemplateChild("spSlider");
            UpdateSliderVisibility();

            #endregion

            #region SetPeriod

            _popupPeriod = GetTemplateChild("popupPeriod") as Popup;
            _tspSetPeriod = GetTemplateChild("tspSetPeriod") as TimeSpanPicker;
            if (_popupPeriod != null && _tspSetPeriod != null)
            {
                _popupPeriod.Opened += PopupPeriodOpened;
                _tspSetPeriod.KeyUp += TspSetPeriodKeyUp;
                var bSetPeriod = GetTemplateChild("bSetPeriod") as Button;
                if (bSetPeriod != null)
                    bSetPeriod.Click += BSetPeriodClick;
            }

            #endregion

            #region SetTime

            _popupTime = GetTemplateChild("popupTime") as Popup;
            _dtpSetTime = GetTemplateChild("dtpSetTime") as DateTimePicker;
            if (_popupTime != null && _dtpSetTime != null)
            {
                _popupTime.Opened += PopupTimeOpened;
                _dtpSetTime.KeyUp += DtpSetTimeKeyUp;
                var bSetTime = GetTemplateChild("bSetTime") as Button;
                if (bSetTime != null)
                {
                    bSetTime.Click += BSetTimeClick;
                }
            }

            #endregion
        }