Esempio n. 1
0
    /// <summary>
    /// 属性值添加
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public string AddAttributeValue(string value, string id)
    {
        value = Common.NoHTML(value);
        var num = new Hi.BLL.BD_AttributeValues().GetList("", "attributeid=" + id + " and attrvalue='" + value + "' and ISNULL(dr,0)=0 and compid=" + this.CompID, "");

        if (num.Count > 0)
        {
            return("ycz");//已存在
        }
        Hi.Model.BD_AttributeValues model = new Hi.Model.BD_AttributeValues();
        model.AttrValue    = value;
        model.AttributeID  = Convert.ToInt32(id);
        model.CreateDate   = DateTime.Now;
        model.CreateUserID = this.UserID;
        model.ts           = DateTime.Now;
        model.CompID       = this.CompID;
        model.modifyuser   = this.UserID;
        model.IsEnabled    = 1;
        int count = new Hi.BLL.BD_AttributeValues().Add(model);

        if (count > 0)
        {
            return(count.ToString());
        }
        else
        {
            return("");
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 属性以及属性值添加
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public string AddAttributeValue(string value, string id, string attrName)
    {
        value    = Common.NoHTML(value);
        attrName = Common.NoHTML(attrName);
        int attrId = 0;

        if (id == "" || id == null)
        {
            if (IsExist("attributeName", attrName, ""))
            {
                return("sxycz");
            }
            Hi.Model.BD_Attribute l = new Hi.Model.BD_Attribute();
            l.AttributeName = attrName;
            l.CreateDate    = DateTime.Now;
            l.CreateUserID  = this.UserID;
            l.ts            = DateTime.Now;
            l.CompID        = this.CompID;
            l.modifyuser    = this.UserID;
            l.IsEnabled     = 1;
            attrId          = new Hi.BLL.BD_Attribute().Add(l);
        }
        else
        {
            attrId = Convert.ToInt32(id);
        }
        var num = new Hi.BLL.BD_AttributeValues().GetList("", "attributeid=" + attrId + " and attrvalue='" + value + "' and ISNULL(dr,0)=0 and Compid=" + this.CompID, "");

        if (num.Count > 0)
        {
            return("ycz");//已存在
        }
        Hi.Model.BD_AttributeValues model = new Hi.Model.BD_AttributeValues();
        model.AttrValue    = value;
        model.AttributeID  = Convert.ToInt32(attrId);
        model.CreateDate   = DateTime.Now;
        model.CreateUserID = this.UserID;
        model.ts           = DateTime.Now;
        model.CompID       = this.CompID;
        model.modifyuser   = this.UserID;
        model.IsEnabled    = 1;
        int count = new Hi.BLL.BD_AttributeValues().Add(model);

        if (count > 0)
        {
            return(attrId.ToString());
        }
        else
        {
            return("");
        }
    }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.BD_AttributeValues model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.BD_AttributeValues model)
 {
     return(dal.Add(model));
 }