| using System; | 
| using System.Collections.Generic; | 
| using System.Linq; | 
| using System.Text; | 
| using System.Threading.Tasks; | 
| using WIDESEA_BasicRepository; | 
| using WIDESEA_Core; | 
| using WIDESEA_Core.BaseServices; | 
| using WIDESEA_DTO.Basic; | 
| using WIDESEA_DTO.ERP; | 
| using WIDESEA_IBasicRepository; | 
| using WIDESEA_IBasicService; | 
| using WIDESEA_Model.Models; | 
|   | 
| namespace WIDESEA_BasicService | 
| { | 
|     public class CustomerInfoService : ServiceBase<Dt_CustomerInfo, ICustomerInfoRepository>, ICustomerInfoService | 
|     { | 
|         public CustomerInfoService(ICustomerInfoRepository BaseDal) : base(BaseDal) | 
|         { | 
|         } | 
|   | 
|         public ICustomerInfoRepository Repository => BaseDal; | 
|   | 
|         public WebResponseContent ReceiveCustomer(CustomerInfoDTO model) | 
|         { | 
|             try | 
|             { | 
|                 //if (model.OperateType == "0") | 
|                 //{ | 
|                 Dt_CustomerInfo customer = new Dt_CustomerInfo() | 
|                 { | 
|                     Code = model.Code, | 
|                     Name = model.ShortName, | 
|                     NickName = model.Name, | 
|                     State = model.State, | 
|                 }; | 
|                 BaseDal.AddData(customer); | 
|                 //} | 
|                 //else if (model.OperateType == "1") | 
|                 //{ | 
|                 //    Dt_Customer customer = BaseDal.QueryFirst(x => x.Code == model.Code); | 
|                 //    if (customer == null) | 
|                 //    { | 
|                 //        return WebResponseContent.Instance.Error($"未找到该客户信息"); | 
|                 //    } | 
|                 //    customer.State = model.State; | 
|                 //    customer.Name = model.ShortName; | 
|                 //    customer.NickName = model.Name; | 
|                 //    BaseDal.UpdateData(customer); | 
|                 //} | 
|                 //else if (model.OperateType == "2") | 
|                 //{ | 
|                 //    Dt_Customer customer = BaseDal.QueryFirst(x => x.Code == model.Code); | 
|                 //    if (customer == null) | 
|                 //    { | 
|                 //        return WebResponseContent.Instance.Error($"未找到该客户信息"); | 
|                 //    } | 
|                 //    BaseDal.DeleteData(customer); | 
|                 //} | 
|                 return WebResponseContent.Instance.OK(); | 
|             } | 
|             catch (Exception ex) | 
|             { | 
|                 return WebResponseContent.Instance.Error(ex.Message); | 
|             } | 
|         } | 
|     } | 
| } |