protected string ShowClient(int id)
    {
        string             clientname = "";
        IList <CM_DIUsers> lists      = CM_DIUsersBLL.GetModelList("ShipID=" + id.ToString());

        foreach (CM_DIUsers item in lists)
        {
            CM_Client c = new CM_ClientBLL(item.Client).Model;
            if (c != null)
            {
                clientname += "<a href='DistributorDetail.aspx?ClientID=" + c.ID.ToString() + "' target='_blank' class='listViewTdLinkS1'>"
                              + c.FullName + "</a><br/>";
            }
        }
        return(clientname);
    }
 protected void btn_Add_Click(object sender, EventArgs e)
 {
     if (select_Client.SelectValue != "" && select_Client.SelectValue != "0")
     {
         int client = int.Parse(select_Client.SelectValue);
         if (CM_DIUsersBLL.GetModelList("ShipID=" + ViewState["ShipID"] + " AND Client=" + client).Count > 0)
         {
             MessageBox.Show(this, "该经销商已添加!");
             return;
         }
         CM_DIUsersBLL user = new CM_DIUsersBLL();
         user.Model.Client = client;
         user.Model.ShipID = (int)ViewState["ShipID"];
         if (user.Add() > 0)
         {
             BindGrid();
         }
         else
         {
             MessageBox.Show(this, "添加失败!");
         }
     }
 }