public ActionResult ImageFiles(AssetsEntry _asset) { try { var docname = Request.Params["docname"].ToString(); if (Request.Files.Count > 0) { var file = Request.Files[0]; string FileName = file.FileName; if (file != null && file.ContentLength > 0) { BinaryReader reader = new BinaryReader(file.InputStream); MTSHRDataLayer.Policies data_doc = new MTSHRDataLayer.Policies(); byte[] bytes = reader.ReadBytes((int)file.ContentLength); int result = data_doc.Create(docname, bytes, FileName); return(Content("Success")); } } } catch (Exception exec) { BaseExceptionHandler.HandleException(ref exec); } return(Content("Failed")); }
public int AddAssetDetails(AssetsEntry _asset) { MTSHRDataLayer.Asset _data = new MTSHRDataLayer.Asset(); try { int result = 0; result = _data.Create(_asset.Id, _asset.VendorName, _asset.PurchaseOrderNumber, _asset.PurchasedOn, _asset.BillNumber, _asset.BillDate, _asset.AssetType, _asset.AssetName, _asset.AssetDescription, _asset.CostInRs, _asset.CostType, _asset.Make, _asset.Model, _asset.SerialNumber, _asset.IdentificationCode, _asset.WarrantyMonths, _asset.WarrantyStartDate, _asset.WarrantyEndDate, _asset.InvoiceId, _asset.AssetTypeId, _asset.AssetNameId, HRConstants.AssetStatusConstants.Unassigned); return(result); } catch (Exception exec) { BaseExceptionHandler.HandleException(ref exec); throw exec; } }