Пример #1
0
        /// <summary>
        /// 根据一条记录设置用户类的属性
        /// </summary>
        /// <param name="dr"></param>
        private void SetUserProperty(DataRow dr)
        {
            CUser tempCUser;

            try
            {
                tempCUser = new CUser(ConnectInfo, dr);
                this.mUserList.Add(mUserList.Count, tempCUser);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Пример #2
0
		/// <summary>
		/// 根据一条记录设置用户类的属性
		/// </summary>
		/// <param name="dr"></param>
		private void SetUserProperty(DataRow dr)
		{
            CUser tempCUser;

			try
			{

				tempCUser=new CUser(ConnectInfo ,dr);
				this.mUserList.Add(mUserList.Count,tempCUser);   
			}
			catch(Exception e)
			{
				throw new Exception (e.Message );
			}


		}
Пример #3
0
        /// <summary>
        /// ��ȡ�������ָ������(��д�Ӷ���ֻ���Ӷ��󣬶�д��ض���ֻ����ض���
        /// </summary>
        /// <param name="UserCode"></param>
        /// <param name="ModuleCode"></param>
        /// <param name="FieldName"></param>
        /// <returns></returns>
        private SortedList GetObjectForMainObject(string UserCode,string ModuleCode,string FieldName,string FieldName1)
        {
            string str;

            DataTable dt;
            SortedList tempObjectList=new  SortedList();
            int i;

            try
            {
                CUser tempUser=new CUser(ConnectInfo,UserCode,"0");

                //���û���Ӧ�����Ȩ��

                //��Ϊ����Ա�飬�򷵻�ģ��Ķ�д����
                if(tempUser.IsManageGroup)
                {
                    FieldName="XD01" + FieldName.Substring(4);
                    str="select * from gs_structure  where charindex(infoid,(select " + FieldName + " from XD01 where ZA0100='" + ModuleCode + "'))>0 and state='1'";
                }
                else  //Ϊһ���飬����ģ��Ȩ���ж�ȡ��д����
                {
                    str="select * from gs_structure  where charindex(infoid,(select " + FieldName + " from XE02 where za0100 in ("
                        + tempUser.gsGroupList.Substring(1)+ ") and " +FieldName+ " not in (select " +FieldName1
                        + " from xe02 where za0100 in ("+ tempUser.gsGroupList.Substring(1)+ ") and ZC9996='" + ModuleCode + "')  and ZC9996='" + ModuleCode + "' group by " +FieldName+ "))>0 and state='1'";
                }
                dt=this.DataOperator.GetDataTable(str);

                //�ӵ�������
                for(i=0;i<=dt.Rows.Count-1;i++)
                {
                    if(! tempObjectList.ContainsKey(dt.Rows[i]["InfoId"].ToString()))
                    {
                        tempObjectList.Add(dt.Rows[i]["InfoId"].ToString().ToUpper(),dt.Rows[i]["ShortDesc"].ToString());
                    }
                }

                return tempObjectList;

            }
            catch
            {
                return tempObjectList;
            }
        }
Пример #4
0
        /// <summary>
        /// �ж��û��Ƿ��ܽ�ij��ģ��
        /// </summary>
        /// <param name="UserCode"></param>
        /// <param name="ModuleCode"></param>
        /// <returns></returns>
        public bool gsCanEnterModule(string ModuleCode,out string ErrMsg)
        {
            bool flag=false;

            try
            {
                this.m_CurModuleCode=ModuleCode;

                /*  2004.06.30  ע��
                if(!gsIsPasswordCorrect(out ErrMsg))
                {
                    //throw new Exception(strErr);
                    return false;
                }
                */

                //ȡ�û���Ϣ
                if(m_CurUser == null)
                {
                    m_CurUser=new  CUser(ConnectInfo, m_AppLoginName,"2");

                }

                if(m_CurUser.UserCode =="")
                {
                    ErrMsg="�޴��û�";
                    return false;
                }
                 //2004.01.10  �������޸� ,���û��������
                else if(m_CurUser.PassWord != this.gsGetEncryptMsg(m_AppLoginPassWord))
                {
                    ErrMsg="�������";
                    return false;
                }
                /*
                else if(m_CurUser.PassWord != m_AppLoginPassWord )
                {
                    ErrMsg="�������";
                    return false;
                }
                */

                //����ģ����ӵ�¼��Ϣ
                if(CanEnterModule(out ErrMsg))
                {
                    flag=true;
                }
                else
                {
                    if(ErrMsg == "")
                    {
                        ErrMsg="��Ȩ��¼��ģ�飡";
                    }
                    flag=false;
                }

                if(flag)
                {

                    //��ӵ�¼��Ϣ
                    gsInserLoginLog();

                    //ȡ��ǰ�û��Ķ�д/ֻ���Ӷ���
                    this.GetReadWriteObjectForUser();
                }

                return flag;
            }//try
            catch(Exception e)
            {
                ErrMsg=e.Message;
                return false;
            }
        }
Пример #5
0
        /// <summary>
        /// ���ò˵���Ŀ�����
        /// </summary>
        public void gsSetItemStatus(MainMenu myMainMenu)
        {
            SortedList UsableItemList;
            SortedList SourceItemList;

            try
            {

                CUser tempUser=new CUser(ConnectInfo,m_AppLoginName,"0");

                //ԭ�˵���
                SourceItemList=this.gsGetSourceMenuItems(this.m_CurModuleCode);

                //Ȩ������IJ˵���
                UsableItemList=gsGetUsableMenuItems(tempUser.UserGroup ,this.m_CurModuleCode);

                //����Ȩ�����ò˵���
                for(int i=0;i<=myMainMenu.MenuItems.Count-1;i++)
                {
                    DealItemForTree(UsableItemList,SourceItemList,myMainMenu.MenuItems[i],true);
                }
            }
            catch(Exception e)
            {
                throw new Exception ("SetItemStatus : " +e.Message );
            }
        }
Пример #6
0
        /// <summary>
        /// ��ȡ��ǰ��¼�û�������Ŀ��õ�ģ�鼯��
        /// </summary>
        /// <returns></returns>
        public SortedList gsGetUsableModuleList()
        {
            string str="";
            DataTable dt;
            SortedList ModuleList=new SortedList();

            //��ȡ��ǰ�û���Ϣ
            if(m_CurUser == null)
            {
                m_CurUser=new  CUser(ConnectInfo, m_AppLoginName,"2");
            }

            //����Ա��������Ȩ��
            if(m_CurUser.IsManageGroup)
            {
                str="select za0100 as zc9996 from xd01";
            }
            else  //ҵ����
            {

                str="if exists(select zc9996 from xf03 where za0100 in(select za0100 from xf01 where za0101='" + m_CurUser.LoginName +"'))";
                str += "(select zc9996 from xf03 where za0100 in(select za0100 from xf01 where za0101='" + m_CurUser.LoginName +"'))";
                str += "else (select zc9996 from xe02 where za0100 in(select xf0101 from xf01 where za0101='" + m_CurUser.LoginName +"'))";

            }

            dt=this.DataOperator.GetDataTable(str);

            for(int i=0;i<dt.Rows.Count;i++)
            {
                string ModuleCode;
                ModuleCode=dt.Rows[i]["ZC9996"].ToString();
                if(ModuleCode.Trim()!="")
                {

                    if(! ModuleList.ContainsKey(ModuleCode))
                    {
                        ModuleList.Add(ModuleCode,dt.Rows[i]);
                    }

                }

            }

            return ModuleList;
        }
Пример #7
0
        /// <summary>
        /// ��ȡ��ǰ��¼�û�������Ŀ��õ�ҵ����뼯�ϣ� ģ�����.ҵ�����.���̱���
        /// </summary>
        /// <returns></returns>
        public SortedList gsGetUsableFlowList()
        {
            string str;
            DataTable dt;
            SortedList FlowList=new SortedList();

            //��ȡ��ǰ�û���Ϣ
            if(m_CurUser == null)
            {
                m_CurUser=new  CUser(ConnectInfo, m_AppLoginName,"2");
            }

            str="select * from XE04 where ZA0100='" + m_CurUser.UserGroup + "'";
            dt=this.DataOperator.GetDataTable(str);

            for(int i=0;i<dt.Rows.Count;i++)
            {
                FlowList.Add(dt.Rows[i]["XE0401"].ToString()+ "." +dt.Rows[i]["XE0402"].ToString()+ "." + dt.Rows[i]["XE0403"].ToString() ,dt.Rows[i]);

            }

            return FlowList;
        }
Пример #8
0
        /// <summary>
        /// ȡ�û���ij��ģ�����Ϣ��Ȩ��
        /// </summary>
        /// <param name="UserCode"></param>
        /// <param name="ModuleCode"></param>
        /// <returns></returns>
        public SortedList gsGetPropertyRightItems(string UserCode,string ModuleCode,string InfoId)
        {
            SortedList tempObjectList=new SortedList();
            string str;
            DataTable dt;

            try
            {

                //ȡ�û���Ϣ
                CUser tempUser=new CUser(ConnectInfo,UserCode,"0");

                //��Ϊ����Ա�飬�򷵻�Property��Ϣ������Ϣ��
                if(tempUser.IsManageGroup)
                {
                    str="select InfoField,PropertySet from gs_property  where InfoId='" + InfoId + "'";
                }
                else  //Ϊһ���飬���ֶ�Ȩ���ж�ȡ��Ϣ��
                {
                    //cc 20050816 ����ģ�����
            //					//str="select XE0502 as InfoField,XE0503 as PropertySet  from XE05 where ZA0100='" + tempUser.UserGroup + "' and XE0501='" + InfoId + "' and XE0504='" + ModuleCode + "'";
            //					str="select XE0502 as InfoField,XE0503 as PropertySet  from XE05 where ZA0100='" + tempUser.UserGroup + "' and XE0501='" + InfoId + "'";
                    str="select XE0502 as InfoField,XE0503 as PropertySet  from XE05 where ZA0100='" + tempUser.UserGroup + "' and XE0501='" + InfoId + "' and XE0504='" + ModuleCode + "'";
                    //end cc
                }
                dt=this.DataOperator.GetDataTable(str);

                //�ӵ�������
                for(int i=0;i<=dt.Rows.Count-1;i++)
                {
                    if(! tempObjectList.ContainsKey(dt.Rows[i]["InfoField"].ToString()))
                    {
                        tempObjectList.Add(dt.Rows[i]["InfoField"].ToString(),dt.Rows[i]["PropertySet"].ToString());
                    }
                }

                return tempObjectList;
            }
            catch
            {
                return tempObjectList;
            }
        }
Пример #9
0
        /// <summary>
        /// ��ȡ�û���ij��ģ�������Ȩ�����
        /// </summary>
        /// <param name="UserCode"></param>
        /// <param name="MainObject"></param>
        /// <returns></returns>
        public void gsGetMainObjectCondition(string UserLoginName,string ModuleCode,out string  BaseExpr,out string BaseItem)
        {
            string str;
            DataTable dt;
            string MainObject="";
            int icount1 = 0,icount2 = 0;

            BaseExpr="";
            BaseItem="";

            try
            {

                //�����û���¼���Ƶø��û�����Ϣ
                CUser tempUser=new CUser(ConnectInfo,UserLoginName,"0");
                Report.stat.reQuery re = new Report.stat.reQuery();

                str="select * from XE02 where ZA0100 in (" + tempUser.gsGroupList.Substring(1)+ ") and  ZC9996='" + ModuleCode + "'";
                dt=this.DataOperator.GetDataTable(str);
                if(dt.Rows.Count>0)
                {
                    MainObject=dt.Rows[0]["XE0210"].ToString();   //������
                    for(int i = 0;i<dt.Rows.Count;i++)
                    {
                        if(dt.Rows[i]["XE0202"] != null && dt.Rows[i]["XE0202"].ToString() != "")
                        {

                            icount1 = BaseItem.Split('~').Length;
                            icount2 = dt.Rows[i]["XE0202"].ToString().Split('~').Length;
                            BaseExpr = re.gs_Comexpress(icount1,icount2,BaseExpr,dt.Rows[i]["XE0201"].ToString());
                            if(BaseItem == "")
                                BaseItem=dt.Rows[i]["XE0202"].ToString();  //���������
                            else
                                BaseItem+= "~" + dt.Rows[i]["XE0202"].ToString();
                        }
                    }

                }

            }
            catch
            {

            }
        }