private void BindRealTag(String SAID)
 {
     using (SATagMapDataAccess DataAccess = new SATagMapDataAccess()) {
         TagRepeater.DataSource = DataAccess.GetSATagMaps(SAID);
         TagRepeater.DataBind();
     }
 }
Exemplo n.º 2
0
 public override void DataBind()
 {
     TagRepeater.DataSource = KPI_RealTagDal.GetRealTags(UnitID);
     base.DataBind();
     Literal lblRealID;
     CheckBox chkSelected;
     using (SATagMapDataAccess DataAccess = new SATagMapDataAccess()) {
         List<String> TagIDList = DataAccess.GetSATagMaps(SAID).Select(p => p.RealID).ToList<String>();
         RepeaterItemCollection Items = TagRepeater.Items;
         foreach (RepeaterItem Item in Items) {
             lblRealID = (Literal)Item.FindControl("lblRealID");
             chkSelected = (CheckBox)Item.FindControl("chkSelected");
             chkSelected.Checked = TagIDList.Contains(lblRealID.Text);
         }
     }
 }
Exemplo n.º 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            CheckBox chkSelected;
            Literal lblRealID;
            SATagMapEntity SATagMap;

            using (SATagMapDataAccess DataAccess = new SATagMapDataAccess()) {
                DataAccess.DeleteSATagMap(SAID);
                RepeaterItemCollection Items = TagRepeater.Items;
                foreach (RepeaterItem Item in Items) {
                    lblRealID = (Literal)Item.FindControl("lblRealID");
                    chkSelected = (CheckBox)Item.FindControl("chkSelected");
                    if (chkSelected.Checked) {
                        SATagMap = new SATagMapEntity {
                            SAID = SAID,
                            RealID = lblRealID.Text
                        };
                        DataAccess.SaveSATagMap(SATagMap);
                    }
                }
            }
            ScriptManager.RegisterClientScriptBlock(this, GetType(), "Msg", "alert('数据保存成功!')", true);
        }