public JsonResult GetCommonCodeList(string asset_group_type, string type)
        {
            List<AssetCommonCodeT> assetCommonCodeList = new List<AssetCommonCodeT>();
            using (CodeBiz codeBiz = new CodeBiz())
            {
                assetCommonCodeList = codeBiz.GetCommonCodeByAssetType(asset_group_type, type);
            }

            Models.JqGridModel model = new Models.JqGridModel
            {
                page = 0,
                total = assetCommonCodeList.Count,
                records = assetCommonCodeList.Count,
                rows = assetCommonCodeList
            };

            return Json(model);
        }
        public JsonResult GetAssetStorageVenderCodeList()
        {
            List<AssetStorageVenderCodeT> assetStorageVenderCodeList = new List<AssetStorageVenderCodeT>();
            using (CodeBiz codebiz = new CodeBiz())
            {
                assetStorageVenderCodeList = codebiz.GetAssetStorageVenderCode();

            }
            Models.JqGridModel model = new Models.JqGridModel
            {
                page = 0,
                total = assetStorageVenderCodeList.Count,
                records = assetStorageVenderCodeList.Count,
                rows = assetStorageVenderCodeList
            };
            return Json(model);
        }
        public JsonResult GetAssetServerVenderCodeList(int? page, int? rows)
        {
            int paramPageNo = page == null ? 1 : page.Value;
            int paramPageSize = rows == null ? 10 : rows.Value;

            int nTotalCount = codeBiz.GetAssetServerVenderCode().Count;
            int nRecord = nTotalCount <= paramPageSize ? 1 : (int)Math.Ceiling((double)(nTotalCount / paramPageSize));

            List<AssetServerVenderCodeT> assetServerVenderCodeList = new List<AssetServerVenderCodeT>();
            using(CodeBiz codebiz = new CodeBiz()){
                assetServerVenderCodeList = codebiz.GetAssetServerVenderCode();
            }
            Models.JqGridModel model = new Models.JqGridModel
            {
                page = paramPageNo,
                total = nRecord,
                records = nTotalCount,
                rows = codeBiz.GetAssetServerVenderCode()
            };
            return Json(model);
        }
        public JsonResult GetAssetRackListByIdcCode(string IdcCode)
        {
            List<AssetRackCodeT> model = new CodeBiz().GetAssetRackListByIdcCode(IdcCode);

            return Json(model);
        }
        public ActionResult StorageUpdate(long? Seq)
        {
            AssetStorageInfoEx1T model = new AssetStorageInfoEx1T();
            string strTitle = "Asset Storage 신규추가";

            if (Seq != null && Seq.Value > 0)
            {
                strTitle = "Asset Storage 수정";
                model = new AssetBiz().GetStorageInfo(Seq.Value);
            }
            else
            {
                //기본값 설정
                model.Qty = 1;
                model.RackStartLocationValue = 0;
            }

            ViewData["Tiele"] = strTitle;

            #region 공통 코드 리스트 설정
            AssetCommonCodeT CommonDefault = new AssetCommonCodeT();
            CommonDefault.AssetCode = "";
            CommonDefault.CodeName = "선택하세요";

            List<AssetCommonCodeT> SiteCodeList = new CodeBiz().GetCommonCodeByAssetType("COMMON", "SITE");
            //List<AssetCommonCodeT> ServiceCodeList = new CodeBiz().GetCommonCodeByAssetType("STORAGE", "SERVICE");
            //List<AssetCommonCodeT> OsCodeList = new CodeBiz().GetCommonCodeByAssetType("STORAGE", "OS");
            List<AssetCommonCodeT> BusinessCodeList = new CodeBiz().GetCommonCodeByAssetType("STORAGE", "BUSINESS");
            List<AssetCommonCodeT> HardwareCodeList = new CodeBiz().GetCommonCodeByAssetType("STORAGE", "Hardware");

            AssetStorageVenderCodeT VenderDefault = new AssetStorageVenderCodeT();
            VenderDefault.VenderCode = "";
            VenderDefault.VenderName = "선택하세요";

            List<AssetStorageVenderCodeT> VenderCodeList = new CodeBiz().GetAssetStorageVenderCode();

            AssetIdcCodeT IdcDefault = new AssetIdcCodeT();
            IdcDefault.IdcCode = "";
            IdcDefault.LClassName = "선택하세요";

            List<AssetIdcCodeT> IdcCodeList = new CodeBiz().GetAssetIdcCode();

            AssetRackCodeT RackDefault = new AssetRackCodeT();
            RackDefault.RackCode = "";
            RackDefault.RackName = "선택하세요";

            List<AssetRackCodeT> RackCodeList = new List<AssetRackCodeT>();
            if (model.IdcCode != null && model.IdcCode != "")
            {
                RackCodeList = new CodeBiz().GetAssetRackListByIdcCode(model.IdcCode);
            }

            //기본값 설정
            SiteCodeList.Insert(0, CommonDefault);
            //ServiceCodeList.Insert(0, CommonDefault);
            //OsCodeList.Insert(0, CommonDefault);
            BusinessCodeList.Insert(0, CommonDefault);
            HardwareCodeList.Insert(0, CommonDefault);
            VenderCodeList.Insert(0, VenderDefault);
            IdcCodeList.Insert(0, IdcDefault);
            RackCodeList.Insert(0, RackDefault);

            ViewBag.SiteCodeList = SiteCodeList;
            //ViewBag.ServiceCodeList = ServiceCodeList;
            //ViewBag.OsCodeList = OsCodeList;
            ViewBag.TaskCodeList = BusinessCodeList;
            ViewBag.HardwareCodeList = HardwareCodeList;
            ViewBag.VenderCodeList = VenderCodeList;
            ViewBag.IdcCodeList = IdcCodeList;
            ViewBag.RackCodeList = RackCodeList;

            #endregion

            return View(model);
        }
        public ActionResult EtcUpdate(long? Seq)
        {
            AssetEtcInfoEx1T model = new AssetEtcInfoEx1T();
            string strTitle = "Asset 기타 신규추가";

            if (Seq != null && Seq.Value > 0)
            {
                strTitle = "Asset 기타 수정";
                model = new AssetBiz().GetEtcInfo(Seq.Value);
            }
            else
            {
                //기본값 설정

                model.RackStartLocationValue = 0;
            }

            ViewData["Tiele"] = strTitle;

            #region 공통 코드 리스트 설정
            AssetCommonCodeT CommonDefault = new AssetCommonCodeT();
            CommonDefault.AssetCode = "";
            CommonDefault.CodeName = "선택하세요";

            List<AssetCommonCodeT> HardwareCodeList = new CodeBiz().GetCommonCodeByAssetType("Etc", "Hardware");

            AssetEtcVenderCodeT VenderDefault = new AssetEtcVenderCodeT();
            VenderDefault.VenderCode = "";
            VenderDefault.VenderName = "선택하세요";

            List<AssetEtcVenderCodeT> VenderCodeList = new CodeBiz().GetAssetEtcVenderCode();

            AssetIdcCodeT IdcDefault = new AssetIdcCodeT();
            IdcDefault.IdcCode = "";
            IdcDefault.LClassName = "선택하세요";

            List<AssetIdcCodeT> IdcCodeList = new CodeBiz().GetAssetIdcCode();

            AssetRackCodeT RackDefault = new AssetRackCodeT();
            RackDefault.RackCode = "";
            RackDefault.RackName = "선택하세요";

            List<AssetRackCodeT> RackCodeList = new List<AssetRackCodeT>();
            if (model.IdcCode != null && model.IdcCode !="")
            {
                RackCodeList = new CodeBiz().GetAssetRackListByIdcCode(model.IdcCode);
            }

            //기본값 설정

            HardwareCodeList.Insert(0, CommonDefault);
            VenderCodeList.Insert(0, VenderDefault);
            IdcCodeList.Insert(0, IdcDefault);
            RackCodeList.Insert(0, RackDefault);

            ViewBag.HardwareCodeList = HardwareCodeList;
            ViewBag.VenderCodeList = VenderCodeList;
            ViewBag.IdcCodeList = IdcCodeList;
            ViewBag.RackCodeList = RackCodeList;

            #endregion

            return View(model);
        }