Exemplo n.º 1
0
    public int DALUpdateItemCategoryAttribute(ItemCategoryAttributeBLL ica)
    {
        int row;

        using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))
        {
            try
            {
                SqlParameter[] par = new SqlParameter[6];
                par[0]           = new SqlParameter("@icaId", ica.icaId);
                par[1]           = new SqlParameter("@itemId", ica.itemIdICA);
                par[2]           = new SqlParameter("@categoryId", ica.categoryIdICA);
                par[3]           = new SqlParameter("@attributeId", ica.attributeIdICA);
                par[4]           = new SqlParameter("@attributeValue", ica.attributeValueICA);
                par[5]           = new SqlParameter("@Status", 11);
                par[5].Direction = ParameterDirection.Output;

                row = SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "spItemCategoryAttributeUpdate", par);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }
        return(row);
    }
Exemplo n.º 2
0
    public bool BLLIsExistItemCategoryAttribute(ItemCategoryAttributeBLL ica)
    {
        int    i;
        bool   flag   = false;
        string aValue = "";

        aValue = icaDALObj.DALIsExistItemCategoryAttribute(ica);



        if (ica.icaId != 0)
        {
            i = icaDALObj.DALUpdateItemCategoryAttribute(ica);
            if (i == 0)
            {
                flag = true;
            }
        }
        else
        {
            icaDALObj.DALInsertItemCategoryAttribute(ica);

            flag = false;
        }
        return(flag);
    }
Exemplo n.º 3
0
    public string DALIsExistItemCategoryAttribute(ItemCategoryAttributeBLL ica)
    {
        bool   flag     = false;
        string attValue = "";

        using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))
        {
            try
            {
                SqlParameter[] par = new SqlParameter[4];
                par[0] = new SqlParameter("@itemId", ica.itemIdICA);
                par[1] = new SqlParameter("@categoryId", ica.categoryIdICA);
                par[2] = new SqlParameter("@attributeId", ica.attributeIdICA);
                //par[3] = new SqlParameter("@status", 100);
                //par[3].Direction = ParameterDirection.Output;

                using (SqlDataReader dr = SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "spItemCategoryAttributeIsExist", par))
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            attValue = Convert.ToString(dr["attributeValue"]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }
        return(attValue);
    }
Exemplo n.º 4
0
    public int BLLInsertItemCategoryAttribute(ItemCategoryAttributeBLL ica)
    {
        int i = icaDALObj.DALInsertItemCategoryAttribute(ica);

        return(i);
    }