/// <summary>
        /// 画面クリア
        /// </summary>
        private void Scr_Clr()
        {
            foreach (Control ctl in detailControls)
            {
                ctl.Text = "";
            }

            //初期値設定
            if (DateTime.TryParse(ChangeDate, out DateTime dt))
            {
                ckM_Label1.Text = ChangeDate;
            }
            else
            {
                ckM_Label1.Text = zibl.GetDate();
            }

            if (!string.IsNullOrWhiteSpace(SoukoCD))
            {
                CboFromSoukoCD.SelectedValue = SoukoCD;
                CboFromSoukoCD.Enabled       = false;
            }
        }
Exemplo n.º 2
0
        private bool CheckDetail(int index)
        {
            switch (index)
            {
            case (int)EIndex.DayStart:
            case (int)EIndex.DayEnd:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    return(true);
                }

                detailControls[index].Text = zibl.FormatDate(detailControls[index].Text);

                //日付として正しいこと(Be on the correct date)E103
                if (!zibl.CheckDate(detailControls[index].Text))
                {
                    //E103
                    zibl.ShowMessage("E103");
                    return(false);
                }
                //(From) ≧ (To)である場合Error
                if (index == (int)EIndex.DayEnd)
                {
                    if (!string.IsNullOrWhiteSpace(detailControls[index - 1].Text) && !string.IsNullOrWhiteSpace(detailControls[index].Text))
                    {
                        int result = detailControls[index].Text.CompareTo(detailControls[index - 1].Text);
                        if (result < 0)
                        {
                            //E106
                            zibl.ShowMessage("E104");
                            detailControls[index].Focus();
                            return(false);
                        }
                    }
                }

                break;

            case (int)EIndex.FromSoukoCD:

                break;

            case (int)EIndex.StaffCD:
                if (string.IsNullOrWhiteSpace(detailControls[index].Text))
                {
                    ScStaff.LabelText = "";
                    return(true);
                }

                //スタッフマスター(M_Staff)に存在すること
                //[M_Staff]
                M_Staff_Entity mse = new M_Staff_Entity
                {
                    StaffCD    = detailControls[index].Text,
                    ChangeDate = zibl.GetDate()     // detailControls[(int)EIndex.MitsumoriDate].Text
                };
                Staff_BL bl  = new Staff_BL();
                bool     ret = bl.M_Staff_Select(mse);
                if (ret)
                {
                    ScStaff.LabelText = mse.StaffName;
                }
                else
                {
                    zibl.ShowMessage("E101");
                    ScStaff.LabelText = "";
                    return(false);
                }
                break;
            }

            return(true);
        }