public Sys_FormMaster_fom_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
        {
            Sys_FormMaster_fom_Info frm = new Sys_FormMaster_fom_Info();
            Sys_FormMaster_fom_Info info = null;
            frm = KeyObject as Sys_FormMaster_fom_Info;
            try
            {

                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    IQueryable<Sys_FormMaster_fom> taQuery =
                        (from ta in db.Sys_FormMaster_fom
                         where ta.fom_iRecordID == frm.fom_iRecordID
                         select ta).Take(1);

                    if (taQuery != null)
                    {
                        foreach (Sys_FormMaster_fom t in taQuery)
                        {
                            info = Common.General.CopyObjectValue<Sys_FormMaster_fom, Sys_FormMaster_fom_Info>(t);
                            FindFormPurview(info);
                        }
                    }
                    return info;
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
Exemple #2
0
        public SysFormMaster()
        {
            InitializeComponent();

            _showInfo = new Sys_FormMaster_fom_Info();

            this._ISysFormMasterBL = MasterBLLFactory.GetBLL<ISysFormMasterBL>(MasterBLLFactory.SysFormMaster);
        }
Exemple #3
0
        public TreeNodeInfo[] GetMenuTreeNodes(CustEnum.System system)
        {
            List<Sys_FormMaster_fom_Info> infos = new List<Sys_FormMaster_fom_Info>();

            List<TreeNodeInfo> treeNodeInfoList = new List<TreeNodeInfo>();
            TreeNodeInfo rootNodeInfo = null;
            TreeNodeInfo[] treeNodeInfos = null;

            TreeNodeInfo itemNodeInfo = null;

            infos = _sysFormMasterDA.GetWinTreeNode(system.ToString());

            foreach (Sys_FormMaster_fom_Info inf in infos)
            {
                Sys_FormMaster_fom_Info info = inf;
                rootNodeInfo = new TreeNodeInfo();
                rootNodeInfo.Text = info.fom_cFormDesc;
                rootNodeInfo.Name = info.fom_cFormNumber;
                rootNodeInfo.Tag = info.fom_cExePath;
                rootNodeInfo.Index = info.fom_iIndex;

                rootNodeInfo.FileName = info.fom_iRecordID.ToString();

                TreeNodeInfo nodeInfo = null;
                info = new Sys_FormMaster_fom_Info();
                info.fom_iParentID = int.Parse(rootNodeInfo.FileName.ToString());
                foreach (var chile in _sysFormMasterDA.SearchRecords(info, "all"))
                {
                    info = chile as Sys_FormMaster_fom_Info;
                    string Name = info.fom_iRecordID.ToString();
                    nodeInfo = null;
                    nodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(rootNodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, info.fom_iImageIndex);
                    info = new Sys_FormMaster_fom_Info();
                    info.fom_iParentID = int.Parse(Name.ToString());
                    foreach (var q in _sysFormMasterDA.SearchRecords(info, "all"))
                    {
                        info = q as Sys_FormMaster_fom_Info;

                        if (info.fom_cFormNumber.ToString().ToUpper() == "DEMO")
                        {
                            itemNodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, info.fom_iImageIndex);
                            itemNodeInfo.Remark = "EXE";
                            itemNodeInfo.FileName = "WPFUI\\WPFUI.exe";
                        }
                        else
                            LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, info.fom_iImageIndex);
                    }
                }
                treeNodeInfoList.Add(rootNodeInfo);

            }
            treeNodeInfos = treeNodeInfoList.ToArray();

            return treeNodeInfos;
        }
Exemple #4
0
        void BindFormTreeView()
        {
            this.Cursor = Cursors.WaitCursor;

            //TODO: 修改成遞歸算法

            Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();
            info.fom_cSysCode = Common.DefineConstantValue.SysFormCodeEnum.HBManager.ToString();
            List<IModelObject> listObjForms = this._ISysFormMasterBL.SearchRecords(info);
            List<Sys_FormMaster_fom_Info> ListFormInfos = new List<Sys_FormMaster_fom_Info>();
            foreach (Sys_FormMaster_fom_Info item in listObjForms)
            {
                if (item != null)
                {
                    ListFormInfos.Add(item);
                }
            }

            List<Sys_FormMaster_fom_Info> listForms = ListFormInfos;
            try
            {
                //增加根结点
                tvFromMain.Nodes.Clear();

                //info = listForms.Find(x => x.fom_iParentID == -1);
                //if (info == null)
                //{
                //    this.Cursor = Cursors.Default;
                //    return;
                //}
                //TreeNode rootNode = new TreeNode(info.fom_cFormDesc);
                //rootNode.Name = info.fom_iRecordID.ToString();
                //rootNode.Tag = info.fom_cExePath.ToString();

                TreeNode rootNode = new TreeNode("心電圖系統菜單");
                rootNode.Name = "-1";
                rootNode.Tag = "ROOT";

                tvFromMain.Nodes.Add(rootNode);

                //加载子节点
                GetFormList(rootNode, listForms, -1);

                if (tvFromMain.Nodes.Count > 0)
                {
                    tvFromMain.ExpandAll();
                    tvFromMain.SelectedNode = tvFromMain.Nodes[0];
                }

            }
            catch (Exception Ex)
            { this.ShowErrorMessage(Ex); }

            this.Cursor = Cursors.Default;
        }
        private void btnFind_Click(object sender, EventArgs e)
        {
            try
            {
                Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();

                info.fom_cFormNumber = txtcNum.Text;

                DataBind(_sysFormMasterBL.SearchRecords(info));
            }
            catch (Exception Ex)
            { ShowErrorMessage(Ex); }
        }
        private void btnSelect_Click(object sender, EventArgs e)
        {
            Sys_FormMaster_fom_Info smcitem = null;
            _RtvInfo = new List<Sys_FormMaster_fom_Info>();
            try
            {
                if (lvwMstr.SelectedItems.Count > 0)
                {
                    for (int i = 0; i < lvwMstr.SelectedItems.Count; i++)
                    {
                        smcitem = new Sys_FormMaster_fom_Info();
                        smcitem.fom_iRecordID = Convert.ToInt32(lvwMstr.SelectedItems[i].SubItems[(int)enmLvwMaster.fom_iRecordID].Text);
                        smcitem.fom_cFormNumber = lvwMstr.SelectedItems[i].SubItems[(int)enmLvwMaster.fom_cFormNumber].Text;
                        smcitem.fom_cFormDesc = lvwMstr.SelectedItems[i].SubItems[(int)enmLvwMaster.fom_cFormDesc].Text;
                        _RtvInfo.Add(smcitem);
                    }
                }

            }
            catch (Exception Ex)
            { ShowErrorMessage(Ex); }
            this.DialogResult = DialogResult.OK;
        }
Exemple #7
0
        public List<Sys_FormMaster_fom_Info> GetWebTreeNode(Sys_FormMaster_fom_Info info)
        {
            try
            {
                return _sysFormMasterDA.GetWebTreeNode(info);
            }
            catch (Exception Ex)
            {

                throw Ex;
            }
        }
Exemple #8
0
        public void MenuToolForm_ItemClicked(string menuItemTag)
        {
            BaseForm frm;

            string[] formNames;
            string formName = string.Empty;

            formNames = menuItemTag.Split('.');

            if (formNames.Length > 0)
            {
                formName = formNames[formNames.Length - 1];
            }

            IDockContent[] idcs = this._dockPanel.Contents.ToArray();
            string itemFormName = string.Empty;
            bool isExistForm = false;

            foreach (IDockContent idc in idcs)
            {
                DockContentHandler dch = idc.DockHandler;
                itemFormName = dch.Form.Name;
                if (itemFormName == formName)
                {
                    isExistForm = true;
                    frm = dch.Form as BaseForm;
                    break;
                }
            }

            if (!isExistForm)
            {
                frm = GetFormIn(menuItemTag);
            }
            else
            {
                frm = null;
            }

            if (frm != null)
            {
                Sys_UserMaster_usm_Info usmInfo = new Sys_UserMaster_usm_Info();
                usmInfo = _userInfo;
                Sys_FormMaster_fom_Info fomInfo = new Sys_FormMaster_fom_Info();
                List<Sys_UserMaster_usm_Info> usmInfoList = new List<Sys_UserMaster_usm_Info>();
                fomInfo.fom_cFormNumber = GetFormIn(menuItemTag).Name.ToString();
                usmInfo.formMasterList.Clear();
                usmInfo.formMasterList.Add(fomInfo);
                foreach (Sys_UserMaster_usm_Info usm in _loginFormBL.SearchRecords(usmInfo))
                {
                    usmInfoList.Add(usm);
                }
                frm._setFunctionList = usmInfoList[0].functionMasterList;
                frm.UserInformation = this.UserInformation;
                frm.Show(this._dockPanel);
            }
        }
