예제 #1
0
파일: UserType.cs 프로젝트: xyecom/AMS
        /// <summary>
        /// ��ȡ��ҵ������Ϣ
        /// </summary>
        /// <param name="typeName">��������</param>
        /// <returns></returns>
        public XYECOM.Model.UserTypeInfo GetItem(string typeName)
        {
            XYECOM.Model.UserTypeInfo info = null;

            Object obj = GetCache();

            if (obj != null)
            {
                DataTable table = (DataTable)obj;

                DataRow[] rows = table.Select("UT_Type ='" + typeName +"'");

                if (rows != null && rows.Length > 0)
                {
                    info = new XYECOM.Model.UserTypeInfo();
                    info.UT_ID = Convert.ToInt64(rows[0]["UT_ID"].ToString());
                    info.UT_PID = Convert.ToInt64(rows[0]["UT_PID"].ToString());
                    info.UT_Type = rows[0]["UT_Type"].ToString();
                    info.UT_FullID = rows[0]["UT_FullID"].ToString();
                    info.UT_InfoCount = Core.MyConvert.GetInt32(rows[0]["UT_InfoCount"].ToString());
                }
            }

            return info;
        }
예제 #2
0
        /// <summary>
        /// �Է������ת��
        /// </summary>
        /// <param name="ename">ģ������</param>
        /// <param name="pt_parentID">����ID</param>
        /// <param name="flag">flag:0 ��ת�Ƶ����� flag:1 ����Ϊ����</param>
        private void Move(long pt_parentID, String flag)
        {
            int err = 0;

            XYECOM.Business.UserType ut = new XYECOM.Business.UserType();
            XYECOM.Model.UserTypeInfo info = new XYECOM.Model.UserTypeInfo();
            XYECOM.Model.UserTypeInfo typeinfo = new XYECOM.Model.UserTypeInfo();

            typeinfo = ut.GetItem(pt_parentID);
            info.UT_ID = typeinfo.UT_ID;
            info.UT_Type = typeinfo.UT_Type;

            if (id.Equals(pt_parentID))
            {
                info.UT_PID = typeinfo.UT_PID;
            }
            else
            {
                info.UT_PID = Convert.ToInt32(id);
            }
            if (flag.Equals("1"))
            {
                info.UT_PID = 0;
            }
            err = ut.Update(info);

            if (err > 0)
            {
                Response.Redirect("UserTypelist.aspx");
            }
            else
            {
                this.lblMessage.Text = "ת��ʧ�ܣ�";
            }
        }