Пример #1
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            try
            {
                if (checkIsSelected())
                {
                    for (int i = 0; i < panel19.Controls.Count; i++)
                    {
                        UserForNewDoor temp = (UserForNewDoor)panel19.Controls[i];
                        if (temp.isSelect)
                        {
                            temp.ModifyInterFace();
                            break;
                        }
                    }
                    switch (SelectCardType)
                    {
                    case 1: btnValid_Click(btnValid, null); break;

                    case 2: btnValid_Click(btnLost, null); break;

                    case 3: btnValid_Click(btnFobib, null); break;
                    }
                    SetCount();
                }
                else
                {
                    MessageBox.Show(CsConst.mstrINIDefault.IniReadValue("Public", "99775", ""), ""
                                    , MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
            catch
            {
            }
        }
Пример #2
0
 private void cbHint_SelectedIndexChanged(object sender, EventArgs e)
 {
     for (int i = 0; i < panel19.Controls.Count; i++)
     {
         UserForNewDoor temp = (UserForNewDoor)panel19.Controls[i];
         temp.LoadUser(cbHint.SelectedIndex);
     }
 }
Пример #3
0
 private void UserForNewDoor_MouseClick(object sender, MouseEventArgs e)
 {
     for (int i = 0; i < Pnl.Controls.Count; i++)
     {
         UserForNewDoor temp = (UserForNewDoor)Pnl.Controls[i];
         temp.SetSelect();
     }
     picSelect.Visible = true;
     isSelect          = true;
 }
Пример #4
0
        private bool checkIsSelected()
        {
            bool isSelected = false;

            for (int i = 0; i < panel19.Controls.Count; i++)
            {
                UserForNewDoor temp = (UserForNewDoor)panel19.Controls[i];
                if (temp.isSelect)
                {
                    isSelected = true;
                    break;
                }
            }
            return(isSelected);
        }
Пример #5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (checkIsSelected())
                {
                    for (int i = 0; i < panel19.Controls.Count; i++)
                    {
                        UserForNewDoor temp = (UserForNewDoor)panel19.Controls[i];
                        if (temp.isSelect)
                        {
                            if (temp.DeleteCard())
                            {
                                switch (SelectCardType)
                                {
                                case 1: btnValid_Click(btnValid, null); break;

                                case 2: btnValid_Click(btnLost, null); break;

                                case 3: btnValid_Click(btnFobib, null); break;
                                }
                                SetCount();
                                break;
                            }
                            else
                            {
                                Cursor.Current = Cursors.Default;
                                MessageBox.Show(CsConst.mstrINIDefault.IniReadValue("Public", "99776", ""), ""
                                                , MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                                return;
                            }
                        }
                    }
                }
                else
                {
                    Cursor.Current = Cursors.Default;
                    MessageBox.Show(CsConst.mstrINIDefault.IniReadValue("Public", "99775", ""), ""
                                    , MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
            catch
            {
            }
            Cursor.Current = Cursors.Default;
        }
Пример #6
0
        private void UserForNewDoor_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (oNewDS == null)
            {
                return;
            }
            if (oNewDS.MyCardInfo == null)
            {
                return;
            }
            picSelect.Visible = true;
            isSelect          = true;
            byte[]        arayTmp = new byte[0];
            FrmAddNewCard frmTmp  = new FrmAddNewCard(arayTmp, oNewDS, DeviceType, StrName, 1, ID);

            frmTmp.ShowDialog();
            int Width = Pnl.Width;
            int Heigh = Pnl.Height;

            Pnl.Controls.Clear();
            int WCount = Width / 150;
            int num    = 0;

            for (int i = 0; i < oNewDS.MyCardInfo.Count; i++)
            {
                NewDS.CardInfo temp = oNewDS.MyCardInfo[i];
                if (temp.CardType == Convert.ToByte(intTag))
                {
                    UserForNewDoor tmp = new UserForNewDoor(oNewDS, i, DeviceType, ShowType, StrName, Pnl, intTag, Frm);
                    tmp.Name = "Card" + num.ToString();
                    tmp.Left = (num % WCount) * 140 + 10;
                    tmp.Top  = (num / WCount) * 120 + 10;
                    Pnl.Controls.Add(tmp);
                    num = num + 1;
                }
            }
            if (Frm is FrmNewDS)
            {
                (Frm as FrmNewDS).SetCount();
            }
            else if (Frm is frmDS)
            {
                (Frm as frmDS).SetCount();
            }
        }
Пример #7
0
 private void btnValid_Click(object sender, EventArgs e)
 {
     try
     {
         if (oNewDS == null)
         {
             return;
         }
         if (oNewDS.MyCardInfo == null)
         {
             return;
         }
         btnValid.BackColor = Color.Transparent;
         btnLost.BackColor  = Color.Transparent;
         btnFobib.BackColor = Color.Transparent;
         int Width = panel19.Width;
         int Heigh = panel19.Height;
         int Tag   = Convert.ToInt32((sender as Button).Tag);
         (sender as Button).BackColor = Color.Yellow;
         SelectCardType = Tag;
         panel19.Controls.Clear();
         int WCount = Width / 150;
         int num    = 0;
         for (int i = 0; i < oNewDS.MyCardInfo.Count; i++)
         {
             NewDS.CardInfo temp = oNewDS.MyCardInfo[i];
             if (temp.CardType == Convert.ToByte(Tag))
             {
                 UserForNewDoor tmp = new UserForNewDoor(oNewDS, i, MyintDeviceType, cbHint.SelectedIndex, myDevName, panel19, SelectCardType, this);
                 tmp.Name = "Card" + num.ToString();
                 tmp.Left = (num % WCount) * 140 + 10;
                 tmp.Top  = (num / WCount) * 120 + 10;
                 panel19.Controls.Add(tmp);
                 num = num + 1;
             }
         }
     }
     catch
     {
     }
 }