Example #1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, ZZT_PDDCustomerEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, TrailRecordEntity entity)
        {
            IRepository db = new RepositoryFactory().BaseRepository().BeginTrans();

            try
            {
                switch (entity.ObjectSort)
                {
                case 1:             //商机
                    ChanceEntity chanceEntity = new ChanceEntity();
                    chanceEntity.Modify(entity.ObjectId);
                    db.Update <ChanceEntity>(chanceEntity);
                    break;

                case 2:             //客户
                    CustomerEntity customerEntity = new CustomerEntity();
                    customerEntity.Modify(entity.ObjectId);
                    db.Update <CustomerEntity>(customerEntity);
                    break;

                case 3:             //洗号池
                    TelphoneWashEntity washEntity = new TelphoneWashEntity();
                    //washEntity.CallResult = entity.TrackTypeId;
                    washEntity.CallDescription = entity.TrackContent;
                    washEntity.CallTime        = entity.CreateDate;
                    washEntity.Modify(int.Parse(entity.ObjectId));
                    db.Update <TelphoneWashEntity>(washEntity);
                    break;

                case 4:             //400客户
                    ZZT_400CustomerEntity zzt400 = new ZZT_400CustomerEntity();
                    zzt400.Modify(entity.ObjectId);
                    db.Update <ZZT_400CustomerEntity>(zzt400);
                    break;

                case 5:             //拼多多客户
                    ZZT_PDDCustomerEntity zztPDD = new ZZT_PDDCustomerEntity();
                    zztPDD.Modify(entity.ObjectId);
                    db.Update <ZZT_PDDCustomerEntity>(zztPDD);
                    break;

                case 10:             //乐豪斯
                    LOHAS_CustomerEntity lhs = new LOHAS_CustomerEntity();
                    lhs.Modify(entity.ObjectId);
                    db.Update <LOHAS_CustomerEntity>(lhs);
                    break;

                default:
                    break;
                }
                entity.Create();
                db.Insert(entity);

                db.Commit();
            }
            catch (Exception)
            {
                db.Rollback();
                throw;
            }
        }
Example #3
0
 public ActionResult SaveForm(string keyValue, ZZT_PDDCustomerEntity entity)
 {
     zzt_pddcustomerbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }