public static HistorySaverUnitControlFormat getMyInstance(IKeepable _sampleObject) { // if (parent == null) return null; string tmp; HistorySaverUnitControlFormat g = new HistorySaverUnitControlFormat(_sampleObject); Lib.FieldsInfo f = _sampleObject.fieldsInfo; tmp = "targetEntityName"; g.addFormatLine(tmp, 170, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "fieldClassName"; g.addFormatLine(tmp, 170, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "newValue"; g.addFormatLine(tmp, 170, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "oldValue"; g.addFormatLine(tmp, 170, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "dateTimeOfChange"; g.addFormatLine(tmp, 170, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "userId"; g.addFormatLine(tmp, 170, f.getFieldInfoObjectByFieldClassName(tmp).caption); return(g); }
//TODO для этой сущности бы и не надо дату создания / последнего обновления, но пока не будем это убирать public override Lib.FieldsInfo _get_fieldsInfo() { Lib.FieldsInfo f = getInitialFieldsInfoObject(true, false, false); Lib.FieldInfo x; //entityName x = f.addFieldInfoObject("entityName", "entityName", Lib.FieldTypeEnum.String); //objectId x = f.addFieldInfoObject("objectId", "objectId", Lib.FieldTypeEnum.String); x.caption = "Id"; //oldValue x = f.addFieldInfoObject("oldValue", "oldValue", Lib.FieldTypeEnum.String); x.caption = "Старое значение"; //targetEntityName x = f.addFieldInfoObject("targetEntityName", "targetEntityName", Lib.FieldTypeEnum.String); x.caption = "Тип объекта"; //newValue x = f.addFieldInfoObject("newValue", "newValue", Lib.FieldTypeEnum.String); x.caption = "Новое значение"; //fieldClassName x = f.addFieldInfoObject("fieldClassName", "fieldClassName", Lib.FieldTypeEnum.String); x.caption = "Параметр"; //dateTimeOfChange x = f.addFieldInfoObject("dateTimeOfChange", "dateTimeOfChange", Lib.FieldTypeEnum.DateTime); x.caption = "Дата/время изменения"; //TODO проверка дублиукаты поей в fieldInfo //userId x = f.addFieldInfoObject("userId", "userId", Lib.FieldTypeEnum.String); x.caption = "Id пользователя"; return(f); }
public static ShortCoffeePointGridFormat getMyInstance(IKeepable sampleObject) { // if (parent == null) return null; string tmp; ShortCoffeePointGridFormat g = new ShortCoffeePointGridFormat(sampleObject); Lib.FieldsInfo f = sampleObject.fieldsInfo; tmp = "id"; g.addFormatLine(tmp, 0, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "name"; g.addFormatLine(tmp, 150, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "lastVisitDate"; g.addFormatLine(tmp, 100, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "bigLattePrice"; g.addFormatLine(tmp, 50, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "description"; g.addFormatLine(tmp, 200, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "alias"; g.addFormatLine(tmp, 150, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "lastVisitDate2"; g.addFormatLine(tmp, 100, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "bigLattePrice2"; g.addFormatLine(tmp, 50, f.getFieldInfoObjectByFieldClassName(tmp).caption); tmp = "description2"; g.addFormatLine(tmp, 200, f.getFieldInfoObjectByFieldClassName(tmp).caption); return(g); }
public override Lib.FieldsInfo _get_fieldsInfo() { Lib.FieldInfo x; Lib.FieldsInfo f = this.getInitialFieldsInfoObject(); x = f.addFieldInfoObject("name", "name", Lib.FieldTypeEnum.String); x.nullabilityInfo.allowNull = false; x.nullabilityInfo.defaultValue = "NewCoffeePoint"; x.caption = "Название"; x.validationInfo.leaveValidation.rules.Add(new VCCommon.VF.com_leave_strictNamingString()); x.isSearchable = true; x = f.addFieldInfoObject("lastVisitDate", "lastVisitDate", Lib.FieldTypeEnum.Date); x.nullabilityInfo.allowNull = true; x.caption = "Посл.посещение"; x = f.addFieldInfoObject("bigLattePrice", "bigLattePrice", Lib.FieldTypeEnum.Double); x.nullabilityInfo.allowNull = true; x.caption = "Цена большого латте"; x.validationInfo.symbolValidation.rules.Add(new VCCommon.VF.com_symbol_double(',')); x.validationInfo.leaveValidation.rules.Add(new VCCommon.VF.com_leave_double(',', 2)); //x.validationInfo.businessValidation.rules.Add(new VCCommon.VF.biz_priceMoreThan80()); x.saveHistory = true; x = f.addFieldInfoObject("description", "description", Lib.FieldTypeEnum.String); x.caption = "Комментарий"; x.nullabilityInfo.allowNull = true; x.isSearchable = true; x = f.addFieldInfoObject("alias", "alias", Lib.FieldTypeEnum.String); x.caption = "Алиас"; x.nullabilityInfo.allowNull = false; x.nullabilityInfo.defaultValue = "NewCoffeePointAlias"; x.isSearchable = true; x = f.addFieldInfoObject("lastVisitDate2", "lastVisitDate2", Lib.FieldTypeEnum.Date); x.nullabilityInfo.allowNull = false; x.caption = "Посл.посещение2"; x.nullabilityInfo.defaultValue = Convert.ToDateTime("01.01.2001"); x = f.addFieldInfoObject("bigLattePrice2", "bigLattePrice2", Lib.FieldTypeEnum.Double); x.nullabilityInfo.allowNull = false; x.nullabilityInfo.defaultValue = 100; x.caption = "Цена большого латте2"; x.validationInfo.symbolValidation.rules.Add(new VCCommon.VF.com_symbol_double(',')); x.validationInfo.leaveValidation.rules.Add(new VCCommon.VF.com_leave_double(',', 2)); x.validationInfo.businessValidation.rules.Add(new VCCommon.VF.biz_priceMoreThan80()); x.isAvialbeForGroupOperations = true; x = f.addFieldInfoObject("description2", "description2", Lib.FieldTypeEnum.String); x.caption = "Комментарий2"; x.nullabilityInfo.allowNull = false; x.nullabilityInfo.defaultValue = "Default Description"; x.isSearchable = true; x.isAvialbeForGroupOperations = true; x.validationInfo.leaveValidation.rules.Add(new VCCommon.VF.com_leave_snake_style_alias()); return(f); }