public string FrChooseSubmit(FormCollection form) { string result = string.Empty; TopFrChoose dal = new TopFrChoose(); try { for (int i = 1; i < 19; i++) { if (form["topfrchoose" + i.ToString()] != null) { var model = dal.GetSingledataById(i); int tempint = 0; int.TryParse(form["topfrchoose" + i.ToString()], out tempint); if (tempint.Equals(0)) model.Tp_DcID_FK = null; else model.Tp_DcID_FK = tempint; dal.Update(model); } } result = "1"; } catch (Exception) { result = "0"; } return result; }