Exemple #9
0
        public TreeNodeInfo[] GetMenuTreeNodes(Sys_UserMaster_usm_Info _usmInfo)
        {
            Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();

            List<TreeNodeInfo> treeNodeInfoList = new List<TreeNodeInfo>();
            TreeNodeInfo rootNodeInfo = null;
            TreeNodeInfo[] treeNodeInfos = null;

            TreeNodeInfo itemNodeInfo = null;

            info = _sysFormMasterDA.GetRecord_First();

            rootNodeInfo = new TreeNodeInfo();
            rootNodeInfo.Text = info.fom_cFormDesc;
            rootNodeInfo.Name = info.fom_cFormNumber;
            rootNodeInfo.Tag = info.fom_cExePath;
            rootNodeInfo.Index = info.fom_iIndex;

            rootNodeInfo.FileName = info.fom_iRecordID.ToString();

            TreeNodeInfo nodeInfo = null;
            info = new Sys_FormMaster_fom_Info();
            info.fom_iParentID = int.Parse(rootNodeInfo.FileName.ToString());
            //foreach (var chile in _sysFormMasterDA.SearchRecords(info))
            //{
            //    info = chile as Sys_FormMaster_fom_Info;
            //    string Name = info.fom_iRecordID.ToString();
            //    nodeInfo = null;
            //    nodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(rootNodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, 2);
            //    info = new Sys_FormMaster_fom_Info();
            //    info.fom_iParentID = int.Parse(Name.ToString());
            //    foreach (var q in _sysFormMasterDA.SearchRecords(info, _usmInfo))
            //    {
            //        info = q as Sys_FormMaster_fom_Info;
            //        LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, 2);
            //    }
            //}

            /**/
            foreach (var chile in _sysFormMasterDA.SearchRecords(info))
            {
                Sys_FormMaster_fom_Info fom = new Sys_FormMaster_fom_Info();
                info = chile as Sys_FormMaster_fom_Info;
                fom.fom_iParentID = info.fom_iRecordID;
                if (_sysFormMasterDA.SearchRecords(fom, _usmInfo).Count > 0)
                {
                    string Name = info.fom_iRecordID.ToString();
                    nodeInfo = null;
                    nodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(rootNodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, 0);//, info.fom_iImageIndex);

                    foreach (var q in _sysFormMasterDA.SearchRecords(fom, _usmInfo))
                    {
                        info = q as Sys_FormMaster_fom_Info;

                        if (info.fom_cFormNumber.ToString().ToUpper() == "DEMO")
                        {
                            itemNodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, 0);//, info.fom_iImageIndex);
                            itemNodeInfo.Remark = "EXE";
                            itemNodeInfo.FileName = "WPFUI\\WPFUI.exe";
                        }
                        else
                            LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, 0);//, info.fom_iImageIndex);
                    }
                }
            }

            /**/

            treeNodeInfoList.Add(rootNodeInfo);
            treeNodeInfos = treeNodeInfoList.ToArray();
            return treeNodeInfos;
        }
