private void lnkRemoveRow_Click(object sender, EventArgs e) { string[] subitemsId = Request.Form.GetValues("bmRowChecked"); if (subitemsId == null) return; HierarchicalSerializer hSerializer = new HierarchicalSerializer(); JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); BuildingComparer bc = BuildingComparer.Empty; hSerializer.Read(hdnDataRef.Value); foreach (string ids in subitemsId) { ListDictionary dataRow = jsSerializer.Deserialize<ListDictionary>(ids); bc.Set(Convert.ToInt32(dataRow["pId"]), Convert.ToInt32(dataRow["bId"]), Convert.ToInt32(dataRow["wId"]), Convert.ToInt32(dataRow["gId"]), Convert.ToInt32(dataRow["iId"]), Convert.ToInt32(dataRow["sId"])); hSerializer.RemoveEntry(bc); } hdnDataRef.Value = hSerializer.ToString(); }
private void BindGridContractDetail(int projectId, int blockId, int workId, int groupId, int itemId, string currencyCode) { using (IDataReader reader = SubItem.GetAllForContract(projectId, blockId, workId, groupId, itemId, currencyCode)) { HierarchicalSerializer hSerializer = new HierarchicalSerializer(); hSerializer.Read(hdnDataRef.Value); while (reader.Read()) { hSerializer.AddEntry(reader); } hdnDataRef.Value = hSerializer.ToString(); } }