Example #1
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:             //手机号
                    TelphoneSourceEntity telEntity = new TelphoneSourceEntity();
                    telEntity.Modify(int.Parse(entity.ObjectId));
                    db.Update <TelphoneSourceEntity>(telEntity);
                    break;

                case 4:             //店铺
                    POS_ShopEntity shopEntity = new POS_ShopEntity();
                    shopEntity.Modify(entity.ObjectId);
                    db.Update <POS_ShopEntity>(shopEntity);
                    break;

                case 5:             //公司
                    POS_OfficeCompanyEntity officeCompanyEntity = new POS_OfficeCompanyEntity();
                    officeCompanyEntity.Modify(entity.ObjectId);
                    db.Update <POS_OfficeCompanyEntity>(officeCompanyEntity);
                    break;

                case 6:             //私池
                    Ku_CompanyEntity companyEntity = new Ku_CompanyEntity();
                    companyEntity.Modify(Convert.ToInt32(entity.ObjectId));
                    db.Update <Ku_CompanyEntity>(companyEntity);
                    break;

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

                db.Commit();
            }
            catch (Exception)
            {
                db.Rollback();
                throw;
            }
        }
Example #2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(int?keyValue, TelphoneSourceEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
        public ActionResult SearchTel(string telphone)
        {
            TelphoneSourceEntity entity = telphonesourcebll.GetEntity(telphone);

            return(Content(JsonConvert.SerializeObject(entity)));
        }
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 //[HttpPost]
 //[ValidateAntiForgeryToken]
 //[AjaxOnly]
 public ActionResult SaveForm(int?keyValue, TelphoneSourceEntity entity)
 {
     telphonesourcebll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }