You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Attributes/AttributeManage.cs

100 lines
3.9 KiB
C#

3 years ago
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections;
using System.Collections.Generic;
using DSWeb.Models;
using DSWeb.EntityDA;
namespace DSWeb.Attributes
{
public class AttributeManage
{
private IList<AttributeEntity> _attributeEntities;
private AttributeCompanyEntity _attributeCompanyEntity;
public AttributeManage()
{
}
public AttributeManage(string tempCompanyID, AttributeType tempAttributeType)
{
}
#region 根据属性Name、属性type、分公司ID返回分公司属性信息(company_attribute和attribute)
/// <summary>
/// 根据属性Name、属性type、分公司ID返回分公司属性信息(company_attribute和attribute)
/// </summary>
/// <param name="tempAttributeName">属性Name</param>
/// <param name="tempAttributeType">属性type</param>
/// <param name="tempCompanyID">分公司ID</param>
/// <returns>返回分公司属性信息(company_attribute和attribute)</returns>
public object FindAttributeByName(string tempAttributeName,AttributeType tempAttributeType,string tempCompanyID)
{
object oResult = new object();
switch (tempAttributeType)
{
case AttributeType.COMPANYATTRIBUTE:
AttributeDA attributeDA = new AttributeDA();
AttributeEntity attributeEntity = new AttributeEntity();
//根据参数NAME获取相关参数attribute
attributeEntity = attributeDA.GetAttributeByName(tempAttributeName);
if (attributeEntity != null)
{
if (attributeEntity.GID != null)
{
AttributeCompanyDA attributeCompanyDA = new AttributeCompanyDA();
AttributeCompanyEntity attributeCompanyEntity = new AttributeCompanyEntity();
//根据参数GID和公司GID获取公司参数company_attribute
attributeCompanyEntity = attributeCompanyDA.GetCompanyAttributeByAttributeAndCompany(attributeEntity.GID, tempCompanyID);
if (attributeCompanyEntity != null)
{
if (attributeCompanyEntity.GID != null)
{
_attributeCompanyEntity = attributeCompanyEntity;
_attributeEntities = new List<AttributeEntity>();
_attributeEntities.Add(attributeEntity);
_attributeCompanyEntity.Attributes = _attributeEntities;
oResult = (object)_attributeCompanyEntity;
}
else
{
oResult = (object)attributeCompanyEntity;
}
}
else
{
oResult = (object)attributeCompanyEntity;
}
}
}
break;
case AttributeType.DEPARTMENT:
break;
case AttributeType.PERSONAL:
break;
default:
break;
}
return oResult;
}
}
#endregion
public enum AttributeType
{
COMPANYATTRIBUTE = 1,
DEPARTMENT = 2,
PERSONAL = 3
}
}