Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     hidCompId.Value = CompID.ToString();
     if (!IsPostBack)
     {
         DataBinds();
         if (KeyID != 0)
         {
             List <Hi.Model.BD_Distributor> Ldis = new Hi.BLL.BD_Distributor().GetList("", "auditstate=2 and isnull(IsEnabled,0)=1  and isnull(dr,0)=0 and SMID = " + KeyID + " and CompID=" + CompID, "");
             if (Ldis.Count > 0)
             {
                 tbdis.Attributes["style"] = "display:block;";
             }
             else
             {
                 tbdis.Attributes["style"] = "display:none;";
             }
             Rpt_Dis.DataSource = Ldis;
             Rpt_Dis.DataBind();
             for (int i = 0; i < Ldis.Count; i++)
             {
                 hidselectDis.Value += Ldis[i].ID + ",";
             }
             hidselectDis.Value = hidselectDis.Value.TrimEnd(',');
         }
     }
 }
Пример #2
0
    protected void Btn_Dis(object sender, EventArgs e)
    {
        List <Hi.Model.BD_Distributor> Ldis = new Hi.BLL.BD_Distributor().GetList("", "isnull(dr,0)=0 and id in (" + hidselectDis.Value + ")", "");

        if (Ldis.Count > 0)
        {
            tbdis.Attributes["style"] = "display:block;";
        }
        else
        {
            tbdis.Attributes["style"] = "display:none;";
        }
        Rpt_Dis.DataSource = Ldis;
        Rpt_Dis.DataBind();
    }