Ejemplo n.º 1
0
        /// <summary>
        /// 公司详情
        /// </summary>
        /// <returns></returns>
        public ActionResult CompanyDetail(int?keyValue)
        {
            Ku_CompanyEntity entity = companyBll.GetEntity(keyValue);

            ViewBag.model = entity;
            return(View());
        }
Ejemplo n.º 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:             //手机号
                    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;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(int?keyValue, Ku_CompanyEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 公司详情
        /// </summary>
        /// <returns></returns>
        public ActionResult GetFormJson(int?keyValue)
        {
            Ku_CompanyEntity entity = companyBll.GetEntity(keyValue);

            return(Content(entity.ToJson()));
        }
Ejemplo n.º 5
0
 public ActionResult CompanyForm(int?keyValue, Ku_CompanyEntity entity)
 {
     companyBll.SaveForm(keyValue, entity);
     return(Content("true"));
 }
Ejemplo n.º 6
0
 public ActionResult SaveForm(int?keyValue, Ku_CompanyEntity entity)
 {
     ku_companybll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }