using MySystem.Models.Main;
using Library;
using MySystem.Service.Main;
using System.Collections.Generic;
namespace MySystem
{
    /// <summary>
    /// 商户工具类
    /// </summary>
    public class MerchantInfoUtil
    {
        #region 修改商户记录
        /// <summary>
        /// 修改商户记录
        /// </summary>
        /// <param name="Id">商户Id</param>
        /// <param name="UserId">创客Id</param>
        /// <param name="Name">商户名称</param>
        /// <param name="Mobile">联系手机</param>
        /// <param name="Areas">门店省市编码</param>
        /// <param name="Address">门店地址</param>
        /// <param name="BrandId">品牌(0 银联 1 好哒)</param>
        /// <returns></returns>
        public static AppResultJson EditMerchantInfo(int Id, int UserId, string Name, string Mobile, string Areas, string Address, int BindStatus, int BrandId = 0)
        {
            Dictionary<string, object> Fields = new Dictionary<string, object>();
            Fields.Add("UserId", UserId);
            Fields.Add("Name", Name);
            Fields.Add("Mobile", Mobile);
            Fields.Add("Areas", Areas);
            Fields.Add("Address", Address);
            Fields.Add("BindStatus", BindStatus);
            Fields.Add("BrandId", BrandId);
            AppResultJson info = new AppResultJson();
            if (Id == 0)
            {
                info = MerchantInfoService.Add(Fields, false);
            }
            else
            {
                // Fields.Add("Status", 0);
                info = MerchantInfoService.Edit(Fields, Id, false);
            }
            return info;
        }
        #endregion

    }
}