示例#1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="strID"></param>
        /// <param name="tran"></param>
        /// <param name="db"></param>
        internal void Remove(string strID, DbTransaction tran, Database db)
        {
            int intSiteID = SessionHelper.Get(HttpContext.Current, TypeManager.User) != null
                            ? ((TB_User)SessionHelper.Get(HttpContext.Current, TypeManager.User)).SiteID
                            : ((TB_SystemAdmin)SessionHelper.Get(HttpContext.Current, TypeManager.Admin)).SiteID;

            TB_FloorDAL mTB_FloorDAL = new TB_FloorDAL();

            DataTable dtFloor = new DataTable();

            string strFloorID = string.Empty;

            DataRow[] drFloorArr = null;

            dtFloor = mTB_FloorDAL.GetTableBySite(intSiteID);
            foreach (string unitID in strID.Split(','))
            {
                drFloorArr = (from v in dtFloor.Rows.Cast <DataRow>()
                              where v["UnitID"].ToString().Equals(unitID)
                              select v).ToArray();
                foreach (DataRow dr in drFloorArr)
                {
                    if (string.IsNullOrEmpty(strFloorID))
                    {
                        strFloorID = dr["ID"].ToString();
                    }
                    else
                    {
                        strFloorID += "," + dr["ID"];
                    }
                }
            }
            //删除楼层
            new FloorBLL().Remove(strFloorID, tran, db);
            //删除单元
            _mTB_UnitDAL.Delete(strID, tran, db);
        }
示例#2
0
文件: FloorBLL.cs 项目: radtek/DMdm
 public FloorBLL()
 {
     _mTB_FloorDAL = new TB_FloorDAL();
 }