Exemplo n.º 1
0
        /// <summary>
        /// 修改添加
        /// </summary>
        /// <param name="cityEntity"></param>
        /// <param name="keyValue"></param>
        public void SubmitForm(ProfileCountyEntity countyEntity, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                countyEntity.Modify(keyValue);

                string sql         = "SELECT * FROM ProfileProject WHERE CityId='" + countyEntity.CityId + "' AND CountyId='" + countyEntity.F_Id + "'";
                var    projectData = this.projectApp.FildSql(sql);

                foreach (var item in projectData)
                {
                    item.ProjectName = countyEntity.CountyName + item.ProjectTypeName;

                    this.projectApp.SubmitForm(item, item.F_Id);
                }

                service.Update(countyEntity);

                try
                {
                    //添加日志
                    LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "修改区县信息【" + countyEntity.CountyName + "】成功!");
                }
                catch { }
            }
            else
            {
                countyEntity.Create();

                countyEntity.Create();


                //创建此区县下三个项目
                string sql = "select * from Sys_ItemsDetail,Sys_Items where Sys_Items.F_Id = Sys_ItemsDetail.F_ItemId and Sys_Items.F_EnCode ='ProfileProduct'";
                List <ItemsDetailEntity> ItemsDetailEntityList = itemsDetailApp.FildSql(sql);
                ProfileProjectEntity     project = null;
                foreach (var item in ItemsDetailEntityList)
                {
                    project                 = new ProfileProjectEntity();
                    project.CityId          = countyEntity.CityId;
                    project.CountyId        = countyEntity.F_Id;
                    project.ProjectType     = item.F_ItemCode;
                    project.ProjectTypeName = item.F_ItemName;
                    project.ProjectName     = countyEntity.CountyName + item.F_ItemName;

                    this.projectApp.SubmitForm(project, string.Empty);
                }

                service.Insert(countyEntity);

                try
                {
                    //添加日志
                    LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "新建区县信息【" + countyEntity.CountyName + "】成功!");
                }
                catch { }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="userEntity"></param>
 public void UpdateForm(ProfileCountyEntity countyEntity)
 {
     service.Update(countyEntity);
     try
     {
         //添加日志
         LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "修改用户信息【" + countyEntity.CountyName + "】成功!");
     }
     catch { }
 }
Exemplo n.º 3
0
 public ActionResult SubmitForm(ProfileCountyEntity CountyEntity, string keyValue)
 {
     CountyApp.SubmitForm(CountyEntity, keyValue);
     return(Success("操作成功。"));
 }