示例#1
0
        public async Task <string> deleteSupplierInfo(string info)
        {
            if (string.IsNullOrWhiteSpace(info))
            {
                return(JsonConvert.SerializeObject(new
                {
                    status = "fail",
                    message = "供应商ID不能为空",
                    date = DateTime.Now.ToShortDateString()
                }));
            }
            int         ID     = Convert.ToInt32(info);
            SupplierDal dal    = new SupplierDal();
            var         result = await dal.deleteSupplierInfo(ID);

            if (result.ResultCode != 0)
            {
                return(JsonConvert.SerializeObject(new
                {
                    status = "fail",
                    message = result.ResultMsg,
                    date = DateTime.Now.ToShortDateString()
                }));
            }

            return(JsonConvert.SerializeObject(new
            {
                status = "success",
                data = result.Data,
                date = DateTime.Now.ToShortDateString()
            }));
        }