Esempio n. 1
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, TelphoneLiangJoinEntity entity)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                entity.Modify(keyValue);
                this.BaseRepository().Update(entity);
            }
            else
            {
                entity.Create();
                this.BaseRepository().Insert(entity);

                //短信提醒上级审核
                IRepository db        = new RepositoryFactory().BaseRepository().BeginTrans();
                var         parentOrg = db.FindEntity <OrganizeEntity>(t => t.OrganizeId == entity.OrganizeId);
                if (parentOrg != null)
                {
                    SmsSingleSenderResult singleResult;
                    SmsSingleSender       singleSender = new SmsSingleSender(1400040861, "a92c87d0d291698777a9b5f323c0388a");
                    List <string>         templParams  = new List <string>();
                    templParams.Add(parentOrg.FullName);
                    singleResult = singleSender.SendWithParam("86", parentOrg.OuterPhone, 205528, templParams, "", "", "");
                }
                //申请加盟+1
                orgService.UpdateJoinCount(entity.OrganizeId);
            }
        }