Esempio n. 1
0
 public OrganizationsOR selectARowDate(string m_id)
 {
     string sql = string.Format("select * from T_SYS_Organizations where Guid='{0}'", m_id);
     DataTable dt = null;
     try
     {
         dt = db.ExecuteQueryDataSet(sql).Tables[0];
     }
     catch (Exception ex)
     {
         throw ex;
     }
     if (dt == null)
         return null;
     if (dt.Rows.Count == 0)
         return null;
     DataRow dr = dt.Rows[0];
     OrganizationsOR m_Orga = new OrganizationsOR(dr);
     return m_Orga;
 }
Esempio n. 2
0
        private OrganizationsOR setValue()
        {
            OrganizationsOR m_Orga = new OrganizationsOR();
            if (Request.QueryString["opType"].ToString() == "alert")
                m_Orga.Guid = Request.QueryString["GUID"].ToString();
            else
                m_Orga.Guid = Guid.NewGuid().ToString();
            m_Orga.ObjName=m_Orga.DisplayName = txtDisplayName.Text;//显示名称
            //m_Orga.ObjName = txtObjName.Text;//对象名称(部门内唯一)
            m_Orga.CustomsCode = txtCustomsCode.Text;//关区代码
            m_Orga.ParentGuid = Request.QueryString["parentGUID"].ToString();//父部门的标志ID(注:树结构中第一个节点没有值)

            m_Orga.RankCode = dpdRankCode.Text;//机构的行政级别信息数据

            m_Orga.AllPathName = txtAllPathName.Text;//用户在系统中的全程文字表述(例如:全国海关\海关总署\信息中心\应用开发二处)
            m_Orga.OrgClass = int.Parse(dplOrgClass.SelectedValue);//部门的一些特殊属性(1总署、2分署、4特派办、8直属、16院校、32隶属海关、64派驻机构)采用掩码实现
            m_Orga.OrgType = int.Parse(dplOrgType.SelectedValue);//部门的一些特殊属性(1虚拟机构、2一般部门、4办公室(厅)、8综合处)采用掩码实现
            m_Orga.Status = 1;// int.Parse(txtStatus.Text);//状态(1、正常使用;2、直接逻辑删除;4、机构级联逻辑删除;8、人员级联逻辑删除;)掩码方式实现

            m_Orga.Description = txtDescription.Text;//附加说明信息
            //m_Orga.CreateTime = DateTime.Now;//创建时间
            //m_Orga.ModifyTime = DateTime.Now;//最近修改时间
            return m_Orga;
        }
Esempio n. 3
0
        public void UpdateOrganizations(OrganizationsOR obj, string m_ID)
        {
            /*
               var v = from f in db.T_SYS_Organizations where f.GUID == m_ID select f;
               if (v.Count() == 0)
               throw new Exception("���󲻴��ڣ�");
               T_SYS_Organizations objNew = v.Single();

               objNew.DISPLAY_NAME = obj.DISPLAY_NAME;		//��ʾ����
               objNew.OBJ_NAME = obj.OBJ_NAME;		//�������ƣ�������Ψһ��
               objNew.RANK_CODE = obj.RANK_CODE;		//����������������Ϣ����
               objNew.ALL_PATH_NAME = obj.ALL_PATH_NAME;		//�û���ϵͳ�е�ȫ�����ֱ��������磺ȫ������\��������\��Ϣ����\Ӧ�ÿ���������
               objNew.ORG_CLASS = obj.ORG_CLASS;		//���ŵ�һЩ�������ԣ�1����2����4���ɰ졢8ֱ���16ԺУ��32������ء�64��פ��������������ʵ��
               objNew.ORG_TYPE = obj.ORG_TYPE;		//���ŵ�һЩ�������ԣ�1���������2һ�㲿�š�4�칫�ң�������8�ۺϴ�����������ʵ��
               objNew.CUSTOMS_CODE = obj.CUSTOMS_CODE;		//��������
               objNew.DESCRIPTION = obj.DESCRIPTION;		//����˵����Ϣ
               objNew.MODIFY_TIME = DateTime.Now;		//����޸�ʱ��
               db.SubmitChanges();
             * */
        }
Esempio n. 4
0
 public bool updateOrg(OrganizationsOR T_SY, string m_id)
 {
     string sql = string.Format(@" update T_SYS_Organizations set DISPLAY_NAME='{0}',OBJ_NAME='{1}',RANK_CODE='{2}',ALL_PATH_NAME='{3}',ORG_CLASS={4},ORG_TYPE={5},CHILDREN_COUNTER={6},STATUS={7},CUSTOMS_CODE='{8}',DESCRIPTION='{9}',MODIFY_TIME=getDate() where GUID='{10}'"
     , T_SY.DisplayName, T_SY.ObjName,T_SY.RankCode, T_SY.AllPathName, T_SY.OrgClass, T_SY.OrgType, T_SY.ChildrenCounter, T_SY.Status, T_SY.CustomsCode, T_SY.Description,m_id);
     try
     {
         db.ExecuteNoQuery(sql);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return true;
 }
Esempio n. 5
0
        public void InsertOrganizations(OrganizationsOR obj)
        {
            OrganizationsOR orgparent = selectSingleOrganization(obj.ParentGuid);
            DataTable dtOrg = GetOrgByParentID(obj.ParentGuid);

            int counter = (dtOrg == null ? 0 : dtOrg.Rows.Count);

            bool sortIsExis = true;
            while (sortIsExis)
            {

                obj.InnerSort = getOrgSort(++counter);//�����ڲ������
                sortIsExis = OrgSortIsExis(obj.InnerSort, obj.ParentGuid);
            }
            obj.OriginalSort = orgparent.OriginalSort + obj.InnerSort;//��ϵͳ�е�ȫ��ַ�����������򣬽�����־���ڲ��ŵ�·����ϵ��
            obj.GlobalSort = obj.OriginalSort;//�û��ڲ����е�ȫ��ַ������ȫ��������
            obj.ChildrenCounter = counter++;//��¼�����ڲ�ʹ�õ�����ֵ����¼ֵΪ��һ����ʹ��ֵ����0��ʼ��

            insertOrg(obj);
        }
Esempio n. 6
0
 /// <summary>
 /// ����T_SYS_Organizations
 /// </summary>
 public bool insertOrg(OrganizationsOR T_SY)
 {
     string sql = string.Format(@" insert into T_SYS_Organizations (GUID,DISPLAY_NAME,OBJ_NAME,PARENT_GUID,RANK_CODE,INNER_SORT,ORIGINAL_SORT,GLOBAL_SORT,ALL_PATH_NAME,ORG_CLASS,ORG_TYPE,CHILDREN_COUNTER,STATUS,CUSTOMS_CODE,DESCRIPTION,CREATE_TIME,MODIFY_TIME)
      values(newid(),'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}',((0)),((1)),'{10}','{11}',(getdate()),(getdate()))"
     ,  T_SY.DisplayName, T_SY.ObjName, T_SY.ParentGuid, T_SY.RankCode,T_SY.InnerSort,T_SY.OriginalSort, T_SY.GlobalSort,T_SY.AllPathName,T_SY.OrgClass,T_SY.OrgType, T_SY.CustomsCode, T_SY.Description);
     try
     {
         db.ExecuteNoQuery(sql);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return true;
 }