Exemple #10
0
        private void btnUp_Click(object sender, EventArgs e)
        {
            Sys_FormMaster_fom_Info fomInfo = new Sys_FormMaster_fom_Info();
            try
            {
                if (tvwMain.SelectedNode != null)
                {
                    fomInfo.fom_iRecordID = int.Parse(tvwMain.SelectedNode.Name.ToString());
                    Model.IModel.IModelObject result = _ISysFormMasterBL.DisplayRecord(fomInfo);
                    fomInfo = result as Sys_FormMaster_fom_Info;
                    if (fomInfo == null)
                    {
                        return;
                    }
                    Sys_FormMaster_fom_Info fomUp = new Sys_FormMaster_fom_Info();
                    if (fomInfo.fom_iIndex > 1)
                    {
                        fomUp.fom_iParentID = fomInfo.fom_iParentID;
                        fomUp.fom_iIndex = fomInfo.fom_iIndex - 1;
                        List<Model.IModel.IModelObject> list = _ISysFormMasterBL.SearchRecords(fomUp);
                        fomUp = list[0] as Sys_FormMaster_fom_Info;

                        fomInfo.fom_iIndex = fomInfo.fom_iIndex - 1;

                        fomUp.fom_iIndex = fomUp.fom_iIndex + 1;

                        _ISysFormMasterBL.Save(fomInfo, DefineConstantValue.EditStateEnum.OE_Update);
                        _ISysFormMasterBL.Save(fomUp, DefineConstantValue.EditStateEnum.OE_Update);
                        txtcID.Text = fomInfo.fom_iIndex.ToString();
                        BindTreeView();
                    }
                }
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
        private void lvwMstr_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListView lv = (ListView)sender;
            //displayRecordID = lv.SelectedItems[0].SubItems[0].Text;

            Sys_FormMaster_fom_Info smcitem = null;
            _RtvInfo = new List<Sys_FormMaster_fom_Info>();

            smcitem = new Sys_FormMaster_fom_Info();
            smcitem.fom_iRecordID = Convert.ToInt32(lv.SelectedItems[0].SubItems[(int)enmLvwMaster.fom_iRecordID].Text);
            smcitem.fom_cFormNumber = lvwMstr.SelectedItems[0].SubItems[(int)enmLvwMaster.fom_cFormNumber].Text;
            smcitem.fom_cFormDesc = lvwMstr.SelectedItems[0].SubItems[(int)enmLvwMaster.fom_cFormDesc].Text;
            _RtvInfo.Add(smcitem);

            this.DialogResult = DialogResult.OK;
        }
Exemple #12
0
        private void tvwMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            for (int i = 0; i < tvwMain.Nodes.Count; i++)
            {
                ClearColor(tvwMain.Nodes[i]);
            }
            tvwMain.SelectedNode.ForeColor = Color.Red;
            try
            {
                //tvwMain.SelectedNode.Text = "*" + tvwMain.SelectedNode.Text;
                Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();
                uspInfo = new Sys_UserPurview_usp_Info();
                info.fom_cFormNumber = tvwMain.SelectedNode.Tag.ToString();
                _formNumber = tvwMain.SelectedNode.Tag.ToString();
                uspInfo.formMasterList.Add(info);
                Model.IModel.IModelObject result = _userPurviewBL.DisplayRecord(uspInfo);
                uspInfo = result as Sys_UserPurview_usp_Info;

                uspInfoTemp = new Sys_UserPurview_usp_Info();
                uspInfoTemp = uspInfo;

                ShowInfo(uspInfo);
                _lvwUserType = string.Empty;
                _num = string.Empty;
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
Exemple #13
0
        /// <summary>
        /// 確定換卡
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                bool resUkey = base.CheckUKey();
                if (!resUkey)
                {
                    return;
                }

                #region 添加换卡前对收数情况的判断,若收数未成功,则不能进行换卡操作

                ConsumeMachineMaster_cmm_Info searchMacInfo = new ConsumeMachineMaster_cmm_Info();
                searchMacInfo.cmm_cStatus = Common.DefineConstantValue.ConsumeMachineStatus.Using.ToString();
                List<ConsumeMachineMaster_cmm_Info> listMacInfos = this._IConsumeMachineBL.SearchRecords(searchMacInfo);
                listMacInfos = listMacInfos.Where(x => x.cmm_lIsActive).ToList();
                if (listMacInfos == null && listMacInfos.Count > 0)
                {
                    base.ShowErrorMessage("获取消费数据同步信息时出现异常,请重试。");
                    return;
                }
                //消费机最后同步时间
                DateTime dtMacSync = listMacInfos[0].cmm_dLastAccessTime;
                //List<ConsumeMachineMaster_cmm_Info> listUnSyncMachineInfos = listMacInfos.Where(x =>
                //          x.cmm_dLastAccessTime.Hour != dtMacSync.Hour).ToList();
                List<ConsumeMachineMaster_cmm_Info> listUnSyncMachineInfos = new List<ConsumeMachineMaster_cmm_Info>();
                foreach (ConsumeMachineMaster_cmm_Info macItem in listMacInfos)
                {
                    if (macItem != null)
                    {
                        DateTime dtAccess = macItem.cmm_dLastAccessTime;
                        if (Math.Abs((dtAccess - dtMacSync).TotalMinutes) > 30)
                        {
                            listUnSyncMachineInfos.Add(macItem);
                        }
                    }
                    else
                        continue;
                }
                List<ConsumeMachineMaster_cmm_Info> listUnConnMachineInfos = listMacInfos.Where(x =>
                        !x.cmm_lLastAccessRes).ToList();
                if ((listUnSyncMachineInfos != null && listUnSyncMachineInfos.Count > 0) || (listUnConnMachineInfos != null && listUnConnMachineInfos.Count > 0))
                {
                    if (base.ShowQuestionMessage("暂时不能进行换卡操作,因检测到有断线现象的消费机,请在恢复收集数据正常后重试。" + Environment.NewLine + "需要立即查看【消费数据收集情况】吗?"))
                    {
                        MenuItem menuClick = new MenuItem();
                        Sys_FormMaster_fom_Info formClick = new Sys_FormMaster_fom_Info();
                        formClick.fom_cExePath = "WindowUI.HHZX.ConsumerDevice.frmConsumptionRecordCollect";
                        menuClick.Tag = formClick;
                        base.ShowSubForm(menuClick, base.BaseDockPanel);
                    }
                    this.btnSave.Enabled = false;
                    this.lblReadNo.Text = "请读卡";
                    return;
                }

                #endregion

                this.btnSave.Enabled = false;
                this.lblReadNo.Text = "请读卡";

                UserCardPair_ucp_Info userPairInfo = new UserCardPair_ucp_Info();
                userPairInfo.ucp_cCardID = _CardInfo.CardSourceID;
                userPairInfo.ucp_iCardNo = int.Parse(_CardInfo.CardNo);
                //查询用户是否已拥有正常的消费卡
                List<UserCardPair_ucp_Info> listResUserPair = _IUserCardPairBL.SearchRecords(userPairInfo);
                if (userPairInfo != null)
                {
                    listResUserPair = listResUserPair.Where(x => x.ucp_cUseStatus != Common.DefineConstantValue.ConsumeCardStatus.Returned.ToString()).ToList();
                }

                if (listResUserPair != null && listResUserPair.Count > 0)
                {
                    string strMessage = string.Empty;

                    userPairInfo = listResUserPair[0] as UserCardPair_ucp_Info;

                    userPairInfo = _IUserCardPairBL.DisplayRecord(userPairInfo);

                    if (userPairInfo.CardOwner != null)
                    {
                        strMessage += userPairInfo.CardOwner.cus_cChaName + " " + userPairInfo.CardOwner.ClassName + " 卡号:" + userPairInfo.ucp_iCardNo;
                    }

                    base.ShowErrorMessage("该卡已在使用中。使用者:" + strMessage);
                    return;
                }

                if (!ShowQuestionMessage("是否确认换卡?"))
                {
                    return;
                }
                if (ShowQuestionMessage("是否需要重新设置【换卡工本费】?" + Environment.NewLine + "当前【换卡工本费】为:" + _ReplaceCost.ToString()))
                {
                    btnSetCost_Click(null, null);
                    if (!ShowQuestionMessage("【换卡工本费】更新完毕,是否需要继续进行换卡操作?"))
                    {
                        return;
                    }
                }

                userPairInfo = _CurrentUserInfo.PairInfo;
                int iOldCardNo = userPairInfo.ucp_iCardNo;
                userPairInfo.ucp_cUseStatus = DefineConstantValue.ConsumeCardStatus.Returned.ToString();
                userPairInfo.ucp_dReturnTime = System.DateTime.Now;

                if (!_IUserCardPairBL.Save(userPairInfo, DefineConstantValue.EditStateEnum.OE_Update).isError)
                {
                    ConsumeCardMaster_ccm_Info ccmInfo = new ConsumeCardMaster_ccm_Info();
                    ccmInfo.ccm_cCardID = _CardInfo.CardSourceID;

                    ccmInfo.ccm_cCardState = DefineConstantValue.CardUseState.InUse.ToString();
                    ccmInfo.ccm_lIsActive = true;
                    ccmInfo.ccm_cAdd = this.UserInformation.usm_cUserLoginID;
                    ccmInfo.ccm_dAddDate = System.DateTime.Now;
                    ccmInfo.ccm_cLast = this.UserInformation.usm_cUserLoginID;
                    ccmInfo.ccm_dLastDate = System.DateTime.Now;
                    ///如果新卡沒錄入系統,則先錄入新卡
                    if (_IConsumeCardMasterBL.DisplayRecord(ccmInfo) != null)
                    {
                        //如果新卡已在系統,則設為已使用
                        if (_IConsumeCardMasterBL.Save(ccmInfo, DefineConstantValue.EditStateEnum.OE_Update).isError)
                        {

                        }
                    }
                    else
                    {
                        //添加新卡信息
                        if (_IConsumeCardMasterBL.Save(ccmInfo, DefineConstantValue.EditStateEnum.OE_Insert).isError)
                        {
                            base.ShowErrorMessage("卡信息录入时发生错误,请再次尝试。");
                        }
                    }

                    //如果存在舊卡,將舊卡設為未使用
                    if (_CurrentUserInfo.PairInfo != null)
                    {
                        ConsumeCardMaster_ccm_Info oldCardInfo = new ConsumeCardMaster_ccm_Info();
                        oldCardInfo.ccm_cCardID = _CurrentUserInfo.PairInfo.ucp_cCardID;
                        oldCardInfo = _IConsumeCardMasterBL.DisplayRecord(oldCardInfo) as ConsumeCardMaster_ccm_Info;
                        if (oldCardInfo != null)
                        {
                            oldCardInfo.ccm_cCardState = DefineConstantValue.CardUseState.NotUsed.ToString();
                            _IConsumeCardMasterBL.Save(oldCardInfo, DefineConstantValue.EditStateEnum.OE_Update);
                        }
                    }

                    userPairInfo.ucp_cRecordID = Guid.NewGuid();
                    userPairInfo.ucp_cCardID = ccmInfo.ccm_cCardID;
                    userPairInfo.ucp_cAdd = this.UserInformation.usm_cUserLoginID;
                    userPairInfo.ucp_cLast = this.UserInformation.usm_cUserLoginID;
                    userPairInfo.ucp_dPairTime = DateTime.Now;
                    userPairInfo.ucp_dAddDate = DateTime.Now;
                    userPairInfo.ucp_dLastDate = DateTime.Now;
                    userPairInfo.ucp_cUseStatus = DefineConstantValue.ConsumeCardStatus.Normal.ToString();
                    userPairInfo.ucp_lIsActive = true;
                    userPairInfo.ucp_dReturnTime = null;

                    ReturnValueInfo returnInfo = _IUserCardPairBL.InsertExchargeCard(userPairInfo, _ReplaceCost);

                    userPairInfo = returnInfo.ValueObject as UserCardPair_ucp_Info;

                    if (returnInfo.isError)
                    {
                        base.ShowErrorMessage("换卡失败,请再次尝试。");
                        return;
                    }
                    else
                    {
                        //換卡成功,將新卡設為已使用
                        initValue();

                        UserCardPair_ucp_Info currentPair = this._IUserCardPairBL.DisplayRecord(new UserCardPair_ucp_Info() { ucp_cRecordID = userPairInfo.ucp_cRecordID }) as UserCardPair_ucp_Info;

                        string strCardName = string.Empty;

                        //抽取用户信息写入卡显示名称
                        if (currentPair.CardOwner != null)
                        {
                            CardUserMaster_cus_Info userSearch = new CardUserMaster_cus_Info() { cus_cRecordID = currentPair.CardOwner.cus_cRecordID };
                            CardUserMaster_cus_Info userInfo = this._ICardUserMasterBL.DisplayRecord(userSearch) as CardUserMaster_cus_Info;
                            if (userInfo != null)
                            {
                                if (userInfo.cus_cIdentityNum == DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student)//学生
                                {
                                    if (userInfo.ClassInfo != null)
                                    {
                                        if (userInfo.ClassInfo.GradeInfo == null)
                                        {
                                            strCardName += userInfo.ClassInfo.csm_cClassName.Substring(0, 1) == "高" ? "G" : "C";
                                            strCardName += userInfo.ClassInfo.csm_cClassName.Substring(1, 1);
                                        }
                                        else
                                        {
                                            strCardName += userInfo.ClassInfo.GradeInfo.gdm_cAbbreviation;
                                        }

                                        string strTmpName = userInfo.cus_cChaName;
                                        if (userInfo.cus_cChaName.Length > 3)
                                        {
                                            strTmpName = userInfo.cus_cChaName.Substring(1, 3);
                                        }
                                        strCardName += strTmpName;
                                    }
                                    else
                                    {
                                        this.Cursor = Cursors.Default;
                                        base.ShowWarningMessage("用户班级信息不全,请重试。");
                                        return;
                                    }
                                }
                                else//老师
                                {
                                    string strTmpName = userInfo.cus_cChaName;
                                    if (userInfo.cus_cChaName.Length > 6)
                                    {
                                        strTmpName = strTmpName.Substring(0, 6);
                                    }
                                    strCardName = strTmpName;
                                }
                            }
                        }

                        CardUserAccount_cua_Info cuaInfo = new CardUserAccount_cua_Info();
                        cuaInfo.cua_cCUSID = userPairInfo.ucp_cCUSID;

                        cuaInfo = _ICardUserAccountBL.SearchRecords(cuaInfo).FirstOrDefault() as CardUserAccount_cua_Info;
                        _CardInfo.CardNo = userPairInfo.ucp_iCardNo.ToString();
                        _CardInfo.Name = strCardName;
                        _CardInfo.CardPwd = this._PayPwd;
                        //_cardInfo.CardBalance = cuaInfo.cua_fCurrentBalance;

                        decimal Balance = cuaInfo.cua_fCurrentBalance;

                        if (this._CurrentUserInfo != null)
                        {
                            if (this._CurrentUserInfo.cus_cIdentityNum == Common.DefineConstantValue.CodeMasterDefine.KEY2_SIOT_CardUserIdentity_Student)
                            {
                                CodeMaster_cmt_Info codeInfo = this._ICodeMasterBL.SearchRecords(new CodeMaster_cmt_Info() { cmt_cKey1 = Common.DefineConstantValue.CodeMasterDefine.KEY1_ConstantExpenses, cmt_cKey2 = Common.DefineConstantValue.CodeMasterDefine.KEY2_AdvanceCost }).FirstOrDefault() as CodeMaster_cmt_Info;
                                if (codeInfo != null)
                                {
                                    Balance = Balance + codeInfo.cmt_fNumber;
                                }
                            }
                        }

                        if (Balance < 0)
                        {
                            Balance = 0;
                        }

                        _CardInfo.CardBalance = Balance;

                        this._Reader.WriteCardInfo(this._CardInfoSection, this._SectionPwd, _CardInfo);

                        this.lblReadNo.Text = "已换卡";

                        userPairInfo = returnInfo.ValueObject as UserCardPair_ucp_Info;

                        _CurrentUserInfo.PairInfo = userPairInfo;

                        _CardInfo = null;

                        initValue();

                        ShowInformationMessage("换卡成功。");

                        ReturnValueInfo rvRemoveOld = RemoveOldCardFromWList(iOldCardNo);
                        ReturnValueInfo rvAddNew = AddNewCardToWList(userPairInfo.ucp_iCardNo);
                        if (rvRemoveOld.boolValue && rvAddNew.boolValue)
                        {
                            ShowInformationMessage("旧卡自动添加到黑名单列表成功,原卡已不能继续使用。");
                        }
                        else
                        {
                            ShowErrorMessage("旧卡自动添加到黑名单列表失败,可等待停餐服务收集名单添加或联系管理员手动添加。");
                        }
                    }
                }
            }
            catch
            {

            }
        }
