Example #1
0
        public Tuple <dynamic, DataTable> GetFloorMapElement(FLOORMAPEntity Data)
        {
            if (Data.MAPID.IsEmpty())
            {
                throw new LogicException("请确认图纸编号!");
            }
            string sql = $@"SELECT P.*,R.REGIONID,R.NAME FLOORNAME,N.BRANCHID,N.NAME REGIONNAME,H.NAME BRANCHNAME FROM FLOORMAP P,FLOOR R,REGION N ,BRANCH H WHERE P.FLOORID=R.ID AND R.REGIONID=N.REGIONID AND N.BRANCHID=H.ID ";

            if (!Data.MAPID.IsEmpty())
            {
                sql += (" AND MAPID= " + Data.MAPID);
            }
            DataTable floormap = DbHelper.ExecuteTable(sql);

            floormap.NewEnumColumns <布局图状态>("STATUS", "STATUSMC");

            string sqlitem = $@"SELECT M.MAPID,M.SHOPCODE,M.SHOPID,M.P_X,M.P_Y " +
                             " FROM FLOORSHOP M " +
                             " where 1=1";

            if (!Data.MAPID.IsEmpty())
            {
                sqlitem += (" and M.MAPID= " + Data.MAPID);
            }
            DataTable floorshop = DbHelper.ExecuteTable(sqlitem);

            return(new Tuple <dynamic, DataTable>(floormap.ToOneLine(), floorshop));
        }
Example #2
0
        public string SaveFloorMap(FLOORMAPEntity SaveData)
        {
            var v = GetVerify(SaveData);

            if (SaveData.MAPID.IsEmpty())
            {
                SaveData.MAPID  = NewINC("FLOORMAP");
                SaveData.STATUS = ((int)布局图状态.未审核).ToString();
            }
            else
            {
                FLOORMAPEntity mer = DbHelper.Select(SaveData);
                SaveData.VERIFY      = mer.VERIFY;
                SaveData.VERIFY_NAME = mer.VERIFY_NAME;
                SaveData.VERIFY_TIME = mer.VERIFY_TIME;
            }
            SaveData.REPORTER      = employee.Id;
            SaveData.REPORTER_NAME = employee.Name;
            SaveData.REPORTER_TIME = DateTime.Now.ToString();
            v.Require(a => a.MAPID);
            v.Require(a => a.FLOORID);
            v.Verify();
            using (var Tran = DbHelper.BeginTransaction())
            {
                SaveData.FLOORSHOP?.ForEach(shop =>
                {
                    GetVerify(shop).Require(a => a.SHOPCODE);
                });
                DbHelper.Save(SaveData);

                Tran.Commit();
            }
            return(SaveData.MAPID);
        }
Example #3
0
        public UIResult SearchFloorMap(FLOORMAPEntity Data)
        {
            var res = service.DpglService.GetFloorMapElement(Data);

            return(new UIResult(
                       new
            {
                floormap = res.Item1,
                floorshop = res.Item2
            }
                       ));
        }
Example #4
0
        /// <summary>
        /// 详情页的作废
        /// </summary>
        /// <param name="Data"></param>
        /// <returns></returns>
        public string EliminateData(FLOORMAPEntity Data)
        {
            FLOORMAPEntity map = DbHelper.Select(Data);

            if (map.STATUS == ((int)布局图状态.作废).ToString())
            {
                throw new LogicException("图纸(" + Data.MAPID + ")已经作废不能再次作废!");
            }
            using (var Tran = DbHelper.BeginTransaction())
            {
                map.VERIFY      = employee.Id;
                map.VERIFY_NAME = employee.Name;
                map.VERIFY_TIME = DateTime.Now.ToString();
                map.STATUS      = ((int)布局图状态.作废).ToString();
                DbHelper.Save(map);
                Tran.Commit();
            }
            return(map.MAPID);
        }
Example #5
0
 /// <summary>
 /// 列表页的删除,可以批量删除
 /// </summary>
 /// <param name="DeleteData"></param>
 public void DeleteFloorMap(List <FLOORMAPEntity> DeleteData)
 {
     foreach (var map in DeleteData)
     {
         FLOORMAPEntity Data = DbHelper.Select(map);
         if (Data.STATUS == ((int)普通单据状态.审核).ToString())
         {
             throw new LogicException("此图纸已经审核不能删除!");
         }
     }
     using (var Tran = DbHelper.BeginTransaction())
     {
         foreach (var map in DeleteData)
         {
             DbHelper.Delete(map);
         }
         Tran.Commit();
     }
 }
Example #6
0
        public Tuple <dynamic, DataTable> GetFloorMapAdjustElement(FLOORMAPEntity Data)
        {
            if (Data.MAPID.IsEmpty())
            {
                throw new LogicException("请确认图纸编号!");
            }
            string sql = $@"SELECT (CASE NVL(A.TZBJ,0) WHEN 0 THEN '' ELSE TO_CHAR(A.MAPID) END) MAPID
                            ,(CASE NVL(A.TZBJ,0) WHEN 0 THEN A.MAPID ELSE A.MAPID_OLD END) MAPID_OLD
                            , (CASE NVL(A.TZBJ,0) WHEN 0 THEN 1 ELSE A.STATUS END) STATUS
                            , A.FLOORID, A.BACKMAP, A.WIDTHS, A.LENGTHS, A.INITINATE_TIME_P, A.REPORTER
                            , A.REPORTER_NAME, A.REPORTER_TIME, A.VERIFY, A.VERIFY_NAME, A.VERIFY_TIME, A.INITINATE, A.INITINATE_NAME
                            , A.INITINATE_TIME, A.TERMINATE, A.TERMINATE_NAME, A.TERMINATE_TIME                            
                            , A.FILENAME, A.TZBJ,R.REGIONID,R.NAME FLOORNAME,N.BRANCHID,N.NAME REGIONNAME,H.NAME BRANCHNAME 
                            FROM FLOORMAP A,FLOOR R,REGION N ,BRANCH H WHERE A.FLOORID=R.ID AND R.REGIONID=N.REGIONID 
                            AND N.BRANCHID=H.ID ";

            if (!Data.MAPID.IsEmpty())
            {
                sql += (" AND A.MAPID= " + Data.MAPID);
            }
            DataTable floormap = DbHelper.ExecuteTable(sql);

            floormap.NewEnumColumns <布局图状态>("STATUS", "STATUSMC");

            string sqlitem = $@"SELECT M.MAPID,M.SHOPCODE,M.SHOPID,M.P_X,M.P_Y " +
                             " FROM FLOORSHOP M " +
                             " where 1=1";

            if (!Data.MAPID.IsEmpty())
            {
                sqlitem += (" and M.MAPID= " + Data.MAPID);
            }
            DataTable floorshop = DbHelper.ExecuteTable(sqlitem);

            return(new Tuple <dynamic, DataTable>(floormap.ToOneLine(), floorshop));
        }
Example #7
0
 public string Save(FLOORMAPEntity SaveData)
 {
     return(service.DpglService.SaveFloorMap(SaveData));
 }
Example #8
0
 public void EliminateData(FLOORMAPEntity Data)
 {
     service.DpglService.EliminateData(Data);
 }
Example #9
0
 public void ExecData(FLOORMAPEntity Data)
 {
     service.DpglService.ExecData(Data);
 }