Beispiel #1
0
        /// <summary>
        /// 流程完成时的操作。
        /// </summary>
        /// <returns></returns>
        public int Complete(Guid id)
        {
            RoadFlow.Data.Model.BuildingsModel model = Get(id.ToString());
            #region 去除流程关联字段
            model.State      = null;
            model.CreateTime = null;
            model.UpdateTime = null;
            #endregion
            BuildingsDataBLL buildingsDataBLL = new BuildingsDataBLL();
            if (buildingsDataBLL.Get(id) != null)  //楼栋已存在,更新楼栋信息
            {
                model.ID         = null;
                model.UpdateTime = DateTime.Now;
                buildingsDataBLL.Update(model, id);
            }
            else
            {
                buildingsDataBLL.Add(model);
            }
            //更新合成表
            BuildingsAndBuildingMonthInfoBLL buildingsAndBuildingMonthInfoBLL = new BuildingsAndBuildingMonthInfoBLL();
            if (buildingsAndBuildingMonthInfoBLL.Get(id) != null)
            {
                model.ID         = null;
                model.UpdateTime = DateTime.Now;
                buildingsAndBuildingMonthInfoBLL.Update(model, id);
            }
            else
            {
                buildingsAndBuildingMonthInfoBLL.Add(model);
            }

            return(1);
        }
 public int Add(RoadFlow.Data.Model.BuildingsModel model)
 {
     model.CreateTime = DateTime.Now;
     model.UpdateTime = DateTime.Now;
     if (baseDb.Add <RoadFlow.Data.Model.BuildingsModel>(model) > 0)
     {
         //更新合成表
         BuildingsAndBuildingMonthInfoBLL buildingsAndBuildingMonthInfoBLL = new BuildingsAndBuildingMonthInfoBLL();
         return(buildingsAndBuildingMonthInfoBLL.Add(model));
     }
     return(0);
 }