Exemplo n.º 1
0
        private bool IsUserLimited(int markid, MarkType type)
        {
            bool ret = true;

            try
            {
                int markUserLevel    = 0;
                int currentUserLevel = 0;

                if (type == MarkType.MarkLabel)
                {
                    MarkCell mark = markCellDao.GetMarkCellById(markid);
                    if (mark.UserId == ConstDef.UserID)
                    {
                        return(false);
                    }
                    markUserLevel = MainForm.dicUser[mark.UserId].LevelId;
                }
                else if (type == MarkType.MarkPanel)
                {
                    MarkArea area = markAreaDao.GetMarkAreaById(markid);
                    if (area.UserId == ConstDef.UserID)
                    {
                        return(false);
                    }
                    markUserLevel = MainForm.dicUser[area.UserId].LevelId;
                }
                currentUserLevel = MainForm.dicUser[ConstDef.UserID].LevelId;
                if (currentUserLevel > markUserLevel)
                {
                    ret = false;
                }
            }
            catch (Exception ex)
            {
                LogHelper.AppLoger.Error(ex);
            }
            return(ret);
        }
Exemplo n.º 2
0
        private void UpdateMarkInfo()
        {
            MarkCellDao markDao = new MarkCellDao();

            MarkCell mark = markDao.GetMarkCellById(MarkId);
            Types    type = typesDao.GetTypeById(mark.TypeId);

            foreach (var v in lstCate)
            {
                if (v.CateId == type.CateId)
                {
                    cmbMarkCategory.Text = string.Format("{0}_{1}", v.CateId, v.CategoryName);
                    break;
                }
            }
            cmbMarkType.Text = string.Format("{0}_{1}", type.TypeId, type.CellType);

            txtRemark.Text = Remark;
        }