Esempio n. 1
0
        //public bool Delete(int id, out Notification notification)
        //{
        //    notification = new Notification { Type = NotificationType.Success };
        //    try
        //    {
        //        using (var context = CreateContext())
        //        {
        //            var dbItem = context.OutsourcingCost.Where(o => o.OutsourcingCostID == id).FirstOrDefault();
        //            context.OutsourcingCost.Remove(dbItem);
        //            context.SaveChanges();
        //        }
        //        return true;
        //    }
        //    catch (Exception ex)
        //    {
        //        notification.Type = Library.DTO.NotificationType.Error;
        //        notification.Message = ex.Message;
        //        notification.DetailMessage.Add(ex.Message);
        //        if (ex.GetBaseException() != null)
        //        {
        //            notification.DetailMessage.Add(ex.GetBaseException().Message);
        //        }
        //        return false;
        //    }
        //}
        public List <DTO.SupportClient> GetSupportClient(string client, out Library.DTO.Notification notification)
        {
            notification = new Library.DTO.Notification()
            {
                Type = Library.DTO.NotificationType.Success
            };
            List <DTO.SupportClient> data = new List <DTO.SupportClient>();

            data = new List <DTO.SupportClient>();
            try
            {
                using (DraftCommercialInvoiceMngEntities context = CreateContext())
                {
                    return(data = converter.DB2DTO_SupportClient(context.DraftCommercialInvoiceMng_function_SearchClient(client).ToList()));
                }
            }
            catch (Exception ex)
            {
                notification.Type    = Library.DTO.NotificationType.Error;
                notification.Message = ex.Message;
                return(null);
            }
        }