示例#1
0
        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;
        }
示例#2
0
 /// <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;
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the InsuranceDefs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; 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;
 }