/// <summary>
        /// 添加关联数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public override int CreateSupplyChain(PdCategoryRelatedSupplyChain model)
        {
            int id = Context.Insert <PdCategoryRelatedSupplyChain>("PdCategoryRelatedSupplyChain", model)
                     .AutoMap(x => x.SysNo)
                     .ExecuteReturnLastId <int>("Sysno");

            return(id);
        }
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public override bool UpdateSupplyChain(PdCategoryRelatedSupplyChain model)
        {
            int effect = Context.Update <PdCategoryRelatedSupplyChain>("PdCategoryRelatedSupplyChain", model)
                         .AutoMap(x => x.SysNo)
                         .Where("sysno", model.SysNo)
                         .Execute();

            return(effect > 0);
        }
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="SysNo"></param>
        /// <returns></returns>
        public override PdCategoryRelatedSupplyChain GetEntitySupplyChain(int SysNo)
        {
            PdCategoryRelatedSupplyChain entity = Context.Select <PdCategoryRelatedSupplyChain>("*")
                                                  .From("PdCategoryRelatedSupplyChain")
                                                  .Where("sysno = @sysno")
                                                  .Parameter("sysno", SysNo)
                                                  .QuerySingle();

            return(entity);
        }
        /// <summary>
        /// 根据分类ID及供应商编号获取数据
        /// </summary>
        /// <param name="CategorySysNo"></param>
        /// <param name="SupplyChainCode"></param>
        /// <returns></returns>
        public override PdCategoryRelatedSupplyChain GetEntityByCSysNoSupplyChain(int CategorySysNo, int SupplyChainCode)
        {
            PdCategoryRelatedSupplyChain entity = Context.Select <PdCategoryRelatedSupplyChain>("*")
                                                  .From("PdCategoryRelatedSupplyChain")
                                                  .Where(" SupplyChainCode= @SupplyChainCode and CategorySysNo=@CategorySysNo")
                                                  .Parameter("SupplyChainCode", SupplyChainCode)
                                                  .Parameter("CategorySysNo", CategorySysNo)
                                                  .QuerySingle();

            return(entity);
        }
        /// <summary>
        /// 根据供应链编号及供应链商品分类名称获取数据
        /// </summary>
        /// <param name="SCName"></param>
        /// <param name="SupplyChainCode"></param>
        /// <returns></returns>

        public override PdCategoryRelatedSupplyChain GetEntityByNameSupplyChain(string SCName, int SupplyChainCode)
        {
            PdCategoryRelatedSupplyChain entity = Context.Select <PdCategoryRelatedSupplyChain>("*")
                                                  .From("PdCategoryRelatedSupplyChain")
                                                  .Where(" SupplyChainCode= @SupplyChainCode and SupplyChainCategoryName=@SupplyChainCategoryName")
                                                  .Parameter("SupplyChainCode", SupplyChainCode)
                                                  .Parameter("SupplyChainCategoryName", SCName)
                                                  .QuerySingle();

            return(entity);
        }
        /// <summary>
        /// 是否添加过
        /// </summary>
        /// <param name="SCName"></param>
        /// <param name="SupplyChainCode"></param>
        /// <returns></returns>

        public override bool IsExistsSupplyChain(string SCName, int SupplyChainCode)
        {
            bool result = false;
            PdCategoryRelatedSupplyChain entity = Context.Select <PdCategoryRelatedSupplyChain>("*")
                                                  .From("PdCategoryRelatedSupplyChain")
                                                  .Where(" SupplyChainCode= @SupplyChainCode and SupplyChainCategoryName=@SupplyChainCategoryName")
                                                  .Parameter("SupplyChainCode", SupplyChainCode)
                                                  .Parameter("SupplyChainCategoryName", SCName)
                                                  .QuerySingle();

            return(result);
        }
Exemple #7
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateSupplyChain(PdCategoryRelatedSupplyChain model)
 {
     return(IPdCategoryDao.Instance.UpdateSupplyChain(model));
 }
Exemple #8
0
 /// <summary>
 /// 添加关联数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int CreateSupplyChain(PdCategoryRelatedSupplyChain model)
 {
     return(IPdCategoryDao.Instance.CreateSupplyChain(model));
 }
Exemple #9
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public abstract bool UpdateSupplyChain(PdCategoryRelatedSupplyChain model);
Exemple #10
0
 /// <summary>
 /// 添加关联数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public abstract int CreateSupplyChain(PdCategoryRelatedSupplyChain model);