public App() { // The root page of your application var toDoPage = new ToDoView(); MainPage = new NavigationPage(toDoPage); }
public IActionResult Create(ToDoView item) //kreiranje novog itema( podeljeno na kontroler,service, repos) { var pom = _mapper.Map <ToDoModel>(item); var res = _toDoService.Add(pom); return(CreatedAtRoute("GetTodo", new { id = item.Id }, item)); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IToDoModel model = new ToDoModel(); ToDoView view = new ToDoView(); ToDoPresenter presenter = new ToDoPresenter(model, view); Application.Run(view); }
public ActionResult Index(int?kanryoToDoId, int?returnToDoId) { // 完了 m.EndToDo(kanryoToDoId); // 未完了に戻す m.ReturnToDo(returnToDoId); ToDoView view = new ToDoView(); // 未完了ToDo取得 view.MikanryoToDo = m.GetToDoList(); // 完了ToDo取得(7日前に完了したものまで) view.KanryoToDo = m.GetKanryoToDoList(DateTime.Now.AddDays(-7)); return(View(view)); }
public App() { var toDoPage = new ToDoView(); MainPage = new NavigationPage(toDoPage); }
public JsonResult ToDo_AttachFile(Guid ToDoID, string AttacmentName, HttpPostedFileBase file) { GeneralResponse response = new GeneralResponse(); ToDoView toDoView = _toDoService.GetToDo(ToDoID).data; if (toDoView.Attachment != null) { response.ErrorMessages.Add("برای این مورد قبلا یک فایل ذخیره شده است. برای افزودن فایل جدید ابتدا فایل قبلی را حذف کنید"); return(Json(response, JsonRequestBehavior.AllowGet)); } string fileName = string.Empty; string path = string.Empty; try { #region Upload file // Verify that the user selected a file if (file != null && file.ContentLength > 0) { // extract the extention var fileExtention = Path.GetExtension(file.FileName); // create filename //string fileName = response.ID + "." + fileExtention; // fileName = Path.GetFileName(file.FileName); // Create a unique file name fileName = "ToDo_" + ToDoID + fileExtention; // Gettin current Year and Month PersianCalendar pc = new PersianCalendar(); int year = pc.GetYear(DateTime.Now); int month = pc.GetMonth(DateTime.Now); // Create File Path path = Path.Combine(Server.MapPath("~/data/ToDoFiles"), fileName); // Create reqired directried if not exist new FileInfo(path).Directory.Create(); // Uploading using (var fs = new FileStream(path, FileMode.Create)) { var buffer = new byte[file.InputStream.Length]; file.InputStream.Read(buffer, 0, buffer.Length); fs.Write(buffer, 0, buffer.Length); } } #endregion } catch (Exception ex) { //response.success = false; response.ErrorMessages.Add("در آپلود کردن فایل خطایی به وجود آمده است."); return(Json(response, JsonRequestBehavior.AllowGet)); } AddToDoAttachmentRequest request = new AddToDoAttachmentRequest(); request.ToDoID = ToDoID; request.Attachment = path; request.AttachmentName = AttacmentName; response = _toDoService.AddToDoAttachment(request, GetEmployee().ID); return(Json(response, JsonRequestBehavior.AllowGet)); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISeedData seedData) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseSignalR((cfg) => { cfg.MapHub <NotificationHub>("/notifications"); }); app.UseMvc(routes => routes.MapRoute( name: "WebAPI", template: "api/{controller}/{action}/{id?}" ) //.MapRoute( // name: "WebAPIForYear", // template: "api/foryear/{year:int}/{controller}/{action}/{id?}" //) ); seedData.SeedCompanyData(); seedData.SeedUserData(); //var tmp1 = UnitOfWork.ContoShemeOptions; //seedData.PopulateData(); // Create views BankView.CreateView(); BusinessPartnerBankView.CreateView(); BusinessPartnerByConstructionSiteView.CreateView(); BusinessPartnerInstitutionView.CreateView(); BusinessPartnerLocationView.CreateView(); BusinessPartnerDocumentView.CreateView(); BusinessPartnerNoteView.CreateView(); BusinessPartnerOrganizationUnitView.CreateView(); BusinessPartnerPhoneView.CreateView(); BusinessPartnerView.CreateView(); BusinessPartnerTypeView.CreateView(); //CompanyView.CreateView(); //??? //UserView.CreateView(); InputInvoiceView.CreateView(); InputInvoiceNoteView.CreateView(); InputInvoiceDocumentView.CreateView(); OutputInvoiceDocumentView.CreateView(); OutputInvoiceView.CreateView(); OutputInvoiceNoteView.CreateView(); CountryView.CreateView(); RegionView.CreateView(); MunicipalityView.CreateView(); CityView.CreateView(); ProfessionView.CreateView(); SectorView.CreateView(); AgencyView.CreateView(); TaxAdministrationView.CreateView(); ToDoView.CreateView(); EmployeeByBusinessPartnerView.CreateView(); EmployeeByConstructionSiteView.CreateView(); EmployeeCardView.CreateView(); EmployeeView.CreateView(); EmployeeDocumentView.CreateView(); EmployeeItemView.CreateView(); EmployeeLicenceView.CreateView(); EmployeeNoteView.CreateView(); EmployeeProfessionView.CreateView(); FamilyMemberView.CreateView(); LicenceTypeView.CreateView(); PhysicalPersonView.CreateView(); PhysicalPersonItemView.CreateView(); PhysicalPersonNoteView.CreateView(); PhysicalPersonLicenceView.CreateView(); PhysicalPersonDocumentView.CreateView(); PhysicalPersonCardView.CreateView(); PhysicalPersonProfessionView.CreateView(); ConstructionSiteCalculationView.CreateView(); ConstructionSiteDocumentView.CreateView(); ConstructionSiteNoteView.CreateView(); ConstructionSiteView.CreateView(); VatView.CreateView(); ServiceDeliveryView.CreateView(); DiscountView.CreateView(); StatusView.CreateView(); ShipmentView.CreateView(); ShipmentDocumentView.CreateView(); PhonebookView.CreateView(); PhonebookDocumentView.CreateView(); PhonebookNoteView.CreateView(); PhonebookPhoneView.CreateView(); InvoiceView.CreateView(); InvoiceItemView.CreateView(); CallCentarView.CreateView(); CalendarAssignmentView.CreateView(); EmployeeAttachmentView.CreateView(); PhysicalPersonAttachmentView.CreateView(); ToDoStatusView.CreateView(); var mailingTime = new Config().GetConfiguration()["MailTime"]; Console.WriteLine("Sending mails scheduled at: {0}\nCurrent time: {1}", mailingTime, DateTime.Now.ToString("HH:mm:ss")); Thread mailThread = new Thread(() => MailTask.SendMailTime(mailingTime)); mailThread.IsBackground = true; mailThread.Start(); }