void BindDate() { List <int> dayList = new List <int>(); List <string> monthList = new List <string>(); List <string> yearList = new List <string>(); for (int i = 1; i <= 31; i++) { if (i <= 12) { monthList.Add(i.ToString()); } dayList.Add(i); } for (int i = 1990; i < 2010; i++) { yearList.Add(i.ToString()); } DayList.DataSource = dayList; DayList.DataBind(); MonthList.DataSource = monthList; MonthList.DataBind(); YearList.DataSource = yearList; YearList.DataBind(); }
public ActionResult Edit([Bind(Include = "YearListId,YearListYear")] YearList yearList) { if (ModelState.IsValid) { db.Entry(yearList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearList)); }
public ActionResult DeleteConfirmed(int id) { YearList yearList = db.YearList.Find(id); db.spDeleteVotes(yearList.YearListId); db.spDeleteTracks(yearList.YearListId); db.YearList.Remove(yearList); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "YearListId,YearListYear")] YearList yearList) { if (ModelState.IsValid) { db.YearList.Add(yearList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearList)); }
private void BindYearList() { int nowYear = Convert.ToInt32(DateTime.Now.Year); List <string> info = new List <string>(); info.Add("全部"); for (int i = nowYear; i > 2009; i--) { info.Add(i + ""); } YearList.DataSource = info; YearList.DataBind(); }
// GET: YearLists/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } YearList yearList = db.YearList.Find(id); if (yearList == null) { return(HttpNotFound()); } return(View(yearList)); }
public void Update(int year, int score) { if (year != _lastYear) { _lastYear = year; YearList.Clear(); YearList = UpdateNumberList(year.ToString().ToCharArray()); } if (score != _lastScore) { _lastScore = score; ScoreList.Clear(); ScoreList = UpdateNumberList(score.ToString().ToCharArray()); } }
public WorksViewModel() { if (DesignMode.DesignModeEnabled) { return; } for (var i = DateTime.Now.Year; i < DateTime.Now.Year + 10; i++) { YearList.Add(i); } SelectedYear = DateTime.Now.Year; WorkTypes.CollectionChanged += WorkTypes_CollectionChanged; if (DesignMode.DesignModeEnabled) { SelectedMonth = YearWorks[4]; } UpdateWork(); CarsHandler.SelectionChanged += CarsHandler_SelectionChanged; }
protected void Page_Load(object sender, EventArgs e) { uid = Request.QueryString["Id"]; action = Request.QueryString["Action"]; if (!Page.IsPostBack) { YearList.DataSource = Enumerable.Range(startYear, DateTime.Now.Year - startYear + 1).Reverse(); YearList.DataBind(); MonthList.DataSource = Enumerable.Range(1, 12); MonthList.DataBind(); } if (action == "create") { } else { } Comment.Visible = false; Boolean isLeapYear = IsLeapYear(); int year = int.Parse(YearList.SelectedValue); int month = int.Parse(MonthList.SelectedValue); int endDate = 30; int[] bigMonth = { 1, 3, 5, 7, 8, 10, 12 }; if (bigMonth.Contains(month)) { endDate = 31; } if (month == 2) { if (isLeapYear == true) { endDate = 29; } else { endDate = 28; } } DayList.DataSource = Enumerable.Range(1, endDate); DayList.DataBind(); }
private void btnWriteClipboard_Click(object sender, EventArgs e) { try { if (!int.TryParse(txtYear.Text, out var year)) { txtLog.Text += "Invalid year number\r\n"; return; } _calendarItems = YearList.GetList(year, txtGmail.Text, txtHolidayCalendar.Text, chkPersonal.Checked, chkHolidays.Checked); var everLog = GenEverLog.CreateYear(year, _calendarItems); ClipboardHelper.CopyToClipboard(everLog.Item1.ToString(), everLog.Item2.ToString()); txtLog.Text += "Added HTML to Clipboard\r\n"; } catch (Exception ex) { txtLog.Text += $"Error adding HTML: {ex}"; } }
/// <summary> /// Methods clicks on option: 'Current Year' or 'Next Year' in 'Year' dropdown of Date Picker Calendar /// </summary> public void SelectYearInDatePickerCalendar(YearList options) { commonMethods.GetElementByWithLogs(driver, YearDropdownInDatePickerCalendarLocator, "Can NOT click on 'Year' DropDown of Date Picker Calendar").Click(); LogUtil.WriteDebug("Clicked on 'Year' DropDown of Date Picker Calendar"); switch (options) { case YearList.CurrentYear: { commonMethods.GetElementByWithLogs(driver, CurrentYearOptionLocator, "Can NOT click on 'Current Year' option in 'Year' dropdown").Click(); LogUtil.WriteDebug("Clicked on Current Year option in 'Year' dropdown of Date Picker Calendar"); break; } case YearList.NextYear: { commonMethods.GetElementByWithLogs(driver, NextYearOptionLocator, "Can NOT click on 'Next Year' option in 'Year' dropdown").Click(); LogUtil.WriteDebug("Clicked on Next Year option in 'Year' dropdown of Date Picker Calendar"); break; } } }
protected void Page_Load(object sender, EventArgs e) { //ArrayList year2list = new ArrayList(); //for (int yea = 2019; yea <= 2050; yea++) //{ // yearlist.Add(yea); //} //DropDownList9.DataSource = yearlist; //DropDownList9.DataBind(); ArrayList year = new ArrayList(); for (int y = 1950; y <= 2019; y++) { year.Add(y); } YearList.DataSource = year; YearList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UData"] != null) { DataSet MyRecDataSet = (DataSet)Session["UData"]; if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true || Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true) { RepYears.DataSource = YearList.DataSource = Obj.GetDataSet("ReportAllYears"); YearList.DataBind(); RepYears.DataBind(); YearList.DataTextField = "YearName"; YearList.DataValueField = "ID"; YearList.DataBind(); } else if (Obj.ExecuteProcedureID("CheckSectionManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1) { Sections.Attributes.Remove("style"); Sections.Attributes.Add("style", "display:none"); RepYears.DataSource = YearList.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"])); YearList.DataBind(); RepYears.DataBind(); YearList.DataTextField = "YearName"; YearList.DataValueField = "ID"; YearList.DataBind(); } else { Response.Redirect("NoPermissions.aspx"); } } } else { if (HiddenYear.Value == "1") { DataSet MyRecDataSet = (DataSet)Session["UData"]; if (YearList.SelectedIndex == -1) { SectorList.Items.Clear(); AdminList.Items.Clear(); RepYears.DataSource = null; RepYears.DataBind(); RepYears.DataSource = Obj.GetDataSet("ReportAllYears"); RepYears.DataBind(); } else { for (int i = 0; i <= YearList.Items.Count - 1; i++) { if (YearList.Items[i].Selected == true) { // Fill dropdown Lists For Reports Sections تبعا للسنة RepYears.DataSource = null; RepYears.DataBind(); RepYears.DataSource = Obj.GetDataSetByID("ReportOneYearAll", Convert.ToInt32(YearList.Items[i].Value)); RepYears.DataBind(); if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true || Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true) { SectorList.DataSource = null; SectorList.DataBind(); SectorList.DataSource = Obj.GetDataSetByID("ReportSectionsAllStatusYear", Convert.ToInt32(YearList.Items[i].Value)); SectorList.DataTextField = "SectionName"; SectorList.DataValueField = "SectionID"; SectorList.DataBind(); } else if (Obj.GetDataSetByID("GetSectionsByManager", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])).Tables[0].Rows.Count > 0) { } } } } HiddenYear.Value = "0"; } if (HiddenSector.Value == "1") { for (int i = 0; i <= SectorList.Items.Count - 1; i++) { if (SectorList.Items[i].Selected == true) { for (int j = 0; j <= YearList.Items.Count - 1; j++) { if (YearList.Items[j].Selected == true) { RepYears.DataSource = null; RepYears.DataBind(); RepYears.DataSource = Obj.GetDataSetByID("ReportOneYearAll", Convert.ToInt32(YearList.Items[j].Value)); RepYears.DataBind(); AdminList.DataSource = null; AdminList.DataBind(); AdminList.DataSource = Obj.GetDataSetBy2ID("RepAllAdminsByStatIDYear", Convert.ToInt32(YearList.Items[j].Value), Convert.ToInt32(SectorList.Items[i].Value)); AdminList.DataTextField = "AdmName"; AdminList.DataValueField = "AdmID"; AdminList.DataBind(); } } } } HiddenSector.Value = "0"; } } }
public HttpResponseMessage GetUploadedDocInfo(string clientId, string doctorId) { var desiesTypeResultList = new List <DesiesTypeResult>(); var disease = _diseaseDetailRepo.GetAll().OrderBy(x => x.DiseaseType).ToList(); string host = constant.imgUrl;// ConfigurationManager.AppSettings.Get("ImageBaseUrl");//HttpContext.Current.Request.Url.Host; var quickUp = _quickUploadRepo.GetAll().ToList(); var quickUpAssign = _QuickUploadAssignRepo.GetAll().ToList(); var appointDetail = (from a in quickUp join t in quickUpAssign on a.Id equals t.QuickUploadId where t.AssignId == doctorId && t.AssignBy == clientId && t.IsActive == true select a).ToList(); var result = appointDetail; var list = result.ToList(); var data = list.GroupBy(item => item.DesiesType) .Select(group => new { diseaseType = group.Key, Items = group.ToList() }) .ToList(); foreach (var x in data) { var desiesTypeResult = new DesiesTypeResult(); var listYear = x.Items.Select(xx => xx).ToList().GroupBy(p => p.AddedYear). Select(group => new { AddedYear = group.Key, Items = group.ToList() }) .ToList(); desiesTypeResult.Years = new List <int?>(); if (x.diseaseType != 0) { desiesTypeResult.DiseaseType = x.diseaseType; desiesTypeResult.DesiesName = disease.Where(c => c.Id == x.diseaseType).FirstOrDefault().DiseaseType; } desiesTypeResult.YearList = new List <YearList>(); foreach (var it in listYear) { desiesTypeResult.Years.Add(it.AddedYear); var yearList = new YearList(); yearList.Year = it.AddedYear; var listMonth = it.Items.Select(xxp => xxp).ToList().GroupBy(ppp => ppp.AddedMonth). Select(group => new { AddedMonth = group.Key, Items = group.ToList() }) .ToList(); yearList.Month = new List <int?>(); yearList.MonthList = new List <MonthList>(); foreach (var mo in listMonth) { yearList.Month.Add(mo.AddedMonth); var monthList = new MonthList(); monthList.Month = mo.AddedMonth; yearList.MonthList.Add(monthList); //MonthList // To get Files details monthList.FileList = new List <FileName>(); foreach (var file in mo.Items) { var fileName = new FileName(); fileName.DocName = file.FilePath; fileName.HospitalId = file.HospitalId; fileName.Id = file.Id; //baseURL/ClientDocument/ClientId/DesiseType/Year/Month/Files.jpg fileName.DocUrl = host + "ClientDocument/" + clientId + "/" + desiesTypeResult.DiseaseType + "/" + it.AddedYear + "/" + mo.AddedMonth + "/" + file.FilePath; monthList.FileList.Add(fileName); } } desiesTypeResult.YearList.Add(yearList); } desiesTypeResultList.Add(desiesTypeResult); } return(Request.CreateResponse(HttpStatusCode.Accepted, desiesTypeResultList)); }