Example #1
0
        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo();
            ListColumnsMaster_lcm_Info info = new ListColumnsMaster_lcm_Info();
            returnValue.messageText = "";
            info = itemEntity as ListColumnsMaster_lcm_Info;

            switch (EditMode)
            {
                case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                    bool isExist = false;

                    isExist = _ListColumnsMasterDA.IsExistRecord(info);
                    if (!isExist)
                    {
                        returnValue.boolValue = _ListColumnsMasterDA.InsertRecord(info);
                    }
                    else
                    {
                        returnValue.boolValue = false;
                        returnValue.messageText = "数据重复!";
                    }
                    break;
                case Common.DefineConstantValue.EditStateEnum.OE_Update:
                    returnValue.boolValue = _ListColumnsMasterDA.UpdateRecord(info);
                    break;
                case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                    returnValue.boolValue = _ListColumnsMasterDA.DeleteRecord(info);
                    break;
                default:
                    break;
            }

            return returnValue;
        }
Example #2
0
        Model.General.ReturnValueInfo BLL.IBLL.IMainBL.Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            Model.General.ReturnValueInfo returnInfo = new Model.General.ReturnValueInfo(false);

            if (itemEntity != null)
            {
                Model.HBPMS.Management.DataManagement.PLCErrorData_ped_Info objInfo = itemEntity as Model.HBPMS.Management.DataManagement.PLCErrorData_ped_Info;

                try
                {
                    switch (EditMode)
                    {
                        case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                            if (objInfo.ped_RecordID == Guid.Empty)
                            {
                                objInfo.ped_RecordID = Guid.NewGuid();
                            }
                            objInfo.ped_dAddDt = DateTime.Now;
                            objInfo.ped_dLastDt = DateTime.Now;

                            returnInfo.boolValue = this._PLCErrorData.InsertRecord(objInfo);

                            break;

                        case Common.DefineConstantValue.EditStateEnum.OE_Update:

                            objInfo.ped_dLastDt = DateTime.Now;

                            returnInfo.boolValue = this._PLCErrorData.UpdateRecord(objInfo);

                            break;

                        case Common.DefineConstantValue.EditStateEnum.OE_Delete:

                            returnInfo.boolValue = this._PLCErrorData.DeleteRecord(objInfo);

                            break;

                        case Common.DefineConstantValue.EditStateEnum.OE_ReaOnly:

                            break;

                        default:
                            break;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }

            }

            return returnInfo;
        }
Example #3
0
        /// <summary>
        /// 從DB中驗證登陸權限
        /// </summary>
        ///<param name="itemEntity"></param>
        /// <returns></returns>
        public Model.General.ReturnValueInfo Login(Model.IModel.IModelObject itemEntity)
        {
            try
            {
                Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
                Sys_UserMaster_usm_Info userInfo = null;

                Sys_UserMaster_usm_Info cond = itemEntity as Sys_UserMaster_usm_Info;

                string pwd = Common.General.MD5(cond.usm_cPasswork);

                List<Sys_UserMaster_usm_Info> users = this.m_objStateMonitorDAL.SearchRecords(cond);

                if (users.Count > 0)
                {
                    userInfo = users[0] as Sys_UserMaster_usm_Info;

                    if (userInfo.usm_cPasswork != pwd)
                    {
                        msg.boolValue = false;
                        msg.messageText = "密碼錯誤,請重新輸入!";
                    }
                    else if (userInfo.usm_iLock == true)
                    {
                        msg.boolValue = false;
                        msg.ValueObject = userInfo;
                        msg.messageText = "账户被锁,请与管理员联系!";
                    }
                    else
                    {
                        msg.boolValue = true;
                        msg.ValueObject = userInfo;
                    }
                }
                else
                {
                    msg.boolValue = false;
                    msg.messageText = "用戶不存在,請重新輸入!";

                }

                return msg;
            }
            catch { throw; }
        }
        public Model.General.ReturnValueInfo DeleteRecord(Model.IModel.IModelObject deleteInfo)
        {
            Model.General.ReturnValueInfo returnInfo = new Model.General.ReturnValueInfo();

            try
            {
                if (deleteInfo != null)
                {
                    returnInfo = _iccmDA.DeleteRecord(deleteInfo);
                }
            }
            catch (Exception ex)
            {
                returnInfo.boolValue = false;
                returnInfo.messageText = ex.ToString();
            }

            return returnInfo;
        }
