Exemple #1
0
 /// <summary>
 /// 开启密码效验窗体
 /// </summary>
 /// <returns></returns>
 public virtual bool Validation(_COBJECTS p_info)
 {
     //如果为null或者为空验证通过
     if (p_info.PassWord != string.Empty)
     {
         CValidationPWD form = new CValidationPWD();
         form.Source = p_info;
         DialogResult r = form.ShowDialog();
         if (r == DialogResult.OK)
         {
             //验证通过
             return(true);
         }
         return(false);
     }
     return(true);
 }
Exemple #2
0
        /// <summary>
        /// 根据文件对象打开文件业务
        /// </summary>
        /// <param name="p_Info"></param>

        /*public bool OpenProject(FileInfo p_Info)
         * {
         *  //如果文件存在
         *  if (p_Info.Exists)
         *  {
         *      CResult r = APP.Methods.Open(p_Info.FullName);
         *      //创建文件对象
         *      if (r.Success)
         *      {
         *          _Business bus = r.Value as _Business;
         *          if (this.Validation(bus))
         *          {
         *              //开启新业务窗体
         *              this.ActionFace.OpenNewBussinessForm(bus);
         *              return true;
         *          }
         *          else
         *          {
         *              return false;
         *          }
         *      }
         *      else
         *      {
         *          MessageBox.Show(this, r.ErrorInformation, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         *          return false;
         *      }
         *  }
         *  return false;
         *
         * }*/

        /// <summary>
        ///  打开项目(打开方式)
        /// </summary>

        /*private void OpenProject()
         * {
         *  System.Windows.Forms.DialogResult result = this.openFileDialog1.ShowDialog();
         *
         *  if (result == DialogResult.OK)
         *  {
         *      CResult r = APP.Methods.Open(this.openFileDialog1.FileName);
         *     //创建文件对象
         *     if (r.Success)
         *     {
         *         _Business bus = r.Value as _Business;
         *         if (this.Validation(bus))
         *         {
         *             //开启新业务窗体
         *             this.ActionFace.OpenNewBussinessForm(bus);
         *         }
         *     }
         *     else
         *     {
         *         MessageBox.Show(this, r.ErrorInformation, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         *     }
         *  }
         * }*/

        /// <summary>
        /// 开启密码效验窗体
        /// </summary>
        /// <returns></returns>
        public bool Validation(_Business p_bus)
        {
            //如果为null或者为空验证通过
            if (p_bus.Current.PassWord != string.Empty)
            {
                CValidationPWD form = new CValidationPWD();
                form.CurrentBusiness = p_bus;
                form.Source          = p_bus.Current;
                DialogResult r = form.ShowDialog();
                if (r == DialogResult.OK)
                {
                    //验证通过
                    return(true);
                }
                return(false);
            }
            return(true);
        }