コード例 #1
0
        private void DataGridviewBind()
        {
            MasterTourokuStaff obj = new MasterTourokuStaff();

            obj.ChangeDate = changeDate_Access;
            obj.StaffCD    = txtStaff1.Text;
            obj.Passward   = txtStaff2.Text;//using tempory for assign data
            obj.StaffName  = txtStaffName.Text;
            obj.KanaName   = txtKanaName.Text;
            obj.Remarks    = string.Empty;
            if (rdo_Date.Checked)
            {
                obj.Remarks = "RevisionDate";
            }
            if (rdo_All.Checked)
            {
                obj.Remarks = "All";
            }
            StaffBL   objMethod = new StaffBL();
            DataTable dt        = objMethod.Staff_Search(obj);

            if (dt.Columns.Contains("CurrentDay"))
            {
                if (dt.Rows.Count > 0)
                {
                    lbl_Date.Text = String.Format("{0:yyyy/MM/dd}", dt.Rows[0]["CurrentDay"]);
                    //dt.Columns.Remove("CurrentDay");
                }
                else
                {
                    ClearSession();     //HET
                }
            }
            else
            {
                if (dt.Rows.Count == 0)     //HET
                {
                    ClearSession();
                }
            }
            // dt.Columns.Remove("CurrentDay");
            gvStaff.DataSource = dt;
        }