public static Boolean Delete(Commons.FileHeader model) { using (IndexEntities db = new IndexEntities()) { db.spd_FileHeader(model.Id); } return(true); }
public static Commons.FileHeader Add(Commons.FileHeader model) { Commons.FileHeader result = new Commons.FileHeader(); using (IndexEntities db = new IndexEntities()) { spi_FileHeader_Result data = db.spi_FileHeader(model.IdCustomer, model.IdFileInfoConfig, model.IdDocument, model.AuthorizationDate, model.ExpantionDate, model.ExpirationDate, model.ArrivalDate, model.DocumentDate, model.ExchangeRate, model.Insurance, model.Cargo, model.IdCustom, model.IdCountry, model.IdWarranty, model.IdCellar, model.IdCurrency, model.IdResolution, model.IdAccount, model.CifTotal, model.LinesTotal, model.Facturas, model.RegisterUser).FirstOrDefault(); result = FileHeader.Tranform(data); } return(result); }
public HttpResponseMessage Delete(Commons.FileHeader model) { HttpResponseMessage respuesta = null; try { Boolean result = Dal.FileHeader.Delete(model); respuesta = Request.CreateResponse(HttpStatusCode.OK, result); } catch (Exception ex) { respuesta = Request.CreateErrorResponse(HttpStatusCode.Conflict, (ex.InnerException == null) ? ex.Message : ex.InnerException.Message); } return(respuesta); }
private static Commons.FileHeader Tranform(spu_FileHeader_Result data) { Commons.FileHeader result = new Commons.FileHeader() { AccounName = data.AccountName, ArrivalDate = data.ArrivalDate, AuthorizationDate = data.AuthorizationDate, Cargo = data.Cargo, CellarName = data.CellarName, CifTotal = data.CIFTotal, CountryName = data.CountryName, CreateDate = data.CreateDate, CurrencyName = data.CurrencyName, CustomName = data.CustomName, DocumentDate = data.DocumentDate, ExchangeRate = data.ExchangeRate, ExpantionDate = data.ExpantionDate, ExpirationDate = data.ExpirationDate, Facturas = data.Facturas, FileInfoName = data.FileName, Id = data.Id, IdAccount = data.IdAccount, IdCellar = data.IdCellar, IdCountry = data.IdCountry, IdCurrency = data.IdCurrency, IdCustom = data.IdCustom, IdCustomer = data.IdCustomer, IdDocument = data.IdDocument, IdFileInfoConfig = data.IdFileInfoConfig, IdResolution = data.IdResolution, IdState = data.IdState, IdWarranty = data.IdWarranty, Insurance = data.Insurance, IsSubstract = data.IsSubstract, LinesTotal = data.LinesTotal, LoadRawMaterial = data.LoadRawMaterial, Operation = data.Operation, ResolutionName = data.ResolutionName, Reviewed = data.Reviewed, StateName = data.StateName, UseAttached = data.UseAttached, WarrantyName = data.WarrantyName, UpdateDate = data.UpdateDate }; return(result); }