public static string GetCityNote(City city) { return (city.MainComplex.Address.Tag("p") + city.PhoneList.FirstOrDefault().Tag("p") + HtmlControls.MailTo(city.Email).ToString().Tag("p")); }
public string GetManagerNote(Employee employee) { var note = string.Empty; if (AuthService.CurrentUser != null) { note += HtmlControls.MailTo(employee.FirstEmail) .ToString().Tag("p"); } return(note); }
private TagDiv GetTable(string title, List <PiStudentInGroupLecture> students, int offset, bool webinar = false) { var disable = Model.LectureEditStatus != LectureEditStatus.All; var checkboxPostfix = webinar ? "" : "1"; if (students.Any()) { var data = new { Students = new PiStudentInGroupLecture() }; var isSameCourse = Model.StudentInfos.Select(x => x.Value.CourseTC).Distinct().Count() <= 1; var table = bh.Table(H.Head("#", "Слушатель", "Присут." + ShowWhenEdit(InputCheckbox("", "").Class("all-present" + checkboxPostfix).Title("Присутствие")), "Оценка", "Тип оценки", "Опоздание (мин)", "Уход (мин)", Model.LastLecture ? "Аттестация" : null, "Примечание"), students.Select(x => { var info = Model.StudentInfos[x.StudentInGroup_ID]; return(new { Student = x, info = info }); }) .OrderBy(x => x.info.FullName).Select((kk, idx) => { var i = idx + offset; var x = kk.Student; var info = kk.info; var megaGroupCourse = isSameCourse ? "" : " ({0})".FormatWith(info.CourseTC); var row = _.List <object>( i + 1, H.CleanRaw( Url.Lms().Student(info.StudentID, Raw(info.FullName)).Class("student-fullname").ToString() + Hidden(data.For(y => y.Students.StudentInGroupLecture_ID, i), x.StudentInGroupLecture_ID) + megaGroupCourse + span[info.Email.GetOrDefault(y => " (" + HtmlControls.MailTo(y) + ")")].Class("student-email") + UnlimitPart(info, x, data.For(z => z.Students.IsRecognized, i))), Div("checkbox")[ InputCheckbox(data.For(z => z.Students.IsPresent, i), "true") .SetChecked(x.IsPresent && x.Truancy.HasValue) .SetDisabled(disable) .Style("width:40px;margin-right:auto;margin-left:auto;") .Class("present-control" + checkboxPostfix), Hidden(data.For(z => z.Students.IsPresent, i), "false") ], Select(data.For(y => y.Students.Mark, i), x.Mark.HasValue ? x.Mark.Value.ToString("n0") : "", Enumerable.Range(1, 5).ToList(), z => z, z => z, true, "") .Style("width:60px;").Class("form-control mark-control") .SetDisabled(disable), Select(data.For(y => y.Students.TestMethodType_TC, i), x.TestMethodType_TC, TestMethodType.All, z => z.Name, z => z.TC, true, "Выбрать") .Style("width:100px;").Class("form-control method-type-control") .SetDisabled(disable), InputNumber(data.For(y => y.Students.Lateness, i), x.Lateness).Style("width:60px;") .Class("form-control").SetDisabled(disable), InputNumber(data.For(y => y.Students.Departure, i), x.Departure) .Class("form-control").Style("width:60px;").SetDisabled(disable) ); if (Model.LastLecture) { var list = GetExamMarkList(); row.Add( Select(data.For(y => y.Students.FinalExamMark_TC, i), info.FinalExamMark_TC, list, z => z.Item2, z => z.Item1, true, "Выбрать") .Style("width:100px;").Class("form-control exam-mark-control") .SetDisabled(disable)); } row.Add(InputText(data.For(y => y.Students.Notes, i), x.Notes) .SetDisabled(Model.LectureEditStatus == LectureEditStatus.Nothing) .Class("form-control text2area").Size(300).Style("width:300px;")); return(Row(row.ToArray())); })); return(div[h4[title], table]); } return(null); }