當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。