コード例 #1
0
        private void 基础数据维护ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            /*  Fzlwf f = new Fzlwf();
             *  f.ShowDialog();
             */
            DateSetup maintenance = new DateSetup();

            maintenance.Show();
        }
コード例 #2
0
ファイル: Date.cs プロジェクト: moayyaed/YetaWF-Modules
        /// <summary>
        /// Called by the framework when the component needs to be rendered as HTML.
        /// </summary>
        /// <param name="model">The model being rendered by the component.</param>
        /// <returns>The component rendered as HTML.</returns>
        public async Task <string> RenderAsync(DateTime?model)
        {
            UseSuppliedIdAsControlId();

            HtmlBuilder hb = new HtmlBuilder();

            hb.Append($"<div id='{ControlId}' class='yt_date t_edit'>");

            Dictionary <string, object> hiddenAttributes = new Dictionary <string, object>(HtmlAttributes)
            {
                { "__NoTemplate", true }
            };

            hb.Append(await HtmlHelper.ForEditComponentAsync(Container, PropertyName, null, "Hidden", HtmlAttributes: hiddenAttributes, Validation: Validation));

            YTagBuilder tag = new YTagBuilder("input");

            FieldSetup(tag, FieldType.Anonymous);
            tag.Attributes.Add("name", "dtpicker");

            // handle min/max date
            DateSetup setup = new DateSetup {
                Min = new DateTime(1900, 1, 1),
                Max = new DateTime(2199, 12, 31),
            };
            MinimumDateAttribute minAttr = PropData.TryGetAttribute <MinimumDateAttribute>();

            if (minAttr != null)
            {
                setup.Min = minAttr.MinDate;
            }
            MaximumDateAttribute maxAttr = PropData.TryGetAttribute <MaximumDateAttribute>();

            if (maxAttr != null)
            {
                setup.Max = maxAttr.MaxDate;
            }

            if (model != null)
            {
                tag.MergeAttribute("value", Formatting.FormatDateTime((DateTime)model));// shows date using user's time zone
            }
            hb.Append(tag.ToString(YTagRenderMode.StartTag));

            hb.Append($"</div>");

            Manager.ScriptManager.AddLast($@"new YetaWF_ComponentsHTML.DateEditComponent('{ControlId}', {Utility.JsonSerialize(setup)});");

            return(hb.ToString());
        }
コード例 #3
0
ファイル: MZYYZT.cs プロジェクト: JourneyChen88/SSMZ
        private void 组套名称管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DateSetup f1 = new DateSetup();

            f1.Show();
        }
コード例 #4
0
ファイル: MZYYZT.cs プロジェクト: JourneyChen88/SSMZ
        /// <summary>
        /// 组套管理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button5_Click(object sender, EventArgs e)
        {
            DateSetup maintenance = new DateSetup();

            maintenance.Show();
        }