public ActionResult SaveAsset(POSAccount.Contract.AssetHeader assetHeader) { assetHeader.CreatedBy = Utility.DEFAULTUSER; assetHeader.ModifiedBy = Utility.DEFAULTUSER; assetHeader.Status = Utility.DEFAULTSTATUS; assetHeader.BranchID = Utility.SsnBranch; var result = new POSAccount.BusinessFactory.AssetHeaderBO().SaveAssetHeader(assetHeader); //return RedirectToAction("AssetMaster", "MasterData"); return(Json(new { success = true, Message = string.Format("Asset Code {0} saved successfully.", assetHeader.AssetCode) })); }
public ActionResult EditAsset(string assetCode) { var assetItem = new POSAccount.Contract.AssetHeader(); if (assetCode != null && assetCode.Length > 0) { assetItem = new POSAccount.BusinessFactory.AssetHeaderBO().GetAssetHeader(new AssetHeader { AssetCode = assetCode, BranchID = Utility.SsnBranch }); } else { assetItem.BuyingDate = DateTime.Today.Date; } assetItem.DepreciationTypeList = Utility.GetLookupItemList("Depreciation"); return(View("AddAsset", assetItem)); }
public ActionResult DeleteAsset(POSAccount.Contract.AssetHeader assetHeader) { if (assetHeader != null) { try { assetHeader.CreatedBy = Utility.DEFAULTUSER; assetHeader.ModifiedBy = Utility.DEFAULTUSER; assetHeader.Status = false; assetHeader.BranchID = Utility.SsnBranch; var item = new POSAccount.BusinessFactory.AssetHeaderBO().DeleteAssetHeader(assetHeader); } catch (Exception) { throw; } } var assets = new POSAccount.BusinessFactory.AssetHeaderBO().GetList(Utility.SsnBranch); // return View("AssetMaster", assets); return(Json(new { success = true, Message = string.Format("Asset Code {0} deleted successfully.", assetHeader.AssetCode) })); }