/// <summary> /// [POST] Asset Storage 정보 업데이트 /// 2013-11-27 변승현 /// </summary> /// <param name="Seq"></param> /// <param name="SapNo"></param> /// <param name="ServerName"></param> /// <param name="EquipTypeCode"></param> /// <param name="SiteCode"></param> /// <param name="TaskCode"></param> /// <param name="ServiceCode"></param> /// <param name="IdcCode"></param> /// <param name="RackCode"></param> /// <param name="BuyDate"></param> /// <param name="OsCode"></param> /// <param name="VenderCode"></param> /// <param name="Content"></param> /// <param name="InsOprt"></param> /// <param name="DelDate"></param> /// <param name="InsDate"></param> /// <returns></returns> public JsonResult SetStorageUpdate(Int64? Seq, string SapNo, string ServerName, string SerialNo, int Qty, string EquipTypeCode, string SiteCode, string TaskCode, string ServiceCode, String IdcCode, String RackCode, int RackStartLocationValue, DateTime BuyDate, string OsCode, string VenderCode, string Content) { ResultModel returnModel = new ResultModel(); AssetStorageInfoT model = new AssetStorageInfoT(); model.Seq = (Seq == null) ? 0 : Seq.Value; model.SapNo = SapNo; model.ServerName = ServerName; model.SerialNo = SerialNo; model.Qty = Qty; model.EquipTypeCode = EquipTypeCode; model.SiteCode = SiteCode; model.TaskCode = TaskCode; model.ServiceCode = ServiceCode; model.IdcCode = IdcCode; model.RackCode = RackCode; model.RackStartLocationValue = RackStartLocationValue; model.BuyDate = BuyDate; model.OsCode = OsCode; model.VenderCode = VenderCode; model.Content = Content; model.InsOprt = this.UserID; int nResult = new AssetBiz().UpdateStorageInfo(model); returnModel.statusCode = nResult > 0 ? StatusCodeEnum.Success : StatusCodeEnum.Fail; return Json(returnModel); }
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 JsonResult SetEtcUpdate(Int64? Seq, string ServerName, string EquipTypeCode, String IdcCode, String RackCode, int RackStartLocationValue, string VenderCode, string Content) { ResultModel returnModel = new ResultModel(); AssetEtcInfoT model = new AssetEtcInfoT(); model.Seq = (Seq == null) ? 0 : Seq.Value; model.ServerName = ServerName; model.EquipTypeCode = EquipTypeCode; model.IdcCode = IdcCode; model.RackCode = RackCode; model.RackStartLocationValue = RackStartLocationValue; model.VenderCode = VenderCode; model.Content = Content; int nResult = new AssetBiz().UpdateEtcInfo(model); returnModel.statusCode = nResult > 0 ? StatusCodeEnum.Success : StatusCodeEnum.Fail; return Json(returnModel); }
public JsonResult GetStorageList(string searchType, string searchText, int? page, int? rows) { string paramSearchType = string.IsNullOrEmpty(searchType) ? string.Empty : searchType; string paramSearchText = string.IsNullOrEmpty(searchText) ? string.Empty : searchText; int paramPageNo = page == null ? 1 : page.Value; int paramPageSize = rows == null ? 10 : rows.Value; AssetBiz assetBiz = new AssetBiz(); int nTotalCount = assetBiz.CountStorageList(paramSearchType, paramSearchText); int nRecord = nTotalCount <= paramPageSize ? 1 : (int)Math.Ceiling((double)(nTotalCount / paramPageSize)); Models.JqGridModel model = new Models.JqGridModel { page = paramPageNo, total = nRecord, records = nTotalCount, rows = assetBiz.GetStorageList(paramSearchType, paramSearchText, paramPageNo, paramPageSize) }; return Json(model); }
public ActionResult GetStorageExcelList(string searchType, string searchText, int? page, int? rows) { var grid = new System.Web.UI.WebControls.GridView(); List<AssetStorageInfoEx1T> model = new AssetBiz().GetStorageList(searchType, searchText, page.Value, rows.Value); grid.DataSource = from m in model select new { Seq = m.Seq, SapNo = m.SapNo, ServerName = m.ServerName, EquipTypeName = m.EquipTypeName, BuyDate = m.BuyDate.Value.ToString("yyyy-MM-dd"), ExpireDate = m.ExpireDate.Value.ToString("yyyy-MM-dd"), RemainDay = m.RemainDay.Value, SiteName = m.SiteName, TaskCode = m.TaskCode, IdcName = m.IdcName, RackLocationCode = m.RackLocationCode, VenderName = m.VenderName, ProductName = m.ProductName, SerialNo = m.SerialNo, ProcessCnt = m.ProcessCnt, ServerIp = m.ServerIp, Content = m.Content, DelYn = m.DelYn, DelDate = m.DelDate, InsOprt = m.InsOprt, InsDate = m.InsDate }; grid.DataBind(); Response.ClearContent(); Response.AddHeader("content-disposition", string.Format("attachment; filename=Excel_{0}.xls", DateTime.Now.ToString("yyyyMMddhhmmss"))); Response.Write("<meta http-equiv='Content-Type' content='text/html; charset=" + Request.ContentEncoding.HeaderName + "'>"); Response.Buffer = true; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); grid.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); return View("Index"); }
public ActionResult GetEtcExcelList(string searchType, string searchText, int? page, int? rows) { var grid = new System.Web.UI.WebControls.GridView(); List<AssetEtcInfoEx1T> model = new AssetBiz().GetEtcList(searchType, searchText, page.Value, rows.Value); grid.DataSource = from m in model select new { Seq = m.Seq, ServerName = m.ServerName, EquipTypeName = m.EquipTypeName, IdcName = m.IdcName, RackLocationCode = m.RackLocationCode, VenderName = m.VenderName, ProductName = m.ProductName, Content = m.Content }; grid.DataBind(); Response.ClearContent(); Response.AddHeader("content-disposition", string.Format("attachment; filename=Excel_{0}.xls", DateTime.Now.ToString("yyyyMMddhhmmss"))); Response.Write("<meta http-equiv='Content-Type' content='text/html; charset=" + Request.ContentEncoding.HeaderName + "'>"); Response.Buffer = true; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); grid.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); return View("Index"); }
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); }