Example #5
0
        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo();
            StructureMaster_stt_Info info = new StructureMaster_stt_Info();
            returnValue.messageText = "";
            info = itemEntity as StructureMaster_stt_Info;
            try
            {
                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:
                        bool isExist = false;

                        isExist = _structureMasterDA.IsExistRecord(info);
                        if (!isExist)
                        {
                            returnValue.boolValue = _structureMasterDA.InsertRecord(info);
                        }
                        else
                        {
                            returnValue.boolValue = false;
                            returnValue.messageText = "数据重复!";
                        }
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Update:
                        returnValue.boolValue = _structureMasterDA.UpdateRecord(info);
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Delete:

                        returnValue.boolValue = _structureMasterDA.DeleteRecord(info);

                        break;
                    default:
                        break;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return returnValue;
        }
Example #6
0
        private void btnValidation_Click(object sender, EventArgs e)
        {
            LoginFormBL mLoginBLL = new LoginFormBL();

            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            Sys_UserMaster_usm_Info mAuthUser = new Model.SysMaster.Sys_UserMaster_usm_Info();
            mAuthUser.usm_cUserLoginID = this.cboUserName.Text;
            mAuthUser.usm_cPasswork = this.txtPassword.Text;
            try
            {
                if (GlobalVar.IsOnline)
                {
                    //在線密碼驗證
                    msg = this.m_objStateMonitorBLL.Login(mAuthUser,this.FunctionCode);
                }
                else
                {
                    #region 离线密码检验
                    if (this.cboUserName.Text.ToLower() == "admin" && this.txtPassword.Text == DateTime.Now.ToString(DefineConstantValue.gc_PwdDateFormat))
                    {
                        msg.boolValue = true;

                    }
                    else
                    {
                        msg.boolValue = false;
                        msg.messageText = "帐号密码不正确,请重试!";
                    }
                    #endregion
                }
                if (msg.boolValue == true)
                {
                    this._loginName = this.cboUserName.Text;
                    WriteSetting();

                    this._dialogResult = DialogResult.Yes;

                    this.Close();
                }
                else
                {
                    ShowInformationMessage(msg.messageText);
                }
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
Example #7
0
 private void ToolBar_BtnDeleteClick(object sender, EventArgs e)
 {
     Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo();
     CodeMaster_cmt_Info info = new CodeMaster_cmt_Info();
     Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo();
     info.cmt_iRecordID = _CmtInfo.cmt_iRecordID;
     returnValue = _ICodeMasterBL.Save(info, DefineConstantValue.EditStateEnum.OE_Delete);
     if (returnValue.boolValue)
     {
         com.CommandType = Model.Base.DataBaseCommandType.Next;
         Model.Base.DataBaseCommandKeyInfo comKey = new Model.Base.DataBaseCommandKeyInfo();
         comKey.KeyValue = info.cmt_iRecordID.ToString();
         com.KeyInfoList.Add(comKey);
         try
         {
             _CmtInfo = _ICodeMasterBL.GetRecord_Next(com);
         }
         catch (Exception Ex)
         {
             ShowErrorMessage(Ex);
         }
         if (_CmtInfo == null)
         {
             com.CommandType = Model.Base.DataBaseCommandType.Previous;
             try
             {
                 _CmtInfo = _ICodeMasterBL.GetRecord_Previous(com);
             }
             catch (Exception Ex)
             {
                 ShowErrorMessage(Ex);
             }
             ShowData(_CmtInfo);
             this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly;
             SetControlStatus(DefineConstantValue.EditStateEnum.OE_ReaOnly);
             SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Last);
             if (_CmtInfo == null)
             {
                 cboKey1.Text = string.Empty;
                 SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Null);
             }
         }
     }
 }
Example #8
0
 private void UpdateSub(CodeMaster_cmt_Info info)
 {
     try
     {
         Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo();
         returnValue = _ICodeMasterBL.Save(info, DefineConstantValue.EditStateEnum.OE_Update);
         if (returnValue.boolValue)
         {
             SetControlStatus(DefineConstantValue.EditStateEnum.OE_ReaOnly);
             this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly;
         }
     }
     catch (Exception Ex)
     {
         ShowErrorMessage(Ex);
     }
 }
