public void SetValue(string prop, string value = null, IType instance = null) { switch (prop) { case DataTypes.PRIVATE_ENTERPRENUER_DT: PrivateEnterprenuer = (PrivateEnterprenuer)instance; break; case DataTypes.TYPE_1_DF_DT: Type = value; break; case DataTypes.QUARTER_DT: Quarter = int.Parse(value); break; case DataTypes.YEAR_DT: Year = int.Parse(value); break; case DataTypes.EMPLOYEE_BY_EMPLOYMENT_CONRACT_DT: EmployeeByEmplContract = int.Parse(value); break; case DataTypes.EMPLOYEE_BY_CIVIL_CONRACT_DT: EmployeeByCivivlContract = int.Parse(value); break; case DataTypes.SECTION_1_DF_1_DT: Section1 = (Form1DF1Section1)instance; break; } }
private void createNewForm1DFSection1(string identifier) { var instance = new Form1DF1Section1 { IDName = identifier }; Data.Identifiers.Add(identifier); Data.form1DF1Sections.Add(instance); Data.Instances.Add(instance); }
internal void SetIdById(string id, string valueId) { /* var instance = GetInstance(id);*/ var instanceValue = GetInstance(valueId); /* Instances.Remove(instance); * instance = instanceValue; * Instances.Add(instance);*/ bool isPrimitive = true; string idType = GetIdType(id); switch (idType) { case DataTypes.PRIVATE_ENTERPRENUER_DT: { PrivateEnterprenuer instance = getPrEntItemByID(id); var name = instance.IDName; if (instanceValue is PrivateEnterprenuer) { PrivateEnterprenuer value = (PrivateEnterprenuer)instanceValue; instance = value.Clone(); instance.IDName = name; } else { showExIdTypesAreDifferent(DataTypes.PRIVATE_ENTERPRENUER_DT, instanceValue); } changeForNewInstancePrEnt(id, instance); isPrimitive = false; break; } case DataTypes.ONE_TAX_PAYER_REPORT_DT: { var instance = getOneTaxPayerReportItemByID(id); var name = instance.IDName; if (instanceValue is OneTaxPayer) { OneTaxPayer value = (OneTaxPayer)instanceValue; instance = value.Clone(); instance.IDName = name; } else { showExIdTypesAreDifferent(DataTypes.ONE_TAX_PAYER_REPORT_DT, instanceValue); } changeForNewInstanceOneTaxPayerReport(id, instance); isPrimitive = false; break; } case DataTypes.DF_1_REPORT_DT: { var instance = getForm1DFReportItemByID(id); var name = instance.IDName; if (instanceValue is Form1DF) { Form1DF value = (Form1DF)instanceValue; instance = value.Clone(); instance.IDName = name; } else { showExIdTypesAreDifferent(DataTypes.DF_1_REPORT_DT, instanceValue); } changeForNewInstanceDF1(id, instance); isPrimitive = false; break; } case DataTypes.SECTION_1_DF_1_DT: { var instance = getForm1DFSection1ItemByID(id); var name = instance.IDName; if (instanceValue is Form1DF1Section1) { Form1DF1Section1 value = (Form1DF1Section1)instanceValue; instance = value.Clone(); instance.IDName = name; } else { showExIdTypesAreDifferent(DataTypes.SECTION_1_DF_1_DT, instanceValue); } changeForNewInstanceDF1Section1(id, instance); isPrimitive = false; break; } case DataTypes.UNIFIED_SOCIAL_TAX_REPORT_DT: { var instance = getUnifiedSocilTaxReportItemByID(id); var name = instance.IDName; if (instanceValue is UnifiedSocialTaxReport) { var value = (UnifiedSocialTaxReport)instanceValue; instance = value.Clone(); instance.IDName = name; } else { showExIdTypesAreDifferent(DataTypes.UNIFIED_SOCIAL_TAX_REPORT_DT, instanceValue); } changeForNewInstanceUnifiedSocialTax(id, instance); isPrimitive = false; break; } case DataTypes.TABLE_1_UNIFIED_SOCIL_TAX_DT: { var instance = getUnifiedSocilTaxTable1ItemByID(id); var name = instance.IDName; if (instanceValue is UnifiedSocialTax) { var value = (UnifiedSocialTax)instanceValue; instance = value.Clone(); instance.IDName = name; } else { showExIdTypesAreDifferent(DataTypes.TABLE_1_UNIFIED_SOCIL_TAX_DT, instanceValue); } changeForNewInstanceUnifiedSocialTaxTable1(id, instance); isPrimitive = false; break; } } if (isPrimitive && instanceValue is PrimitiveType) { var primitiveInstance = GetPrimitiveInstance(id); var curr = (PrimitiveType)instanceValue; primitiveInstance.StrValue = curr.StrValue; changePrimitives(id, primitiveInstance); } }
private void changeForNewInstanceDF1Section1(string id, Form1DF1Section1 instance) { form1DF1Sections.Remove(getForm1DFSection1ItemByID(id)); form1DF1Sections.Add(instance); }