Exemple #14
0
        private void SysToolBar_BtnNewClick(object sender, EventArgs e)
        {
            this.EditState = DefineConstantValue.EditStateEnum.OE_Insert;
            SetTxtBox(DefineConstantValue.EditStateEnum.OE_Insert);
            txtcCode.Text = string.Empty;
            txtcDesc.Text = string.Empty;
            txtcPath.Text = string.Empty;

            txtcParentCode.Text = _iRecordID.ToString();
            if (txtcParentCode.Text != string.Empty)
            {
                Sys_FormMaster_fom_Info fomInfo = new Sys_FormMaster_fom_Info();
                fomInfo.fom_iParentID = Convert.ToInt32(txtcParentCode.Text);
                List<Model.IModel.IModelObject> list = _ISysFormMasterBL.SearchRecords(fomInfo);
                if (list.Count > 0)
                {
                    txtcID.Text = (list.Count + 1).ToString();
                }
                else
                {
                    txtcID.Text = "1";
                }
            }
            else
            {
                txtcParentCode.Text = "0";
                txtcID.Text = "1";
            }

            txtcAdd.Text = string.Empty;
            txtcLast.Text = string.Empty;
            txtdAddDate.Text = string.Empty;
            txtdLastDate.Text = string.Empty;
            lvwPur.Items.Clear();
        }
Exemple #15
0
 private void Bind()
 {
     Sys_FormMaster_fom_Info formInfo = new Sys_FormMaster_fom_Info();
     formInfo = this._ISysFormMasterBL.GetRecord_First();
     ShowInfo(formInfo);
 }
Exemple #16
0
        private void SysToolBar_BtnDeleteClick(object sender, EventArgs e)
        {
            this.EditState = DefineConstantValue.EditStateEnum.OE_Delete;
            Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo();
            Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo();
            Model.Base.DataBaseCommandKeyInfo comkey = new Model.Base.DataBaseCommandKeyInfo();
            Sys_FormMaster_fom_Info Info = new Sys_FormMaster_fom_Info();
            try
            {
                comkey.KeyValue = _iRecordID;
                Info.fom_iParentID = int.Parse(_iRecordID);
                if (_ISysFormMasterBL.SearchRecords(Info).Count > 0)
                {
                    msg.messageText = "该表单含有子表单,请先删除子表单!";
                    ShowInformationMessage(msg.messageText);
                    SetOpenToolBar();
                }
                else
                {
                    if (comkey.KeyValue != string.Empty && comkey.KeyValue != "0")
                    {
                        Info.fom_iRecordID = Convert.ToInt32(comkey.KeyValue);
                        _ISysFormMasterBL.Save(Info, Common.DefineConstantValue.EditStateEnum.OE_Delete);

                        SetOpenToolBar();
                        //Handel(Common.DefineConstantValue.GetReocrdEnum.GR_Next);
                        Bind();
                        BindTreeView();
                    }
                }
            }
            catch (Exception Ex)
            { ShowErrorMessage(Ex); }
        }
