您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->MyShop网络商城源码(mvc开发)>>BLL/DeliverItem.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:MyShop网络商城源码(mvc开发)
当前文件:文件类型 MyShop/BLL/DeliverItem.cs打开代码结构图
高亮显示
		            using System;
using System.Collections.Generic;

using System.Data;


using MyShop.DALFactory;
using MyShop.IDAL;
using MyShop.Model;
namespace MyShop.BLL
{
    public class DeliverItem
    {

        private IDeliverItem dal = DataAccess.CreateDeliverItem();
        private ConfigInfo configInfo = new ConfigInfo();
        private string tableName = "Ljh_DeliverItem";
        public DeliverItem()
        {
            Config config = new Config();
            configInfo = config.GetModel();

            if (!string.IsNullOrEmpty(configInfo.TablePrefix.Trim()))
                tableName = configInfo.TablePrefix + "DeliverItem";
        }

        #region IDeliverItem

        public int Add(DeliverItemInfo model)
        {
            if (model == null)
            {
                return 0;
            }
            return dal.Add(model);
        }

        public int Delete(string filter)
        {
            if (string.IsNullOrEmpty(filter))
                return 0;
            return dal.Delete(filter);
        }

        public bool Exist(string filter)
        {
            filter = filter.Trim();
            if (string.IsNullOrEmpty(filter))
                return false;
            return dal.Exist(filter);
        }
        public DataSet GetDataSet()
        {
            return dal.GetDataSet();
        }

        public DataSet GetDataSet(string filter)
        {
            filter = filter.Trim();
            if (string.IsNullOrEmpty(filter))
                return null;
            return dal.GetDataSet(filter);
        }

        public DeliverItemInfo GetModel(DataRow dr)
        {
            if (dr == null)
                return null;
            return dal.GetModel(dr);
        }

        private DataSet Query(string sql)
        {
            sql = sql.Trim();
            if (string.IsNullOrEmpty(sql))
                return null;
            return dal.Query(sql);
        }

        public int Update(DeliverItemInfo model, string filter)
        {
            if (model == null)
                return 0;
            filter = filter.Trim();
            if (string.IsNullOrEmpty(filter))
                return 0;
            return dal.Update(model, filter);
        }

        #endregion

        #region common

        public int Add(DeliverItemInfo model, out string msg)
        {
            msg = "";
            if (model == null)
            {
                msg = msg + "<li>数据不能为空</li>";
                return 0;
            }
            bool isErr = false;

            if (isErr)
                return 0;

            int count = 0;
            count = Add(model);
            if (count == 0)
                msg = "<li>系统发生错误,请重新添加!</li>";
            if (count == 1)
                msg = "<li>添加成功!</li>";
            return count;
        }

        public int Delete(int deliverId)
        {
            if (string.IsNullOrEmpty(deliverId.ToString()))
                return 0;
            string filer;
            filer = " deliverId =" + deliverId;
            return Delete(filer);
        }
        public int Update(DeliverItemInfo model)
        {

            if (model == null)
            {
                return 0;
            }
            string filter;
            filter = " deliverId=" + model.DeliverID;
            return Update(model, filter);
        }

        public DeliverItemInfo GetModel(int deliverId)
        {
            DataSet dataset = new DataSet();
            dataset = GetDataSet(" deliverId=" + deliverId);
            if (dataset != null && dataset.Tables[0].Rows.Count > 0)
                return GetModel(dataset.Tables[0].Rows[0]);
            return null;
        }

        #endregion

        #region 后台管理

        /// <summary>
        /// 发退货快速搜索
        /// </summary>
        /// <param name="searchType"></param>
        /// <returns></returns>
        public DataSet QuickSearch(int searchType)
        {
            return dal.QuickSearch(searchType);

        }

        /// <summary>
        ///发退货高级查询
        /// </summary>
        /// <param name="field"></param>
        /// <param name="keywords"></param>
        /// <returns></returns>
        public DataSet KeywordsSearch(string field, string keywords)
        {
            field = Utils.ReplaceBadSQL(field.Trim().ToLower());
            keywords = Utils.ReplaceBadSQL(keywords.ToLower().Trim());
            if (string.IsNullOrEmpty(field) || string.IsNullOrEmpty(keywords))
                return null;
            return dal.KeywordsSearch(field, keywords);
        }

        public DataSet GetDateSetOrderByIdDesc()
        {
            return GetDataSet(" DeliverID > 0 order by DeliverId Desc ");
        }
        #endregion

    
    }
}


        
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:MyShop网络商城源码(mvc开发)
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号