Example #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            tmS            = new mcStaff();
            tmS.Account    = mscCtrl.Me.Account;
            tmS.Authority  = mscCtrl.Me.Authority;
            tmS.Name       = dgvStaff.Rows[0].Cells[1].Value.ToString();
            tmS.Email      = dgvStaff.Rows[1].Cells[1].Value.ToString();
            tmS.Major      = dgvStaff.Rows[2].Cells[1].Value.ToString();
            tmS.Remark     = dgvStaff.Rows[3].Cells[1].Value.ToString();
            tmS.Department = lblDepartment.Tag.ToString();

            if (this.Height > 300)
            {
                string tOPW = mcStaff.enCode(mscCtrl.Me.Account, txtOPW.Text);
                string tNPW = txtNPW.Text;
                string tCPW = txtCPW.Text;
                tmS.Password = tNPW;

                if (tNPW != tCPW)
                {
                    MessageBox.Show("两次密码输入不一致。", " missions", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }
                mscCtrl.accountLogIn(mscCtrl.Me.Account, tOPW, "FmStaffInfo");
            }
            else
            {
                mscCtrl.updateStaffInfo(tmS);
            }
        }
Example #2
0
 public FmMain(mcStaff pmS)
 {
     InitializeComponent();
     mscCtrl.init_msDGV(msdgvStaff, "人员姓名");
     mscCtrl.init_msDGV(msdgvMission, "任务名称");
     mscCtrl.searchStaffs(pmS);
 }
Example #3
0
        public static void searchMissions(mcStaff pmS)
        {
            DataTable tDT = pmS.toDT();

            tDT = addTableHead("searchMissions", false, string.Empty, "FmMain", tDT);
            socket.Send(tDT);
        }
Example #4
0
        public static void searchStaffsApp(mcStaff pmS)
        {
            DataTable tDT = pmS.toDT();

            tDT = addTableHead("searchStaffsApp", false, string.Empty, "FmStaffs", tDT);
            socket.Send(tDT);
        }
Example #5
0
 private void btnAuthority_Click(object sender, EventArgs e)
 {
     if (dgvStaffs.SelectedRows.Count == 1)
     {
         DataRow slDR = staffsDT.Rows[dgvStaffs.SelectedRows[0].Index];
         mcStaff tmS  = new mcStaff(slDR);
         tmS.Authority = cbAuthority.Text;
         mscCtrl.updateStaffInfo(tmS, "", "FmStaffs");
     }
 }
Example #6
0
        public void Flash_Missions()
        {                //刷新窗体
            DataTable tDT = new mcStaff().toDT();

            foreach (mcStaff femS in staffs.Values)
            {
                tDT.ImportRow(femS.toDT().Rows[0]);
            }
            tDT.Rows.RemoveAt(0);
            mscCtrl.searchMissions(tDT, "staffs", "FmMain");
        }
Example #7
0
 public void FillStaffList(DataTable pDT)
 {
     staffs = new Dictionary <string, missions.mcStaff>();
     foreach (DataRow feDR in pDT.Rows)
     {
         mcStaff tmS = new mcStaff(feDR);
         staffs.Add(tmS.Account, tmS);
     }
     flash_msdgvStaff();
     flash_Controls();
 }
Example #8
0
 public void logIn(mcStaff pmS, string pMessage = "")
 {
     if (pmS == null)
     {
         lblLogInEx.Text = pMessage;
     }
     else
     {
         this.DialogResult = DialogResult.Yes;
         rtmStaff          = pmS;
         this.Close();
     }
 }
Example #9
0
 private void btnAuthorize_Click(object sender, EventArgs e)
 {
     if (dgvStaffs.SelectedRows.Count == 1)
     {
         DataRow slDR = staffsDT.Rows[dgvStaffs.SelectedRows[0].Index];
         mcStaff tmS  = new mcStaff(slDR);
         if (!tmS.Department.StartsWith("-"))
         {
             return;
         }
         tmS.Department = tmS.Department.Remove(0, 1);
         mscCtrl.updateStaffInfo(tmS, "", "FmStaffs");
     }
 }
Example #10
0
        private void tryToSignIn()
        {
            mcStaff tmS = new mcStaff();

            if (!checkInfo())
            {
                return;
            }
            tmS.Account  = txtAccountSign.Text;
            tmS.Name     = txtName.Text;
            tmS.Password = txtPasswordSign.Text;
            tmS.Email    = txtEmail.Text;
            mscCtrl.accountSignIn(tmS);
        }
Example #11
0
 private void flashFm()
 {
     if (dgvStaffs.SelectedRows.Count == 1)
     {
         DataRow slDR = staffsDT.Rows[dgvStaffs.SelectedRows[0].Index];
         mcStaff tmS  = new mcStaff(slDR);
         lblSelectedStaff.Text    = tmS.Name;
         lblSelectedStaff.Visible = true;
         btnAuthorize.Visible     = tmS.Department.StartsWith("-");
         gbAuthority.Visible      = (tmS.Account != mscCtrl.Me.Account) && (!tmS.Department.StartsWith("-"));//如果选中自己,则不允许调整权限
         cbAuthority.Text         = tmS.Authority;
     }
     else
     {
         lblSelectedStaff.Visible = false;
         btnAuthorize.Visible     = false;
         gbAuthority.Visible      = false;
     }
 }
Example #12
0
        private mcMission getCurrentMission()
        {
            if (msdgvMission.SelectedRows.Count == 0)
            {
                return(null);
            }
            mcStaff tmS = getCurrentStaff();

            if (tmS == null)
            {
                return(null);
            }
            var tTag = msdgvMission.SelectedRows[0].Tag;

            if (tTag == null)
            {
                return(null);
            }
            string tKey = tTag.ToString();

            return(tmS.KeyToMission[tKey]);
        }
Example #13
0
 public static FmMain NewFmMain(mcStaff pmS)
 {
     fmMain = new missions.FmMain(pmS);
     return(fmMain);
 }
Example #14
0
        public static void updateStaffInfo(mcStaff pmS, string pMessage = "", string pFm = "FmStaffInfo")
        {
            DataTable tDT = pmS.toDT();

            socket.Send(addTableHead("updateStaffInfo", false, pMessage, pFm, tDT));
        }
Example #15
0
        public static void accountSignIn(mcStaff pmS)
        {
            DataTable tDT = pmS.toDT();

            socket.Send(addTableHead("accountSignIn", false, string.Empty, "FmLogIn", tDT));
        }