Exemple #17
0
 private void SysToolBar_BtnCancelClick(object sender, EventArgs e)
 {
     this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly;
     Model.Base.DataBaseCommandKeyInfo comkey = new Model.Base.DataBaseCommandKeyInfo();
     Sys_FormMaster_fom_Info Info = new Sys_FormMaster_fom_Info();
     try
     {
         comkey.KeyValue = _iRecordID;
         if (comkey.KeyValue != string.Empty && comkey.KeyValue != "0")
         {
             Info.fom_iRecordID = Convert.ToInt32(comkey.KeyValue);
             Model.IModel.IModelObject result = _ISysFormMasterBL.DisplayRecord(Info);
             Info = result as Sys_FormMaster_fom_Info;
             ShowInfo(Info);
             SetOpenToolBar();
             SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly);
         }
     }
     catch (Exception Ex)
     {
         ShowErrorMessage(Ex);
     }
 }
Exemple #18
0
        /// <summary>
        /// 顯示數據
        /// </summary>
        /// <param name="info"></param>
        private void ShowInfo(Sys_FormMaster_fom_Info info)
        {
            SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly);
            try
            {
                if (info != null)
                {
                    _iRecordID = info.fom_iRecordID.ToString();
                    txtcAdd.Text = info.fom_cAdd.ToString();
                    txtcLast.Text = info.fom_cLast.ToString();

                    txtcCode.Text = info.fom_cFormNumber.ToString();
                    txtcDesc.Text = info.fom_cFormDesc.ToString();
                    txtcPath.Text = info.fom_cExePath.ToString();

                    //txtcParentCode.Text = info.fom_iParentID.ToString();
                    //txtcParentCode.Text = info.fom_cFormNumber.ToString();
                    txtcID.Text = info.fom_iIndex.ToString();

                    lvwPur.Items.Clear();

                    lvwPur.SetDataSource<Sys_FunctionMaster_fum_Info>(info.functionMaster);

                    txtdAddDate.Text = info.fom_dAddDate != null ? info.fom_dAddDate.Value.ToString(Common.DefineConstantValue.gc_DateFormat) : string.Empty;
                    txtdLastDate.Text = info.fom_dLastDate != null ? info.fom_dLastDate.Value.ToString(Common.DefineConstantValue.gc_DateFormat) : string.Empty;
                }
            }
            catch (Exception Ex)
            { ShowErrorMessage(Ex); }
        }
Exemple #19
0
        private void SelectTreeNode()
        {
            for (int i = 0; i < tvwMain.Nodes.Count; i++)
            {
                ClearColor(tvwMain.Nodes[i]);
            }
            tvwMain.SelectedNode.ForeColor = Color.Red;

            Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();
            Sys_FormMaster_fom_Info parInfo = new Sys_FormMaster_fom_Info();
            try
            {
                if (tvwMain.SelectedNode != null)
                {
                    info.fom_iRecordID = int.Parse(tvwMain.SelectedNode.Name.ToString());
                    Model.IModel.IModelObject result = _ISysFormMasterBL.DisplayRecord(info);
                    info = result as Sys_FormMaster_fom_Info;
                    if (info == null)
                    {
                        return;
                    }
                    _pCode = info.fom_iParentID.ToString();

                    //查父编号
                    parInfo.fom_iRecordID = info.fom_iParentID;
                    Model.IModel.IModelObject parResult = _ISysFormMasterBL.DisplayRecord(parInfo);
                    parInfo = parResult as Sys_FormMaster_fom_Info;
                    txtcParentCode.Text = parInfo.fom_cFormNumber;
                    //

                    ShowInfo(info);
                }
            }
            catch (Exception Ex)
            {
                ShowErrorMessage(Ex);
            }
        }
Exemple #20
0
 /// <summary>
 /// 獲取當前用戶的可訪問菜單
 /// </summary>
 /// <param name="loginUser"></param>
 /// <returns></returns>
 public List<Sys_FormMaster_fom_Info> GetPPCMenus(Sys_UserMaster_usm_Info loginUser)
 {
     Sys_FormMaster_fom_Info cond = new Sys_FormMaster_fom_Info();
     cond.fom_cSysCode = CustEnum.System.PPC.ToString();
     return GetUserMenu(cond, loginUser);
 }
Exemple #21
0
        private void SysToolBar_BtnSaveClick(object sender, EventArgs e)
        {
            try
            {
                Int32 tempInt = Convert.ToInt32(txtcID.Text);
            }
            catch
            {

                ShowWarningMessage("请正確輸入序號!");

                txtcID.Select();

                return;
            }

            ReturnValueInfo returnValue = new ReturnValueInfo(false);

            Sys_FormMaster_fom_Info objInfo = new Sys_FormMaster_fom_Info();

            objInfo.fom_cFormNumber = txtcCode.Text.Trim();

            objInfo.fom_cFormDesc = txtDesc.Text.Trim();

            objInfo.fom_cRemark = txtcRemark.Text.Trim();

            objInfo.fom_cExePath = txtcPath.Text.Trim();

            objInfo.fom_iParentID = Convert.ToInt32(txtcParentCode.Text.Trim());

            objInfo.fom_iIndex = Convert.ToInt32(txtcID.Text.Trim());

            objInfo.fom_cAdd = this.UserInformation.usm_cUserLoginID;

            objInfo.fom_cLast = this.UserInformation.usm_cUserLoginID;

            objInfo.fom_cSysCode = DefineConstantValue.SysFormCodeEnum.HBManager.ToString();

            objInfo.fom_lVaild = true;

            try
            {
                switch (this.EditState)
                {
                    case DefineConstantValue.EditStateEnum.OE_Insert:

                        returnValue = this._ISysFormMasterBL.Save(objInfo, DefineConstantValue.EditStateEnum.OE_Insert);

                        break;
                    case DefineConstantValue.EditStateEnum.OE_Update:

                        objInfo.fom_iRecordID = this._showInfo.fom_iRecordID;

                        returnValue = this._ISysFormMasterBL.Save(objInfo, DefineConstantValue.EditStateEnum.OE_Update);

                        break;
                    case DefineConstantValue.EditStateEnum.OE_Delete:

                        break;
                    case DefineConstantValue.EditStateEnum.OE_ReaOnly:
                        break;
                    default:
                        break;
                }

                if (returnValue.boolValue)
                {
                    ShowInformationMessage(DefineConstantValue.SystemMessageText.strMessageText_I_SaveSuccess);

                    BindFormTreeView();

                    this._showInfo.fom_iRecordID = objInfo.fom_iRecordID;

                    this._showInfo = this._ISysFormMasterBL.DisplayRecord(this._showInfo) as Sys_FormMaster_fom_Info;

                    ShowInfoToUI(this._showInfo);

                }
                else
                {
                    ShowErrorMessage(returnValue.messageText);
                }
            }
            catch (Exception Ex)
            {

                ShowErrorMessage(Ex.Message);
            }
        }
