private void ScanForServer() { //Mouse.OverrideCursor = Cursors.Wait; try { IsScanForServerEnabled = false; IsProgressBarVisible = true; List <string> servers = WCFProxy.DiscoverHosts(); ExecuteOnUIThread.Invoke(() => { Servers.Clear(); if (servers == null || !servers.Any()) { Servers.Add("No server found"); } else { foreach (string s in servers) { Servers.Add(s); } } }); } catch { ExecuteOnUIThread.Invoke(() => Servers.Add("Error while scanning")); } finally { IsProgressBarVisible = false; IsScanForServerEnabled = true; //Mouse.OverrideCursor = null; } }
public override void Load() { Bind < IAnswerService().ToConstant(WCFProxy <IAnswerService> .CreateChannel()); Bind < IAnswerTypeService().ToConstant(WCFProxy <IAnswerTypeService> .CreateChannel()); Bind < IBrandService().ToConstant(WCFProxy <IBrandService> .CreateChannel()); Bind < IBuyService().ToConstant(WCFProxy <IBuyService> .CreateChannel()); Bind < IBuyStateService().ToConstant(WCFProxy <IBuyStateService> .CreateChannel()); Bind < ICampaignService().ToConstant(WCFProxy <ICampaignService> .CreateChannel()); Bind < ICategoryService().ToConstant(WCFProxy <ICategoryService> .CreateChannel()); Bind < ICityService().ToConstant(WCFProxy <ICityService> .CreateChannel()); Bind < ICustomerService().ToConstant(WCFProxy <ICustomerService> .CreateChannel()); Bind < IGiftService().ToConstant(WCFProxy <IGiftService> .CreateChannel()); Bind < IGN_ReportService().ToConstant(WCFProxy <IGN_ReportService> .CreateChannel()); Bind < IKnowledgeTestService().ToConstant(WCFProxy <IKnowledgeTestService> .CreateChannel()); Bind < ILanguageService().ToConstant(WCFProxy <ILanguageService> .CreateChannel()); Bind < ILanguageWordService().ToConstant(WCFProxy <ILanguageWordService> .CreateChannel()); Bind < IMyNewService().ToConstant(WCFProxy <IMyNewService> .CreateChannel()); Bind < IMyProductService().ToConstant(WCFProxy <IMyProductService> .CreateChannel()); Bind < INewsTypeService().ToConstant(WCFProxy <INewsTypeService> .CreateChannel()); Bind < IProductService().ToConstant(WCFProxy <IProductService> .CreateChannel()); Bind < IRelationalPersonService().ToConstant(WCFProxy <IRelationalPersonService> .CreateChannel()); Bind < IRoleService().ToConstant(WCFProxy <IRoleService> .CreateChannel()); Bind < ISaleService().ToConstant(WCFProxy <ISaleService> .CreateChannel()); Bind < IScoreService().ToConstant(WCFProxy <IScoreService> .CreateChannel()); Bind < IScoreTypeService().ToConstant(WCFProxy <IScoreTypeService> .CreateChannel()); Bind < ISellerService().ToConstant(WCFProxy <ISellerService> .CreateChannel()); Bind < IUnitTypeService().ToConstant(WCFProxy <IUnitTypeService> .CreateChannel()); Bind < IUserService().ToConstant(WCFProxy <IUserService> .CreateChannel()); Bind < IUserRoleService().ToConstant(WCFProxy <IUserRoleService> .CreateChannel()); Bind < IUserTypeService().ToConstant(WCFProxy <IUserTypeService> .CreateChannel()); }
// GET: Dashboard public ActionResult Index() { DashboardDto dashboard = new DashboardDto(); WCFProxy.Using((delegate(IDashboardService client) { dashboard = client.getDashboard(); })); return(View(dashboard)); }
public ActionResult SubmitEvent(EventsDto eventDto) { MessageDTO message = new MessageDTO(); WCFProxy.Using((delegate(IEventsAndNewsService client) { message = client.addUpdateEvents(eventDto); })); return(Json(message.message, JsonRequestBehavior.AllowGet)); }
public ActionResult TodayAttendance() { List <ClassAttendanceDto> classAttendance = new List <ClassAttendanceDto>(); WCFProxy.Using((delegate(IAttendanceService client) { classAttendance = client.getClassAttendence(0, 0); })); return(View(classAttendance)); }
public ActionResult SubmitHoliday(HolidaysDto holiday) { MessageDTO message = new MessageDTO(); WCFProxy.Using((delegate(IClassSetupService client) { message = client.addUpdateHolidayDetail(holiday); })); return(Json(message.message, JsonRequestBehavior.AllowGet)); }
public ActionResult SubmitExamTimeTable(ExamTimeTableDto examTimeTable) { MessageDTO message = new MessageDTO(); WCFProxy.Using((delegate(IClassSetupService client) { message = client.addUpdateExamTimeTable(examTimeTable); })); return(Json(message.message, JsonRequestBehavior.AllowGet)); }
public ActionResult SubmitStudent(StudentDto student) { MessageDTO message = new MessageDTO(); WCFProxy.Using((delegate(IClassSetupService client) { message = client.addUpdateStudentDetail(student); })); return(Json(message.message, JsonRequestBehavior.AllowGet)); }
public ActionResult SubmitDivision(ClassRoomDto divisions) { MessageDTO message = new MessageDTO(); WCFProxy.Using((delegate(IClassSetupService client) { message = client.addUpdateStandrdDivision(divisions); })); return(Json(message.message, JsonRequestBehavior.AllowGet)); }
public ActionResult ExamTimeTable() { Pagination paginateModel = new Pagination() { PageNumber = 1, PageSize = 500, Skip = 0, SortColumn = "", TotalCount = 0 }; ClassRoomCollection classRoomsCollection = new ClassRoomCollection(); WCFProxy.Using((delegate(IClassSetupService client) { classRoomsCollection = client.getStandardDivision(null, null, 1, paginateModel); })); ViewBag.SchoolId = 1; ViewBag.ClassList = classRoomsCollection.ClassRoom; ExamTimeTableDto examTimeTableDto = new ExamTimeTableDto(); return(View(examTimeTableDto)); }
private void button1_Click(object sender, EventArgs e) { int totalInt = 20000; progressBar1.Maximum = totalInt; //const string filepath = @"D:\"; //const string filename = @"logfile.txt"; //FileInfo fInfo = new FileInfo(filepath + filename); //if (!fInfo.Exists) // fInfo.Create().Close(); //StreamWriter w = fInfo.AppendText(); //w.WriteLine("Start."); //w.Flush(); //w.Close(); label1.Text = "Start: " + DateTime.Now.ToString(); for (int i = 1; i <= totalInt; i++) { WCFProxy proxy = new WCFProxy(); try { proxy.Add("tester: " + i.ToString(), "Work: " + i.ToString()); //StreamWriter ww = fInfo.AppendText(); //ww.WriteLine("Added: " + i.ToString() + " " + DateTime.Now.ToLongTimeString()); //ww.Flush(); //ww.Close(); } catch (Exception ex) { //StreamWriter ww = fInfo.AppendText(); //ww.WriteLine("Exception: "); //ww.WriteLine("for: " + i.ToString()); //ww.WriteLine("DateTime: " + DateTime.Now.ToString()); //ww.WriteLine("Context: " + ex.Message); //ww.Flush(); //ww.Close(); } finally { progressBar1.Value += 1; //proxy.Close(); } } label2.Text = "End: " + DateTime.Now.ToString(); }
public JsonResult GetEvents(DataTableAjaxPostModel model) { Pagination paginateModel = model.ToPagination(); int recordsTotal = 0; List <EventsDto> eventsCollection = new List <EventsDto>(); WCFProxy.Using((delegate(IEventsAndNewsService client) { eventsCollection = client.getEvents(1, paginateModel, out recordsTotal); })); return(Json(new { // this is what datatables wants sending back draw = model.draw, recordsTotal = recordsTotal, recordsFiltered = recordsTotal, data = eventsCollection }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetStudents(DataTableAjaxPostModel model) { Pagination paginateModel = model.ToPagination(); int recordsTotal = 0; StudentCollection studentCollection = new StudentCollection(); WCFProxy.Using((delegate(IClassSetupService client) { studentCollection = client.getStudent(1, 1, paginateModel); })); recordsTotal = studentCollection.TotalCount; var data = studentCollection.StudentList.Skip(paginateModel.Skip).Take(paginateModel.PageSize).ToList(); return(Json(new { // this is what datatables wants sending back draw = model.draw, recordsTotal = recordsTotal, recordsFiltered = recordsTotal, data = data }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetHolidays(DataTableAjaxPostModel model) { Pagination paginateModel = model.ToPagination(); int recordsTotal = 0; List <HolidaysDto> holidaysList = new List <HolidaysDto>(); WCFProxy.Using((delegate(IClassSetupService client) { holidaysList = client.getHolidayDetail(1); })); recordsTotal = holidaysList.Count(); var data = holidaysList.Skip(paginateModel.Skip).Take(paginateModel.PageSize).ToList(); return(Json(new { // this is what datatables wants sending back draw = model.draw, recordsTotal = recordsTotal, recordsFiltered = recordsTotal, data = data }, JsonRequestBehavior.AllowGet)); }
public WCFAdapter(WCFProxy<IWCFProtocol> protocol, Func<IServiceBus> serviceBus, DelegateManager manager) { this.protocol = protocol; this.serviceBus = serviceBus; this.manager = manager; }
protected void Page_Load(object sender, EventArgs e) { WCFProxy proxy=new WCFProxy(); var temp = proxy.GetAllToJson(); Response.Write(""); }