/// <summary> /// the common procedure of saving for all associations in the Add mode in database /// </summary> private void SaveAssociations() { try { order = new clsWorkOrders(); order.iOrgId = OrgId; order.iId = OrderId; order.sTypeService = sType; order.iItemId = ItemId; if (ServiceResult == "Repair") order.iServiceResultId = (int)ServiceResults._Repaired; else order.iServiceResultId = (int)ServiceResults._Replaced; foreach (RepeaterItem item in repRepairs.Items) { order.iRepairId = Convert.ToInt32(((LinkButton)item.FindControl("lbEditRepair")).CommandArgument); order.bChecked = ((CheckBox)item.FindControl("cbRepair")).Checked; order.SetAssociationsRepair(); } } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { if (order != null) order.Dispose(); } }