Exemple #22
0
        private void SysToolBar_BtnSaveClick(object sender, EventArgs e)
        {
            Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();
            Sys_FunctionMaster_fum_Info frmInfo = null;
            if (ChecktxtcName())
            {
                if (txtcCode.Text == string.Empty)
                {
                    _msg.messageText = "表单编号" + Common.DefineConstantValue.SystemMessageText.strMessageText_W_CannotEmpty;
                    ShowWarningMessage(_msg.messageText);
                    txtcCode.Focus();
                }
                else if (txtcDesc.Text == string.Empty)
                {
                    _msg.messageText = "表单描述" + Common.DefineConstantValue.SystemMessageText.strMessageText_W_CannotEmpty;
                    ShowWarningMessage(_msg.messageText);
                    txtcDesc.Focus();
                }
                else
                {
                    try
                    {
                        if (this.EditState == DefineConstantValue.EditStateEnum.OE_Update)
                        {
                            info.fom_iRecordID = Convert.ToInt32(_iRecordID);
                        }
                        info.fom_cFormNumber = txtcCode.Text;
                        info.fom_cFormDesc = txtcDesc.Text;
                        info.fom_cExePath = txtcPath.Text;

                        if (this.EditState == DefineConstantValue.EditStateEnum.OE_Update)
                        {
                            info.fom_iParentID = Convert.ToInt32(_pCode);
                        }
                        if (this.EditState == DefineConstantValue.EditStateEnum.OE_Insert)
                        {
                            if (txtcParentCode.Text != string.Empty)
                            {
                                //info.fom_iParentID = Convert.ToInt32(_pCode);
                                info.fom_iParentID = Convert.ToInt32(txtcParentCode.Text);
                            }
                            else
                            {
                                info.fom_iParentID = 0;
                            }
                        }
                        info.fom_iIndex = Convert.ToInt32(txtcID.Text);

                        for (int i = 0; i < lvwPur.Items.Count; i++)
                        {
                            frmInfo = new Sys_FunctionMaster_fum_Info();
                            frmInfo.fum_cFunctionNumber = lvwPur.Items[i].SubItems[0].Text;
                            //userInfo.cum_cName = lvwMaster.Items[i].SubItems[1].Text;
                            info.functionMaster.Add(frmInfo);
                        }

                        if (this.EditState == DefineConstantValue.EditStateEnum.OE_Insert)
                        {
                            info.fom_cAdd = UserInformation.usm_cUserLoginID;
                            info.fom_dAddDate = DateTime.Now;
                        }
                        info.fom_cLast = UserInformation.usm_cUserLoginID;
                        info.fom_dLastDate = DateTime.Now;
                        if (this.EditState == DefineConstantValue.EditStateEnum.OE_Update)
                        {
                            _msg = _ISysFormMasterBL.Save(info, DefineConstantValue.EditStateEnum.OE_Update);
                        }
                        else
                        {
                            _msg = _ISysFormMasterBL.Save(info, DefineConstantValue.EditStateEnum.OE_Insert);
                        }

                        if (_msg.messageText != null)
                            ShowInformationMessage(_msg.messageText);
                        else
                        {
                            SetOpenToolBar();
                            SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly);
                        }
                        BindTreeView();
                    }
                    catch (Exception Ex)
                    { ShowErrorMessage(Ex); }
                }
            }
            BindTreeView();
        }
        private void HandelFormRight(TreeNode node, List<Sys_FormMaster_fom_Info> objList)
        {
            if (node.Checked)
            {
                Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();

                info.fom_iRecordID = Convert.ToInt32(node.Name);

                objList.Add(info);
            }

            if (node.Nodes != null && node.Nodes.Count > 0)
            {
                foreach (TreeNode item in node.Nodes)
                {
                    HandelFormRight(item, objList);
                }
            }
        }
Exemple #24
0
        private void tvFromMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly;

            HightLight(e.Node);

            Sys_FormMaster_fom_Info query = new Sys_FormMaster_fom_Info();

            query.fom_iRecordID = Convert.ToInt32(e.Node.Name);

            try
            {
                this._showInfo = this._ISysFormMasterBL.DisplayRecord(query) as Sys_FormMaster_fom_Info;

                ShowInfoToUI(this._showInfo);
            }
            catch (Exception Ex)
            {

                ShowErrorMessage(Ex.Message);
            }
        }
Exemple #25
0
        private void BindTreeView()
        {
            Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();
            try
            {
                //增加根结点

                this.tvwMain.Nodes.Clear();

                //foreach (var t in _sysFormMasterBL.SearchRecords(info))
                //{
                info = _sysFormMasterBL.GetRecord_First();
                TreeNode root = new TreeNode(info.fom_cFormDesc);
                root.Name = info.fom_iRecordID.ToString();
                root.Tag = info.fom_cFormNumber.ToString();
                this.tvwMain.Nodes.Add(root);

                //TreeNode root2 = new TreeNode();
                //root2.Text = "tag2";
                //root2.Name = "tag2";
                //root2.Tag ="tag2";
                //this.tvwMain.Nodes.Add(root2);

                //info.fom_iParentID = info.fom_iRecordID;
                info = new Sys_FormMaster_fom_Info();
                info.fom_iParentID = int.Parse(root.Name.ToString());
                //增加子结点

                foreach (var chile in _sysFormMasterBL.SearchRecords(info))
                {

                    info = chile as Sys_FormMaster_fom_Info;
                    if (info.fom_cFormDesc != "开发人员设置")
                    {
                        TreeNode node = new TreeNode(info.fom_cFormDesc);
                        node.Name = info.fom_iRecordID.ToString();
                        node.Tag = info.fom_cFormNumber.ToString();
                        root.Nodes.Add(node);

                        //info.fom_iParentID = info.fom_iRecordID;
                        info = new Sys_FormMaster_fom_Info();
                        info.fom_iParentID = int.Parse(node.Name.ToString());
                        //增加孙结点

                        foreach (var q in _sysFormMasterBL.SearchRecords(info))
                        {
                            info = q as Sys_FormMaster_fom_Info;
                            TreeNode nd = new TreeNode(info.fom_cFormDesc);
                            nd.Name = info.fom_iRecordID.ToString();
                            nd.Tag = info.fom_cFormNumber.ToString();
                            node.Nodes.Add(nd);
                        }
                    }
                }

                //读取Web权限
                Sys_FormMaster_fom_Info webinfo = new Sys_FormMaster_fom_Info();
                try
                {
                    webinfo = _sysFormMasterBL.GetWebTreeRoot();
                }
                catch (Exception Ex)
                {
                    ShowErrorMessage(Ex);
                    return;
                }

                //////
                TreeNode webRoot = new TreeNode();
                webRoot.Text = webinfo.fom_cFormDesc;
                webRoot.Name = webinfo.fom_iRecordID.ToString();
                webRoot.Tag = webinfo.fom_cFormNumber.ToString();

                List<Sys_FormMaster_fom_Info> webList = new List<Sys_FormMaster_fom_Info>();
                try
                {
                    webList = _sysFormMasterBL.GetWebTreeNode(webinfo);
                    if (webList.Count > 0)
                    {
                        foreach (Sys_FormMaster_fom_Info t in webList)
                        {

                            TreeNode tempNode = new TreeNode();
                            tempNode.Text = t.fom_cFormDesc.ToString();
                            tempNode.Name = t.fom_iRecordID.ToString();
                            tempNode.Tag = t.fom_cFormNumber.ToString();

                            List<Sys_FormMaster_fom_Info> tempNodeList = new List<Sys_FormMaster_fom_Info>();
                            tempNodeList = _sysFormMasterBL.GetWebTreeNode(t);
                            if (tempNodeList.Count > 0)
                            {
                                foreach (Sys_FormMaster_fom_Info tt in tempNodeList)
                                {
                                    TreeNode tempNode2 = new TreeNode();
                                    tempNode2.Text = tt.fom_cFormDesc.ToString();
                                    tempNode2.Name = tt.fom_iRecordID.ToString();
                                    tempNode2.Tag = tt.fom_cFormNumber.ToString();

                                    tempNode.Nodes.Add(tempNode2);
                                }
                            }

                            webRoot.Nodes.Add(tempNode);
                        }
                    }
                }
                catch (Exception Ex)
                {
                    ShowErrorMessage(Ex);
                    return;
                }
                this.tvwMain.Nodes.Add(webRoot);

                //tvwMain.SelectedNode = tvwMain.Nodes[0];
                //tvwMain.SelectedNode.ExpandAll();
                tvwMain.ExpandAll();
                //}
            }
            catch (Exception Ex)
            { ShowErrorMessage(Ex); }
        }