Example #9
0
        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            bool b;
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            Sys_FormMaster_fom_Info info = null;
            info = itemEntity as Sys_FormMaster_fom_Info;

            if (info == null)
            {
                msg.boolValue = false;
                msg.messageText = "传入的数据为空!";

                return msg;
            }

            try
            {
                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                        b = this._sysFormMasterDA.DeleteRecord(info);
                        if (b == true)
                        {
                            msg.boolValue = true;

                            msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_RecordByDelete;
                        }
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                        b = this._sysFormMasterDA.IsExistRecord(info);
                        if (b == false)
                        {
                            info.fom_dAddDate = DateTime.Now;

                            info.fom_dLastDate = DateTime.Now;

                            msg.boolValue = this._sysFormMasterDA.InsertRecord(info);
                        }
                        else
                        {
                            msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_AddFail + "  表单编号重复!";
                        }
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Update:

                        info.fom_dLastDate = DateTime.Now;

                        msg.boolValue = this._sysFormMasterDA.UpdateRecord(info);

                        //if (b == true)
                        //{
                        //    msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_UpdateSuccess;
                        //}
                        //else
                        //{
                        //    msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_UpdateFail;
                        //}
                        break;
                }
            }
            catch (Exception Ex)
            {
                msg.messageText = Ex.Message;

            }
            return msg;
        }
