当前位置: 首页>>代码示例>>C#>>正文


C# CultureInfo.GetDayOfWeek方法代码示例

本文整理汇总了C#中System.Globalization.CultureInfo.GetDayOfWeek方法的典型用法代码示例。如果您正苦于以下问题:C# CultureInfo.GetDayOfWeek方法的具体用法?C# CultureInfo.GetDayOfWeek怎么用?C# CultureInfo.GetDayOfWeek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Globalization.CultureInfo的用法示例。


在下文中一共展示了CultureInfo.GetDayOfWeek方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NactiDochazku

        private void NactiDochazku()
        {
            if (panel_Formular.Controls[0] == null)
                return;

            Int32 CisloZam = 0;
            if ((treeView_Zamestnanci.SelectedNode != null) && (!Int32.TryParse(treeView_Zamestnanci.SelectedNode.Name, out CisloZam)))
                return;
            //textBox_Vyhledavani.Text = treeView_Zamestnanci.SelectedNode.Text;
            this.Text = "Docházka - " + treeView_Zamestnanci.SelectedNode.Text;
            panel_Formular.Visible = false;
            PripravFormularMesic();
            String SQL = "SELECT CisloZam, Datum, Stredisko, Zakazka, Cinnost, SUM(Hodiny) FROM TabEGDochazkaDny WHERE CisloZam = " + CisloZam + " AND YEAR(Datum) = " + numericUpDown_Rok.Value + " AND Month(Datum) = " + numericUpDown_Mesic.Value + " GROUP BY CisloZam, Datum, Stredisko, Zakazka, Cinnost ORDER BY Datum, Stredisko, Zakazka, Cinnost";
            IHeQuery SQLDochazka = Helios.OpenSQL(SQL);
            if (DochazkaDny == null)
                DochazkaDny = new List<DochazkaStruct>();
            DochazkaDny.Clear();
            DochazkaStruct Polozka = new DochazkaStruct();
            while (!SQLDochazka.EOF())
            {
                Polozka.CisloZam = SQLDochazka.FieldValues(0);
                Polozka.Datum = SQLDochazka.FieldValues(1);
                Polozka.Stredisko = SQLDochazka.FieldValues(2);
                Polozka.Zakazka = SQLDochazka.FieldValues(3);
                Polozka.Cinnost = SQLDochazka.FieldValues(4);
                Polozka.Hodiny = SQLDochazka.FieldValues(5);
                DochazkaDny.Add(Polozka);
                SQLDochazka.Next();
            }
            String Stredisko = "";
            String Zakazka = "";
            Calendar Kalendar = new CultureInfo("cs-CZ").Calendar;
            Int32 PrvniTyden = Kalendar.GetWeekOfYear(new DateTime((int)numericUpDown_Rok.Value, (int)numericUpDown_Mesic.Value, 1), CalendarWeekRule.FirstDay, DayOfWeek.Monday);
            Int32 Tyden = 0;
            Int32 AktualniTyden;
            Int32 DenTydne;
            Int32 Radek = 0;
            TableLayoutPanel TydenTable = null;
            foreach (DochazkaStruct item in DochazkaDny)
            {
                //if (PrvniTyden == 0)
                //    PrvniTyden = Kalendar.GetWeekOfYear(item.Datum, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
                AktualniTyden = Kalendar.GetWeekOfYear(item.Datum, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
                DenTydne = (Int32)Kalendar.GetDayOfWeek(item.Datum);
                DenTydne = DenTydne == 0 ? 8 : DenTydne + 1;
                if (Tyden != AktualniTyden)
                {
                    Stredisko = item.Stredisko;
                    Zakazka = item.Zakazka;
                    Tyden = AktualniTyden;
                    Radek = 0;
                    TydenTable = (TableLayoutPanel)(((Panel)(((TableLayoutPanel)(panel_Formular.Controls[0])).GetControlFromPosition(0, AktualniTyden - PrvniTyden))).Controls[0]);
                    ((TextBox)(((TableLayoutPanel)(TydenTable.GetControlFromPosition(0, 2))).GetControlFromPosition(0, Radek))).Text = item.Stredisko;
                    ((TextBox)(((TableLayoutPanel)(TydenTable.GetControlFromPosition(0, 2))).GetControlFromPosition(1, Radek))).Text = item.Zakazka;
                }
                Stredisko = item.Stredisko;
                Zakazka = item.Zakazka;
                Radek = PridejRadek(AktualniTyden, Stredisko, Zakazka, DenTydne);
                ((TextBox)(((TableLayoutPanel)(TydenTable.GetControlFromPosition(0, 2))).GetControlFromPosition(DenTydne, Radek))).Text = item.Cinnost;
                ((TextBox)(((TableLayoutPanel)(TydenTable.GetControlFromPosition(0, 4))).GetControlFromPosition(DenTydne, Radek))).Text = item.Hodiny.ToString();
                SectiHodiny(((TextBox)(((TableLayoutPanel)(TydenTable.GetControlFromPosition(0, 4))).GetControlFromPosition(DenTydne, Radek))));
            }
            panel_Formular.Visible = true;
        }
开发者ID:BelegCufea,项目名称:EurogemaIN,代码行数:64,代码来源:DochazkaForm.cs

示例2: PripravFormularMesic


//.........这里部分代码省略.........
                                Text.KeyDown += ZpracujKlavesy;
                                Text.Validating += KontrolaStrediska_Validating;
                                Text.Enter += PodbarviFocusRadku_Enter;
                                Text.Tag = ("S" + Tyden + "_1");
                                toolTip_CtrlEnter.SetToolTip(Text, "CTRL+Enter = výběr úseku");
                                DenTable.Controls.Add(Text, 0, 0);
                                Text = new TextBox();
                                Text.Dock = DockStyle.Top;
                                Text.Height = 16;
                                Text.TextAlign = HorizontalAlignment.Center;
                                Text.DoubleClick += VyberZakazky_DblClick;
                                Text.PreviewKeyDown += AllowKeys;
                                Text.KeyDown += VyberZakazky_CtrlEnter;
                                Text.KeyDown += ZpracujKlavesy;
                                Text.Validating += KontrolaZakazky_Validating;
                                Text.Enter += PodbarviFocusRadku_Enter;
                                Text.Tag = ("Z" + Tyden + "_1");
                                toolTip_CtrlEnter.SetToolTip(Text, "CTRL+Enter = výběr zakázky");
                                DenTable.Controls.Add(Text, 1, 0);
                                break;
                            case 3:
                                Popisek = new Label();
                                Popisek.Text = "Hodiny";
                                Popisek.Dock = DockStyle.Top;
                                Popisek.Height = 16;
                                Popisek.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                                DenTable.Controls.Add(Popisek);
                                DenTable.SetColumnSpan(Popisek, 9);
                                break;
                            case 4:
                                Tlacitko = new Button();
                                Tlacitko.Text = "+";
                                Tlacitko.Width = 24;
                                Tlacitko.Height = 16;
                                Tlacitko.TabStop = false;
                                Tlacitko.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                                Tlacitko.Click += PridejRadek_Click;
                                Tlacitko.Tag = ("B" + Tyden + "_1");
                                DenTable.Controls.Add(Tlacitko, 0, 0);
                                break;
                            default:
                                break;
                        }
                        TydenTable.Controls.Add(DenTable, 0, Radek);
                    }
                    Panel TydenPanel = new Panel();
                    TydenPanel.BorderStyle = BorderStyle.Fixed3D;
                    TydenPanel.AutoSize = true;
                    TydenPanel.Controls.Add(TydenTable);
                    TydenPanel.Tag = Tyden;
                    Formular.Controls.Add(TydenPanel, 0, Tyden - PrvniTyden);
                    AktalniTyden = Tyden;
                }
                DenTydne = (Int32)Kalendar.GetDayOfWeek(Datum);
                DenTydne = DenTydne == 0 ? 8 : DenTydne + 1;
                Popisek = new Label();
                Popisek.Text = Datum.Day.ToString();
                Popisek.Dock = DockStyle.Top;
                Popisek.Height = 16;
                Popisek.Tag = Datum.Day;
                Popisek.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                if (!Svatky.EOF())
                {
                    if (Svatky.FieldValues(1) == 1)
                        Popisek.BackColor = System.Drawing.Color.Cyan;
                    if (Svatky.FieldValues(2))
                        Popisek.BackColor = System.Drawing.Color.Red;
                    Svatky.Next();
                }
                ((TableLayoutPanel)((TableLayoutPanel)((Panel)(Formular.GetControlFromPosition(0, AktalniTyden - PrvniTyden))).Controls[0]).GetControlFromPosition(0, 0)).Controls.Add(Popisek, DenTydne, 0);
                Text = new TextBox();
                Text.Dock = DockStyle.Top;
                Text.Height = 16;
                Text.TextAlign = HorizontalAlignment.Center;
                toolTip_CtrlEnter = new ToolTip();
                Text.DoubleClick += VyberCinnost_DblClick;
                Text.PreviewKeyDown += AllowKeys;
                Text.KeyDown += VyberCinnost_CtrlEnter;
                Text.KeyDown += ZpracujKlavesy;
                Text.Enter += PodbarviFocusRadku_Enter;
                Text.Validating += KontrolaCinnosti_Validating;
                toolTip_CtrlEnter.SetToolTip(Text, "CTRL+Enter = výběr činnosti");
                Text.Tag = ("C" + Den + "_1");
                ((TableLayoutPanel)((TableLayoutPanel)((Panel)(Formular.GetControlFromPosition(0, AktalniTyden - PrvniTyden))).Controls[0]).GetControlFromPosition(0, 2)).Controls.Add(Text, DenTydne, 0);
                Text = new TextBox();
                Text.Dock = DockStyle.Top;
                Text.Height = 16;
                Text.TextAlign = HorizontalAlignment.Center;
                Text.Tag = ("H" + Den + "_1");
                Text.PreviewKeyDown += AllowKeys;
                Text.KeyDown += ZpracujKlavesy;
                Text.Enter += PodbarviFocusRadku_Enter;
                Text.Validating += KontrolaHodin_Validating;
                ((TableLayoutPanel)((TableLayoutPanel)((Panel)(Formular.GetControlFromPosition(0, AktalniTyden - PrvniTyden))).Controls[0]).GetControlFromPosition(0, 4)).Controls.Add(Text, DenTydne, 0);
            }

            panel_Formular.Controls.Add(Formular);
            FocusTyden = 0;
            FocusRadek = 0;
        }
开发者ID:BelegCufea,项目名称:EurogemaIN,代码行数:101,代码来源:DochazkaForm.cs


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