private void clear(bool loadFromDB) { grdInsurance.CurrentRow = null; Insurance ins = new Insurance(); ins.Context = DataLayer.GetContext(); ins.InsuranceDefs = new EntityCollection<InsuranceDef>(); Service[] srvs = DataLayer.GetServices(false); for (int i = 0; i < srvs.Count(); i++) { InsuranceDef def = new InsuranceDef(); def.ServiceId = srvs[i].Id; ins.InsuranceDefs.Add(def); } insuranceBindingSource.DataSource = ins; txtInssuranceName.Focus(); btnAdd.Enabled = true; }
/// <summary> /// Create a new InsuranceDef object. /// </summary> /// <param name="serviceId">Initial value of the ServiceId property.</param> /// <param name="insuranceId">Initial value of the InsuranceId property.</param> public static InsuranceDef CreateInsuranceDef(global::System.Int32 serviceId, global::System.Int32 insuranceId) { InsuranceDef insuranceDef = new InsuranceDef(); insuranceDef.ServiceId = serviceId; insuranceDef.InsuranceId = insuranceId; return insuranceDef; }
/// <summary> /// Deprecated Method for adding a new object to the InsuranceDefs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToInsuranceDefs(InsuranceDef insuranceDef) { base.AddObject("InsuranceDefs", insuranceDef); }
/// <summary> /// Create a new InsuranceDef object. /// </summary> /// <param name="serviceId">Initial value of the ServiceId property.</param> /// <param name="insuranceId">Initial value of the InsuranceId property.</param> /// <param name="feePercenatage">Initial value of the FeePercenatage property.</param> public static InsuranceDef CreateInsuranceDef(global::System.Int32 serviceId, global::System.Int32 insuranceId, global::System.Int32 feePercenatage) { InsuranceDef insuranceDef = new InsuranceDef(); insuranceDef.ServiceId = serviceId; insuranceDef.InsuranceId = insuranceId; insuranceDef.FeePercenatage = feePercenatage; return insuranceDef; }