Example #10
0
        private void SaveSub(CodeMaster_cmt_Info info)
        {
            try
            {
                Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo();
                returnValue = _ICodeMasterBL.Save(info, DefineConstantValue.EditStateEnum.OE_Insert);
                if (returnValue.boolValue)
                {
                    BindCombox(DefineConstantValue.MasterType.CodeMaster_Key1, null);
                    _CmtInfo = _ICodeMasterBL.GetRecord_Last();
                    SetControlStatus(DefineConstantValue.EditStateEnum.OE_ReaOnly);
                    this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly;

                    ShowData(_CmtInfo);
                }
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
Example #11
0
        public Model.General.ReturnValueInfo Login(Model.IModel.IModelObject itemEntity)
        {
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            Sys_UserMaster_usm_Info userInfo = null;
            try
            {

                Sys_UserMaster_usm_Info cond = itemEntity as Sys_UserMaster_usm_Info;
                string pwd = Common.General.MD5(cond.usm_cPasswork);
                cond.usm_cPasswork = string.Empty;
                if (cond.usm_cUserLoginID.ToUpper() == "SA")
                {

                    if (pwd == Common.General.MD5(DateTime.Now.ToString(DefineConstantValue.gc_PwdDateFormat)))
                    {
                        userInfo = this._loginFormDA.FindAllPermission(cond);
                        msg.boolValue = true;
                        msg.ValueObject = userInfo;
                    }
                    else
                    {
                        msg.boolValue = false;
                        msg.messageText = "密碼錯誤,請重新輸入!";
                    }
                }
                else
                {

                    List<IModelObject> users = SearchRecords(itemEntity);

                    if (users.Count > 0)
                    {
                        userInfo = users[0] as Sys_UserMaster_usm_Info;

                        if (userInfo.usm_cPasswork != pwd)
                        {
                            msg.boolValue = false;
                            msg.messageText = "密碼錯誤,請重新輸入!";
                        }
                        else if (userInfo.usm_iLock == true)
                        {
                            msg.boolValue = false;
                            msg.ValueObject = userInfo;
                            msg.messageText = "账户被锁,请与管理员联系!";
                        }
                        else
                        {
                            msg.boolValue = true;
                            msg.ValueObject = userInfo;
                        }
                    }
                    else
                    {
                        msg.boolValue = false;
                        msg.messageText = "用戶不存在,請重新輸入!";

                    }
                }

                return msg;
            }
            catch (Exception Ex)
            {
                msg.boolValue = false;
                msg.messageText = Ex.ToString();
                return msg;
            }
        }
Example #12
0
        public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
        {
            bool b;
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            Sys_UserMaster_usm_Info info = null;
            info = itemEntity as Sys_UserMaster_usm_Info;

            if (info == null)
            {
                msg.boolValue = false;
                msg.messageText = "传入的数据为空!";

                return msg;
            }

            try
            {
                if (info.usm_cPwd != null && info.usm_cPwd != "")
                {
                    info.usm_cPwd = Common.General.MD5(info.usm_cPwd);
                }

                switch (EditMode)
                {
                    case Common.DefineConstantValue.EditStateEnum.OE_Delete:
                        msg.boolValue = this._sysUserMasterDA.DeleteRecord(info);
                        if (msg.boolValue == true)
                        {
                            msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_RecordByDelete;
                        }
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Insert:

                        b = this._sysUserMasterDA.IsExistRecord(info);
                        if (b == false)
                        {
                            msg.boolValue = this._sysUserMasterDA.InsertRecord(info);
                        }
                        else
                        {
                            msg.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_I_AddFail + "  登陆ID重復!";
                        }
                        break;
                    case Common.DefineConstantValue.EditStateEnum.OE_Update:

                        msg.boolValue = this._sysUserMasterDA.UpdateRecord(info);
                        break;
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }
            return msg;
        }
Example #13
0
 public Model.General.ReturnValueInfo Login(Model.IModel.IModelObject itemEntity)
 {
     Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
     Sys_UserMaster_usm_Info userInfo = null;
     try
     {
         userInfo = DisplayRecord(itemEntity) as Sys_UserMaster_usm_Info;
         if (userInfo == null)
         {
             msg.boolValue = false;
             msg.messageText = "密码错误,请确认您是管理员身份!";
         }
         else
         {
             if (userInfo.usm_cUserLoginID == "")
             {
                 msg.boolValue = false;
                 msg.messageText = "用户名或密码错误!";
             }
             else
             {
                 msg.boolValue = true;
                 if (userInfo.usm_iLock == true)
                 {
                     msg.messageText = "账户被锁,请与管理员联系!";
                 }
                 msg.ValueObject = userInfo;
             }
         }
         return msg;
     }
     catch (Exception Ex)
     {
         msg.boolValue = false;
         msg.messageText = Ex.ToString();
         return msg;
     }
 }
Example #14
0
        private void Login_Click(object sender, EventArgs e)
        {
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            try
            {
                msg = this.m_objStateMonitorManager.Login(this._stateMonitorBase.TextBoxUserName.Text.Trim(), this._stateMonitorBase.TextBoxPassword.Text.Trim());

                if (msg.boolValue == true)
                {
                    IsLogined(true);
                    this._stateMonitorBase.TextBoxPassword.Text = "";
                    this._stateMonitorBase.TextBoxUserName.Focus();
                    return;
                }
                else
                {
                    IsLogined(false);
                    this._stateMonitorBase.TextBoxPassword.Text = "";
                    this._stateMonitorBase.TextBoxUserName.Focus();
                    this.ShowInformationMessage(msg.messageText);
                }
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
        public Model.General.ReturnValueInfo UpdateRecord(Model.IModel.IModelObject updateInfo)
        {
            Model.General.ReturnValueInfo returnInfo = new Model.General.ReturnValueInfo();
            try
            {
                if(updateInfo != null)
                {
                    returnInfo = _iccmDA.UpdateRecord(updateInfo as ConsumeCardMaster_ccm_Info);
                }
            }
            catch (Exception ex)
            {
                returnInfo.boolValue = false;
                returnInfo.messageText = ex.ToString();
            }

            return returnInfo;
        }
Example #16
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            try
            {
                msg = this._stateMonitorManager.Login(this.txtUserName.Text.Trim(), this.txtPassword.Text.Trim());

                if (msg.boolValue == true)
                {
                    UnLockUISetting();
                }
                else
                {
                    this.txtPassword.Text = "";
                    this.txtUserName.Focus();
                    LockUISetting();
                    this.ShowInformationMessage(msg.messageText);
                }
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
Example #17
0
        /// <summary>
        /// 從DB中驗證登陸權限
        /// </summary>
        ///<param name="itemEntity"></param>
        /// <returns></returns>
        public Model.General.ReturnValueInfo Login(Model.IModel.IModelObject itemEntity,string systemFunctionCode)
        {
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            Sys_UserMaster_usm_Info userInfo = null;

            Sys_UserMaster_usm_Info cond = itemEntity as Sys_UserMaster_usm_Info;

            string pwd = Common.General.MD5(cond.usm_cPasswork);

            try
            {
                userInfo = this.m_objStateMonitorDAL.GetLoginUserInformation(cond.usm_cUserLoginID);
            }
            catch(Exception ex)
            {
                throw ex;
            }

            if (userInfo != null)
            {
                msg.boolValue = true;
                msg.ValueObject = userInfo;

                if (userInfo.usm_cPasswork != pwd)
                {
                    msg.boolValue = false;
                    msg.messageText = "密碼錯誤,請重新輸入!";

                    return msg;
                }

                if (userInfo.usm_iLock == true)
                {
                    msg.boolValue = false;
                    msg.messageText = "账户被锁,请与管理员联系!";

                    return msg;
                }

                bool isFunctionAuthority = false;
                isFunctionAuthority = this.CheckUserFunctionAuthority(userInfo, systemFunctionCode);

                if (!isFunctionAuthority)
                {
                    msg.boolValue = false;
                    msg.messageText = "您沒有權限操作此功能!";

                    return msg;
                }
            }
            else
            {
                msg.boolValue = false;
                msg.messageText = "用戶不存在,請重新輸入!";
            }

            return msg;
        }
Example #18
0
        /// <summary>
        /// 保存本地設置信息
        /// </summary>
        /// <param name="configData">信息設置數據</param>
        /// <returns></returns>
        public override Model.General.ReturnValueInfo SaveLocalInformationConfigData(LocalInformationConfigData configData)
        {
            Model.General.ReturnValueInfo result = new Model.General.ReturnValueInfo();

            string strLocalPath = System.Windows.Forms.Application.StartupPath + "\\" + mc_strFolderName + "\\";

            if (configData != null)
            {

                if (configData.MachineInfos != null && configData.MachineInfos.Count > 0)
                {
                    foreach (MachineLocalInformationConfig item in configData.MachineInfos)
                    {

                        bool isExist = this.m_objStateMonitorBLL.IsExistMachineID(item.MachineID);

                        if (!isExist)
                        {
                            result.messageText = item.MachineID + "不是有效的機台編號!";
                            return result;
                        }

                        IEnumerable<MachineLocalInformationConfig> checkPort = configData.MachineInfos.Where(t => t.PLCPortName == item.PLCPortName);
                        if (checkPort.Count() > 1)
                        {
                            result.messageText = item.MachineID + "PLC端口重複!";
                            return result;
                        }

                        IEnumerable<MachineLocalInformationConfig> checkMachineID = configData.MachineInfos.Where(t => t.MachineID == item.MachineID);
                        if (checkMachineID.Count() > 1)
                        {
                            result.messageText = item.MachineID + "機台編號重複!";
                            return result;
                        }

                    }
                }

                try
                {

                    if (!Directory.Exists(strLocalPath))
                    {
                        Directory.CreateDirectory(strLocalPath);
                    }
                    else
                    {
                        if (File.Exists(strLocalPath + mc_strFileName))
                        {
                            File.Delete(strLocalPath + mc_strFileName);
                        }
                    }

                    using (FileStream stream = new FileStream(strLocalPath + mc_strFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite))
                    {
                        XmlSerializer serializer = new XmlSerializer(typeof(LocalInformationConfigData));

                        serializer.Serialize(stream, configData);//序列化保存文件

                        stream.Close();

                        result.boolValue = true;

                        //反序列化讀出內容,看是否已保存成功
                        //stream.Seek(0, SeekOrigin.Begin);//保持文件流讀取的順序從文件頭開始讀取
                        //LocalInformationConfigData reObj = serializer.Deserialize(stream) as LocalInformationConfigData;
                        //if (reObj != null)
                        //{
                        //    stream.Close();
                        //    result.boolValue = true;

                        //}

                    }
                }
                catch (Exception Ex)
                {

                    throw new Exception("保存機台設置有誤!");
                }
            }

            return result;
        }
Example #19
0
        /// <summary>
        /// 管理員登陸後設定監控驗證
        /// </summary>
        ///<param name="cUserName">用戶名</param>
        ///<param name="cPassword">密碼</param>
        /// <returns>對象ReturnValueInfo</returns>
        public override Model.General.ReturnValueInfo Login(string cUserName, string cPassword)
        {
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();

            try
            {
                if (base.IsServerConnecting)
                {
                    //在線密碼驗證
                    Model.SysMaster.Sys_UserMaster_usm_Info itemEntity = new Model.SysMaster.Sys_UserMaster_usm_Info();
                    itemEntity.usm_cUserLoginID = cUserName;
                    itemEntity.usm_cPasswork = cPassword;
                    msg = this.m_objStateMonitorBLL.Login(itemEntity, CommonDefine.SystemFunctionCodeDifine.SystemAdministrate);
                }
                else
                {
                    //離線密碼驗證
                    if (cUserName.ToLower().Trim() == "admin" && cPassword == DateTime.Now.ToString("yyyy,MM,dd"))
                    {
                        msg.boolValue = true;
                        return msg;
                    }
                    else
                    {
                        msg.boolValue = false;
                        msg.messageText = "帐号密码不正确,请重试!";
                    }
                }
            }
            catch (Exception ex)
            {
                this.OnException(mc_strClassName, "Login", ex.Message);
                throw;
            }

            return msg;
        }