Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                if (station == null)
                {
                    MessageBox.Show("无法取得站台信息", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                station.INTO_FLAG = rdoAllowed.Checked ? "0" : "1";
                station.Save();

                FNJISEKIEntity jiseki = new FNJISEKIEntity();
                jiseki.SAGYOKBN    = rdoAllowed.Checked ? "F" : "G";
                jiseki.USERID      = GlobalAccess.UserId;
                jiseki.USERNAME    = GlobalAccess.UserName;
                jiseki.SAKUSEIHIJI = DateTime.Now.ToString("yyyyMMddHHmmss");
                jiseki.ENDSTNO     = GlobalAccess.StationNo;
                jiseki.Save();

                MessageBox.Show("设定成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                setUI();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 2
0
        private void quitBtn_Click(object sender, EventArgs e)
        {
            try
            {
                FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                if (station == null)
                {
                    MessageBox.Show("无法取得站台信息", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                station.INTO_FLAG = "1";
                station.Save();

                FNJISEKIEntity jiseki = new FNJISEKIEntity();
                jiseki.SAGYOKBN    = "G";
                jiseki.USERID      = GlobalAccess.UserId;
                jiseki.USERNAME    = GlobalAccess.UserName;
                jiseki.SAKUSEIHIJI = DateTime.Now.ToString("yyyyMMddHHmmss");
                jiseki.ENDSTNO     = GlobalAccess.StationNo;
                jiseki.Save();

                this.Close();
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
        }