Ejemplo n.º 1
0
        public static RequestResult Delete(List <string> selectedList)
        {
            RequestResult requestResult = new RequestResult();

            try
            {
                using (CFContext context = new CFContext())
                {
                    DeleteHelper.DeleteMaterial(context, selectedList);

                    context.SaveChanges();
                }

                requestResult.ReturnSuccessMessage(string.Format("{0} {1} {2}", Resources.Resource.Delete, Resources.Resource.Material, Resources.Resource.Success));
            }
            catch (Exception e)
            {
                var error = new Error(MethodBase.GetCurrentMethod(), e);

                Logger.Log(error);

                requestResult.ReturnError(error);
            }

            return(requestResult);
        }