public static CustomAttributeEditorTeeth CreateCustomAttributEditorTeeth(Teeth model) { var teeth = new CustomAttributeEditorTeeth(); teeth.Type = "Teeth"; //TODO: assign the model data to the editor teeth.Id = model.Id; String tn = model.Id; Match mt = Regex.Match(tn, @"teeth\d\d"); if (mt.Value == "") { mt = Regex.Match(tn, @"teeth\d"); tn = mt.Value.Substring("teeth".Length, 1); } else { tn = mt.Value.Substring("teeth".Length, 2); } //tn = tn.Substring("teeth".Length, 2); int itn = 0; int.TryParse(tn, out itn); teeth.TeethNumber = itn; teeth.Length = model.Length; return(teeth); }
public static CustomAttributeEditorTeeth CreateCustomAttributEditorTeeth(Teeth model) { var teeth = new CustomAttributeEditorTeeth(); teeth.Type = "Teeth"; //TODO: assign the model data to the editor teeth.Id = model.Id; String tn = model.Id; Match mt = Regex.Match(tn, @"teeth\d\d"); if (mt.Value == "") { mt = Regex.Match(tn, @"teeth\d"); tn = mt.Value.Substring("teeth".Length, 1); } else { tn = mt.Value.Substring("teeth".Length, 2); } //tn = tn.Substring("teeth".Length, 2); int itn = 0; int.TryParse(tn, out itn); teeth.TeethNumber = itn; teeth.Length = model.Length; return teeth; }