Exemplo n.º 1
0
        private void mnu_AddTemplate_Click(object sender, EventArgs e)
        {
            FrmFingerResgister frm = new FrmFingerResgister();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                StaffBioTemplate sbt = new StaffBioTemplate();
                sbt.ID        = Guid.NewGuid();
                sbt.BioSource = (BioSource)frm.BioSource;
                sbt.Version   = frm.Version;
                sbt.Template  = frm.Template;
                sbt.IsBiokey  = true;
                if (UpdatingItem != null)
                {
                    Staff staff = UpdatingItem as Staff;
                    sbt.StaffID = staff.ID;
                    CommandResult ret = (new StaffBLL(AppSettings.CurrentSetting.ConnectUri)).SaveTemplate(sbt);
                    if (ret.Result != ResultCode.Successful)
                    {
                        MessageBox.Show(ret.Message);
                    }
                    else
                    {
                        AddTemplateToGrid(sbt);
                    }
                }
                else
                {
                    AddTemplateToGrid(sbt);
                }
            }
        }
Exemplo n.º 2
0
 private void mnu_AddTemplate_Click(object sender, EventArgs e)
 {
     FrmFingerResgister frm = new FrmFingerResgister();
     if (frm.ShowDialog() == DialogResult.OK)
     {
         StaffBioTemplate sbt = new StaffBioTemplate();
         sbt.ID = Guid.NewGuid();
         sbt.BioSource = (BioSource)frm.BioSource;
         sbt.Version = frm.Version;
         sbt.Template = frm.Template;
         sbt.IsBiokey = true;
         if (UpdatingItem != null)
         {
             Staff staff = UpdatingItem as Staff;
             sbt.StaffID = staff.ID;
             CommandResult ret = (new StaffBLL(AppSettings.CurrentSetting.ConnectUri)).SaveTemplate(sbt);
             if (ret.Result != ResultCode.Successful)
             {
                 MessageBox.Show(ret.Message);
             }
             else
             {
                 AddTemplateToGrid(sbt);
             }
         }
         else
         {
             AddTemplateToGrid(sbt);
         }
     }
 }