Exemplo n.º 1
0
        public static int Remove(long gid)
        {
            PriceSetRepository mr = new PriceSetRepository();
            int i = mr.Remove(gid);

            //List<PriceSetInfo> miList = mr.GetAllPriceSet();//刷新缓存
            //Cache.Add("PriceSetALL", miList);
            return(i);
        }
Exemplo n.º 2
0
        public static PriceSetEntity GetPriceSetById(long gid)
        {
            PriceSetEntity     result = new PriceSetEntity();
            PriceSetRepository mr     = new PriceSetRepository();
            PriceSetInfo       info   = mr.GetPriceSetByKey(gid);

            result = TranslatePriceSetEntity(info);
            return(result);
        }
Exemplo n.º 3
0
        public static PriceSetEntity GetPriceSetEntityById(long cid)
        {
            PriceSetEntity     result = new PriceSetEntity();
            PriceSetRepository mr     = new PriceSetRepository();
            PriceSetInfo       info   = mr.GetPriceSetByKey(cid);

            result = TranslatePriceSetEntity(info);
            //获取联系人信息
            //result.listContact= ContactService.GetContactByRule(UnionType.PriceSet.ToString(), info.PriceSetID);
            return(result);
        }
Exemplo n.º 4
0
        public static List <PriceSetEntity> GetPriceSetInfoPager(PagerInfo pager)
        {
            List <PriceSetEntity> all    = new List <PriceSetEntity>();
            PriceSetRepository    mr     = new PriceSetRepository();
            List <PriceSetInfo>   miList = mr.GetAllPriceSetInfoPager(pager);

            if (!miList.IsEmpty())
            {
                foreach (PriceSetInfo mInfo in miList)
                {
                    PriceSetEntity carEntity = TranslatePriceSetEntity(mInfo);
                    all.Add(carEntity);
                }
            }
            return(all);
        }
Exemplo n.º 5
0
        public static List <PriceSetEntity> GetPriceSetInfoByRule(string name, int carrierid, int storageid, int customerid, int status, PagerInfo pager)
        {
            List <PriceSetEntity> all    = new List <PriceSetEntity>();
            PriceSetRepository    mr     = new PriceSetRepository();
            List <PriceSetInfo>   miList = mr.GetPriceSetInfoByRule(name, carrierid, storageid, customerid, status, pager);

            if (!miList.IsEmpty())
            {
                foreach (PriceSetInfo mInfo in miList)
                {
                    PriceSetEntity storeEntity = TranslatePriceSetEntity(mInfo);
                    all.Add(storeEntity);
                }
            }

            return(all);
        }
Exemplo n.º 6
0
        public static List <PriceSetEntity> GetPriceSetByKeys(string ids)
        {
            List <PriceSetEntity> all    = new List <PriceSetEntity>();
            PriceSetRepository    mr     = new PriceSetRepository();
            List <PriceSetInfo>   miList = mr.GetPriceSetByKeys(ids);

            if (!miList.IsEmpty())
            {
                foreach (PriceSetInfo mInfo in miList)
                {
                    PriceSetEntity entity = TranslatePriceSetEntity(mInfo);
                    all.Add(entity);
                }
            }

            return(all);
        }
Exemplo n.º 7
0
        public static List <PriceSetEntity> GetPriceSetAll()
        {
            List <PriceSetEntity> all    = new List <PriceSetEntity>();
            PriceSetRepository    mr     = new PriceSetRepository();
            List <PriceSetInfo>   miList = mr.GetAllPriceSet();//Cache.Get<List<PriceSetInfo>>("PriceSetALL");

            //if (miList.IsEmpty())
            //{
            //    miList = mr.GetAllPriceSet();
            //    Cache.Add("PriceSetALL", miList);
            //}
            if (!miList.IsEmpty())
            {
                foreach (PriceSetInfo mInfo in miList)
                {
                    PriceSetEntity PriceSetEntity = TranslatePriceSetEntity(mInfo);
                    all.Add(PriceSetEntity);
                }
            }

            return(all);
        }
Exemplo n.º 8
0
        public static bool ModifyPriceSet(PriceSetEntity entity)
        {
            long result = 0;

            if (entity != null)
            {
                PriceSetRepository mr = new PriceSetRepository();

                PriceSetInfo PriceSetInfo = TranslatePriceSetInfo(entity);

                //ContactJsonEntity jsonlist = null;
                //if (!string.IsNullOrEmpty(entity.ContactJson))
                //{
                //    try
                //    {
                //        jsonlist = (ContactJsonEntity)JsonHelper.FromJson(entity.ContactJson, typeof(ContactJsonEntity));

                //    }
                //    catch (Exception ex)
                //    {
                //        string str = ex.ToString();
                //    }
                //}

                if (entity.PriceSetID > 0)
                {
                    PriceSetInfo.PriceSetID = entity.PriceSetID;
                    PriceSetInfo.ChangeDate = DateTime.Now;
                    result = mr.ModifyPriceSet(PriceSetInfo);
                }
                else
                {
                    PriceSetInfo.ChangeDate = DateTime.Now;
                    PriceSetInfo.CreateDate = DateTime.Now;
                    result = mr.CreateNew(PriceSetInfo);
                }

                #region 更新联系人信息
                //if (jsonlist != null)
                //{
                //    List<ContactJson> list = jsonlist.listContact;
                //    if (list != null && list.Count > 0)
                //    {
                //        foreach (ContactJson cc in list)
                //        {
                //            ContactRepository cr = new ContactRepository();
                //            ContactInfo contact = new ContactInfo();
                //            contact.ContactName = cc.ContactName;
                //            contact.Mobile = cc.Mobile;
                //            contact.Telephone = cc.Telephone;
                //            contact.Email = cc.Email;
                //            contact.Remark = cc.Remark;
                //            contact.UnionType = UnionType.PriceSet.ToString();//承运商
                //            if (cc.ContactID > 0)
                //            {
                //                contact.ContactID = cc.ContactID;
                //                contact.UnionID = entity.PriceSetID;
                //                contact.ChangeDate = DateTime.Now;
                //                cr.ModifyContact(contact);
                //            }
                //            else
                //            {
                //                contact.UnionID = entity.PriceSetID > 0 ? entity.PriceSetID : result;
                //                contact.CreateDate = DateTime.Now;
                //                contact.ChangeDate = DateTime.Now;
                //                cr.CreateNew(contact);
                //            }
                //        }
                //    }
                //}
                #endregion

                List <PriceSetInfo> miList = mr.GetAllPriceSet();//刷新缓存
                Cache.Add("PriceSetALL", miList);
            }
            return(result > 0);
        }