Exemple #26
0
        public List<Sys_UserMaster_usm_Info> SearchRecords(Model.IModel.IModelObject searchCondition)
        {
            Sys_UserMaster_usm_Info info = null;

            info = searchCondition as Sys_UserMaster_usm_Info;

            string sqlString = string.Empty;
            string whereString = string.Empty;

            sqlString = " SELECT  distinct TOP " + Common.DefineConstantValue.ListRecordMaxCount.ToString() + Environment.NewLine;
            sqlString += " fum_cFunctionNumber " + Environment.NewLine;
            sqlString += " FROM Sys_FunctionMaster_fum" + Environment.NewLine;
            sqlString += " LEFT JOIN  Sys_FormPurview_frp" + Environment.NewLine;
            sqlString += " ON frp_cFunctionNumber=fum_cFunctionNumber" + Environment.NewLine;
            //****
            sqlString += " LEFT JOIN  Sys_UserPurview_usp" + Environment.NewLine;
            sqlString += " ON frp_cPurviewCode=usp_cPurviewCode" + Environment.NewLine;
            sqlString += " LEFT JOIN  Sys_UserMaster_usm" + Environment.NewLine;
            sqlString += " ON usp_cUserLoginID=usm_cUserLoginID" + Environment.NewLine;
            //****
            sqlString += " LEFT JOIN  Sys_FormMaster_fom" + Environment.NewLine;
            sqlString += " ON fom_cFormNumber=frp_cFormNumber" + Environment.NewLine;

            Sys_FormMaster_fom_Info fomInfo = new Sys_FormMaster_fom_Info();
            fomInfo = info.formMasterList[0];

            if (info != null)
            {
                whereString = " WHERE 1=1 ";
                if (fomInfo.fom_cFormNumber.Trim() != "")
                {
                    if (fomInfo.fom_cFormNumber.ToString().Contains("*") || fomInfo.fom_cFormNumber.ToString().Contains("?"))
                    {
                        whereString += " AND fom_cFormNumber LIKE N'" + LocalDefine.General.ReplaceSQLLikeCondition(fomInfo.fom_cFormNumber) + "'";
                    }
                    else
                    {
                        whereString += "AND fom_cFormNumber = N'" + fomInfo.fom_cFormNumber.ToString().Trim() + "'";
                    }
                }
                //**
                if (info.usm_cUserLoginID.ToString().ToUpper() != "SA")
                {
                    if (info.usm_cUserLoginID != "")
                    {
                        if (info.usm_cUserLoginID.ToString().Contains("*") || info.usm_cUserLoginID.ToString().Contains("?"))
                        {
                            whereString += " AND usm_cUserLoginID LIKE N'" + LocalDefine.General.ReplaceSQLLikeCondition(info.usm_cUserLoginID) + "'";
                        }
                        else
                        {
                            whereString += "AND usm_cUserLoginID = N'" + info.usm_cUserLoginID.ToString().Trim() + "'";
                        }
                    }
                }
                //*****
            }

            sqlString += whereString;

            IEnumerable<Sys_FunctionMaster_fum_Info> infos = null;
            List<Sys_FunctionMaster_fum_Info> infoList = null;
            List<Sys_UserMaster_usm_Info> usmInfoList = new List<Sys_UserMaster_usm_Info>();

            try
            {
                using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
                {
                    infos = db.ExecuteQuery<Sys_FunctionMaster_fum_Info>(sqlString, new object[] { });

                    if (infos != null)
                    {
                        infoList = infos.ToList<Sys_FunctionMaster_fum_Info>();
                        info.functionMasterList = infoList;
                        usmInfoList.Add(info);
                        RoleFunction(usmInfoList);
                    }

                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
            return usmInfoList;
        }
Exemple #27
0
        private void BindTreeView()
        {
            Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();

            try
            {
                //增加根结点
                this.tvwMain.Nodes.Clear();
                var listObjNodeInfos = this._ISysFormMasterBL.SearchRecords(info);

                foreach (Sys_FormMaster_fom_Info nodeInfo in listObjNodeInfos)
                {
                    if (nodeInfo.fom_iParentID != 0)
                    {
                        continue;
                    }
                    info = nodeInfo;
                    TreeNode root = new TreeNode(info.fom_cFormDesc);
                    root.Name = info.fom_iRecordID.ToString();
                    root.Tag = info.fom_cFormNumber.ToString();
                    this.tvwMain.Nodes.Add(root);

                    //info.fom_iParentID = info.fom_iRecordID;
                    info = new Sys_FormMaster_fom_Info();
                    info.fom_iParentID = int.Parse(root.Name.ToString());

                    //增加子结点
                    foreach (var chile in _ISysFormMasterBL.SearchRecords(info))
                    {
                        info = chile as Sys_FormMaster_fom_Info;
                        TreeNode node = new TreeNode(info.fom_cFormDesc);
                        node.Name = info.fom_iRecordID.ToString();
                        node.Tag = info.fom_cFormNumber.ToString();
                        root.Nodes.Add(node);

                        //info.fom_iParentID = info.fom_iRecordID;
                        info = new Sys_FormMaster_fom_Info();
                        info.fom_iParentID = int.Parse(node.Name.ToString());
                        //增加孙结点
                        foreach (var q in _ISysFormMasterBL.SearchRecords(info))
                        {
                            info = q as Sys_FormMaster_fom_Info;
                            TreeNode nd = new TreeNode(info.fom_cFormDesc);
                            nd.Name = info.fom_iRecordID.ToString();
                            nd.Tag = info.fom_cFormNumber.ToString();
                            node.Nodes.Add(nd);
                        }
                    }
                }

                #region 原添加Web根节点代码

                //读取Web权限
                Sys_FormMaster_fom_Info webinfo = new Sys_FormMaster_fom_Info();
                try
                {
                    webinfo = _ISysFormMasterBL.GetWebTreeRoot();
                }
                catch (Exception Ex)
                {
                    ShowErrorMessage(Ex);
                    return;
                }

                TreeNode webRoot = new TreeNode();
                webRoot.Text = webinfo.fom_cFormDesc;
                webRoot.Name = webinfo.fom_iRecordID.ToString();
                webRoot.Tag = webinfo.fom_cFormNumber.ToString();

                List<Sys_FormMaster_fom_Info> webList = new List<Sys_FormMaster_fom_Info>();
                try
                {
                    webList = _ISysFormMasterBL.GetWebTreeNode(webinfo);
                    if (webList.Count > 0)
                    {
                        foreach (Sys_FormMaster_fom_Info t in webList)
                        {

                            TreeNode tempNode = new TreeNode();
                            tempNode.Text = t.fom_cFormDesc.ToString();
                            tempNode.Name = t.fom_iRecordID.ToString();
                            tempNode.Tag = t.fom_cFormNumber.ToString();

                            List<Sys_FormMaster_fom_Info> tempNodeList = new List<Sys_FormMaster_fom_Info>();
                            tempNodeList = _ISysFormMasterBL.GetWebTreeNode(t);
                            if (tempNodeList.Count > 0)
                            {
                                foreach (Sys_FormMaster_fom_Info tt in tempNodeList)
                                {
                                    TreeNode tempNode2 = new TreeNode();
                                    tempNode2.Text = tt.fom_cFormDesc.ToString();
                                    tempNode2.Name = tt.fom_iRecordID.ToString();
                                    tempNode2.Tag = tt.fom_cFormNumber.ToString();

                                    tempNode.Nodes.Add(tempNode2);
                                }
                            }

                            webRoot.Nodes.Add(tempNode);
                        }
                    }
                }
                catch (Exception Ex)
                {
                    ShowErrorMessage(Ex);
                    return;
                }
                this.tvwMain.Nodes.Add(webRoot);

                #endregion

                tvwMain.ExpandAll();
                //}
            }
            catch (Exception Ex)
            { ShowErrorMessage(Ex); }
        }
Exemple #28
0
 private string GetFormMasterSQL(Sys_FormMaster_fom_Info model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     if (model.fom_iRecordID != null)
     {
         strSql1.Append("fom_iRecordID,");
         strSql2.Append("" + model.fom_iRecordID + ",");
     }
     if (model.fom_iParentID != null)
     {
         strSql1.Append("fom_iParentID,");
         strSql2.Append("" + model.fom_iParentID + ",");
     }
     if (model.fom_iIndex != null)
     {
         strSql1.Append("fom_iIndex,");
         strSql2.Append("" + model.fom_iIndex + ",");
     }
     if (model.fom_cFormNumber != null)
     {
         strSql1.Append("fom_cFormNumber,");
         strSql2.Append("'" + model.fom_cFormNumber + "',");
     }
     if (model.fom_cFormDesc != null)
     {
         strSql1.Append("fom_cFormDesc,");
         strSql2.Append("'" + model.fom_cFormDesc + "',");
     }
     if (model.fom_cExePath != null)
     {
         strSql1.Append("fom_cExePath,");
         strSql2.Append("'" + model.fom_cExePath + "',");
     }
     if (model.fom_cWebPath != null)
     {
         strSql1.Append("fom_cWebPath,");
         strSql2.Append("'" + model.fom_cWebPath + "',");
     }
     if (model.fom_cRemark != null)
     {
         strSql1.Append("fom_cRemark,");
         strSql2.Append("'" + model.fom_cRemark + "',");
     }
     if (model.fom_cAdd != null)
     {
         strSql1.Append("fom_cAdd,");
         strSql2.Append("'" + model.fom_cAdd + "',");
     }
     if (model.fom_dAddDate != null)
     {
         strSql1.Append("fom_dAddDate,");
         strSql2.Append("'" + model.fom_dAddDate.Value.ToString(this._sqlLiteDatetimeFormat) + "',");
     }
     if (model.fom_cLast != null)
     {
         strSql1.Append("fom_cLast,");
         strSql2.Append("'" + model.fom_cLast + "',");
     }
     if (model.fom_dLastDate != null)
     {
         strSql1.Append("fom_dLastDate,");
         strSql2.Append("'" + model.fom_dLastDate.Value.ToString(this._sqlLiteDatetimeFormat) + "',");
     }
     if (model.fom_iWebForm != null)
     {
         strSql1.Append("fom_iWebForm,");
         strSql2.Append("" + (model.fom_iWebForm ? 1 : 0) + ",");
     }
     if (model.fom_iImageIndex != null)
     {
         strSql1.Append("fom_iImageIndex,");
         strSql2.Append("" + model.fom_iImageIndex + ",");
     }
     if (model.fom_cSysCode != null)
     {
         strSql1.Append("fom_cSysCode,");
         strSql2.Append("'" + model.fom_cSysCode + "',");
     }
     if (model.fom_lVaild != null)
     {
         strSql1.Append("fom_lVaild,");
         strSql2.Append("" + (model.fom_lVaild ? 1 : 0) + ",");
     }
     strSql.Append("insert into Sys_FormMaster_fom(");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     return strSql.ToString();
 }
 private void DataBind(List<Model.IModel.IModelObject> list)
 {
     Sys_FormMaster_fom_Info info = new Sys_FormMaster_fom_Info();
     lvwMstr.Items.Clear();
     List<Sys_FormMaster_fom_Info> infoList = new List<Sys_FormMaster_fom_Info>();
     try
     {
         foreach (var t in list)
         {
             info = t as Sys_FormMaster_fom_Info;
             infoList.Add(info);
         }
         lvwMstr.SetDataSource<Sys_FormMaster_fom_Info>(infoList);
     }
     catch (Exception Ex)
     { ShowErrorMessage(Ex); }
     lbliCount.Text = list.Count().ToString();
 }
Exemple #30
0
        /// <summary>
        /// 菜單主檔
        /// </summary>
        /// <returns></returns>
        public List<Sys_FormMaster_fom_Info> GetFormMaster()
        {
            try
            {
                List<Sys_FormMaster_fom_Info> list = new List<Sys_FormMaster_fom_Info>();
                StringBuilder strSql = new StringBuilder();
                strSql.AppendLine("select ");
                strSql.AppendLine("fom_iRecordID,fom_iParentID,fom_iIndex,fom_cFormNumber,fom_cFormDesc,fom_cExePath,fom_cWebPath,fom_cRemark,fom_cAdd,fom_dAddDate,fom_cLast,fom_dLastDate,fom_iWebForm,fom_iImageIndex,fom_cSysCode,fom_lVaild ");
                strSql.AppendLine("from Sys_FormMaster_fom ");
                strSql.AppendLine("where fom_lVaild=1 ");

                using (SqlDataReader sdr = DbHelperSQL.ExecuteReader(strSql.ToString()))
                {
                    while (sdr.Read())
                    {
                        Sys_FormMaster_fom_Info model = new Sys_FormMaster_fom_Info();
                        if (sdr["fom_iRecordID"] != null && sdr["fom_iRecordID"].ToString() != "")
                        {
                            model.fom_iRecordID = int.Parse(sdr["fom_iRecordID"].ToString());
                        }
                        if (sdr["fom_iParentID"] != null && sdr["fom_iParentID"].ToString() != "")
                        {
                            model.fom_iParentID = int.Parse(sdr["fom_iParentID"].ToString());
                        }
                        if (sdr["fom_iIndex"] != null && sdr["fom_iIndex"].ToString() != "")
                        {
                            model.fom_iIndex = int.Parse(sdr["fom_iIndex"].ToString());
                        }
                        if (sdr["fom_cFormNumber"] != null && sdr["fom_cFormNumber"].ToString() != "")
                        {
                            model.fom_cFormNumber = sdr["fom_cFormNumber"].ToString();
                        }
                        if (sdr["fom_cFormDesc"] != null && sdr["fom_cFormDesc"].ToString() != "")
                        {
                            model.fom_cFormDesc = sdr["fom_cFormDesc"].ToString();
                        }
                        if (sdr["fom_cExePath"] != null && sdr["fom_cExePath"].ToString() != "")
                        {
                            model.fom_cExePath = sdr["fom_cExePath"].ToString();
                        }
                        if (sdr["fom_cWebPath"] != null && sdr["fom_cWebPath"].ToString() != "")
                        {
                            model.fom_cWebPath = sdr["fom_cWebPath"].ToString();
                        }
                        if (sdr["fom_cRemark"] != null && sdr["fom_cRemark"].ToString() != "")
                        {
                            model.fom_cRemark = sdr["fom_cRemark"].ToString();
                        }
                        if (sdr["fom_cAdd"] != null && sdr["fom_cAdd"].ToString() != "")
                        {
                            model.fom_cAdd = sdr["fom_cAdd"].ToString();
                        }
                        if (sdr["fom_dAddDate"] != null && sdr["fom_dAddDate"].ToString() != "")
                        {
                            model.fom_dAddDate = DateTime.Parse(sdr["fom_dAddDate"].ToString());
                        }
                        if (sdr["fom_cLast"] != null && sdr["fom_cLast"].ToString() != "")
                        {
                            model.fom_cLast = sdr["fom_cLast"].ToString();
                        }
                        if (sdr["fom_dLastDate"] != null && sdr["fom_dLastDate"].ToString() != "")
                        {
                            model.fom_dLastDate = DateTime.Parse(sdr["fom_dLastDate"].ToString());
                        }
                        if (sdr["fom_iWebForm"] != null && sdr["fom_iWebForm"].ToString() != "")
                        {
                            if ((sdr["fom_iWebForm"].ToString() == "1") || (sdr["fom_iWebForm"].ToString().ToLower() == "true"))
                            {
                                model.fom_iWebForm = true;
                            }
                            else
                            {
                                model.fom_iWebForm = false;
                            }
                        }
                        if (sdr["fom_iImageIndex"] != null && sdr["fom_iImageIndex"].ToString() != "")
                        {
                            model.fom_iImageIndex = int.Parse(sdr["fom_iImageIndex"].ToString());
                        }
                        if (sdr["fom_cSysCode"] != null && sdr["fom_cSysCode"].ToString() != "")
                        {
                            model.fom_cSysCode = sdr["fom_cSysCode"].ToString();
                        }
                        if (sdr["fom_lVaild"] != null && sdr["fom_lVaild"].ToString() != "")
                        {
                            if ((sdr["fom_lVaild"].ToString() == "1") || (sdr["fom_lVaild"].ToString().ToLower() == "true"))
                            {
                                model.fom_lVaild = true;
                            }
                            else
                            {
                                model.fom_lVaild = false;
                            }
                        }
                        list.Add(model);
                    }
                }
                return list;
            }
            catch(Exception ex)
            {
                throw ex;
            }
        }