Exemple #1
0
        /// <summary>
        /// 新增提醒管理
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ResultDTO <object> AddWarningInfo(WarningDTO dto)
        {
            ResultDTO <object> resultdto = new ResultDTO <object>();

            resultdto = PostAPI <ResultDTO <object> >(WebConfiger.MasterDataServicesUrl + "Warning", dto);

            return(resultdto);
        }
Exemple #2
0
        /// <summary>
        /// 新增提醒管理
        /// </summary>
        /// <returns></returns>
        public bool AddWarningInfo(WarningDTO dto)
        {
            bool result = false;

            using (var tcdmse = new Entities.TCDMS_MasterDataEntities())
            {
                common_WarningInfo warning = new common_WarningInfo();
                Mapper.Map <WarningDTO, common_WarningInfo>(dto, warning);

                tcdmse.common_WarningInfo.Add(warning);

                result = tcdmse.SaveChanges() > 0;
            }

            return(result);
        }
Exemple #3
0
        public HttpResponseMessage AddWarningInfo(WarningDTO dto)
        {
            ResultDTO <object> resultdto = new ResultDTO <object>();

            try
            {
                resultdto.SubmitResult = _ICommonServices.AddWarningInfo(dto);
            }
            catch (Exception ex)
            {
                resultdto.SubmitResult = false;
                resultdto.Message      = ex.Message;
            }

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(resultdto),
                                            System.Text.Encoding.GetEncoding("UTF-8"),
                                            "application/json")
            };

            return(result);
        }