Exemple #1
0
        protected override void ExecDisp()
        {
            for (int i = 0; i < detailControls.Length; i++)
            {
                if (CheckDetail(i) == false)
                {
                    detailControls[i].Focus();
                    return;
                }
            }

            mbl = new Staff_BL();
            bool ret = BindGrid();

            if (ret)
            {
                dgvDetail.SelectionMode       = DataGridViewSelectionMode.RowHeaderSelect;
                dgvDetail.CurrentRow.Selected = true;
                dgvDetail.Enabled             = true;
                dgvDetail.Focus();
            }
            else
            {
                mbl.ShowMessage("E128");
            }
        }
Exemple #2
0
        private bool CheckDetail(int index)
        {
            switch (index)
            {
            case (int)EIndex.StoreCD:
                //入力なければチェックなし
                if (detailControls[index].Text == "")
                {
                    ScStore.LabelText = "";
                    return(true);
                }
                else
                {
                    //ストアマスタデータチェック
                    Store_BL       mbl = new Store_BL();
                    M_Store_Entity mse = new M_Store_Entity
                    {
                        StoreCD    = detailControls[index].Text,
                        ChangeDate = ckM_Label1.Text
                    };

                    DataTable dt = mbl.M_Store_Select(mse);
                    if (dt.Rows.Count > 0)
                    {
                        ScStore.LabelText = dt.Rows[0]["StoreName"].ToString();
                    }
                    else
                    {
                        //E136
                        mbl.ShowMessage("E136");
                        ScStore.LabelText = "";
                        return(false);
                    }
                }
                break;

            case (int)EIndex.StaffName:

                break;

            case (int)EIndex.StaffTo:
                if (detailControls[index].Text != "")
                {
                    int result = detailControls[index].Text.CompareTo(detailControls[index - 1].Text);
                    if (result < 0)
                    {
                        //E106
                        mbl.ShowMessage("E106");
                        detailControls[index].Focus();
                        return(false);
                    }
                }
                break;
            }

            return(true);
        }