public DetailType GetById(int id) { DetailType detail = null; using (SqlConnection connection = new SqlConnection(_connectionString)) { SqlCommand command = new SqlCommand("spDetailTypes_GetById", connection); command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@id", id)); try { connection.Open(); SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { detail = MapToDetailType(reader); } } connection.Close(); return(detail); } catch (Exception ex) { Console.WriteLine(ex.Message); return(null); } } }
public DetailBook() { InitializeComponent(); detailType = DetailType.Add; Loaded += DetailBook_Loaded; IsExcelData = false; }
public async Task <IActionResult> PutDetailType(Guid key, DetailType detailType) { if (key != detailType.DetailTypeKey) { return(BadRequest()); } _dbContext.Entry(detailType).State = EntityState.Modified; try { await _dbContext.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DetailTypeExists(key)) { return(NotFound()); } else { throw; } } return(NoContent()); }
/// <summary> /// 加载详情数据(公司、部门、个人) /// </summary> public void InitDetails(DetailType type, object obj, List <AntSdkContact_User> contactUsers = null) { _type = type; _info = obj; _groupInfoViewModel = null; if (contactUsers != null) { _contactUsers = contactUsers; } switch (type) { case DetailType.Company: CompanyDetail(_info); break; case DetailType.Department: DepartmentDetail(_info); break; case DetailType.Personal: PersonalDetail(_info); break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public void RetrieveDetailData(DetailType detailType, Int64 id, Action <string> callback, Action <string> errorCallback) { if (_NetworkOnline(errorCallback)) { StartCoroutine(_networkManager.RetrieveDetailData(detailType, id, callback, errorCallback)); } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { /* * 因为所有的 文章详情都是 httpGet 操作,所以传递的 e.uri 我们拆分出 uri 就可以获取数据了 * 当然还需要 type 参数代表文章的类型 这个用于 xml 反序列化的结果分析 */ if (this.NavigationContext.QueryString.ContainsKey("id") && this.NavigationContext.QueryString.ContainsKey("type")) { this.DetailType = ( DetailType )this.NavigationContext.QueryString["type"].ToInt32( ); //如果是软件类型 则去除掉一些东西 if (this.DetailType == Model.AppOnly.DetailType.Software) { this.LayoutRoot.Children.Remove(this.pivot); this.browser = new WebBrowser( ) { Height = 772, VerticalAlignment = System.Windows.VerticalAlignment.Top }; this.LayoutRoot.Children.Add(this.browser); } string url = this.GetDetailUrl(this.NavigationContext.QueryString["id"], this.DetailType); url = string.Format("{0}&guid={1}", url, Guid.NewGuid( ).ToString( )); //下载文章 this.DownloadDocument(url); //下载评论列表 this.DownloadComments(this.NavigationContext.QueryString["id"].ToInt32( )); //显示标题 this.DisplayPivotItem( ); } base.OnNavigatedTo(e); }
private bool MakeContact(DetailType type, int index = 0) { detailObject = contactDetailPool.Get(true); if (detailObject == null) { Debug.LogError("Couldnt Get GameObject from Pool, check refrence"); return(false); } activeObjects.Add(detailObject); cDetail = detailObject.GetComponent <ContactDetail>(); cDetail.onButtonClick = SetDetailDelete; //cheap trick for now if (cDetail != null) { if (cDetail.SetContactDetail(contact, type, index) == false) { detailObject.SetActive(false); // so we wouldnt have empty spaces, chances of getting a false is dim if not sent correctly } } else { Debug.LogError("Couldnt Get ContactDetail from Pool, check refrence"); return(false); } return(true); }
private void btnSave_Click(object sender, RoutedEventArgs e) { DiagnosisDetails(); if (ControlProblems()) { if (detailType == DetailType.Add) { studentManager.Add(student); notification.shownot("Ekleme işlemi başarılı"); } else if (detailType == DetailType.Edit && IsExcelData == true) { studentManager.Add(student); notification.shownot("Ekleme işlemi başarılı"); ContinueLoads(); } else if (detailType == DetailType.Edit) { studentManager.Update(student); notification.shownot(student.StudentName + "güncelleme işlemi başarılı"); } detailType = DetailType.Edit; student.Identity = studentManager.LastId; ChangesDetection(); } }
public async Task <ActionResult <DetailType> > PostDetailType(DetailType detailType) { _dbContext.DetailType.Add(detailType); await _dbContext.SaveChangesAsync(); return(CreatedAtAction("GetDetailType", new { key = detailType.DetailTypeKey }, detailType)); }
public DetailStudent(Student student) { InitializeComponent(); detailType = DetailType.Edit; this.student = student; Loaded += DetailStudent_Loaded; }
/// <summary> /// Retrieve the detail information from the id for any anonymous call /// </summary> /// <param name="objectId">Object identifier. This can be for any anonymous object detail id</param> /// <param name="callback">Raw JSON string retrieved from the call. This can be applied to a parser</param> public IEnumerator RetrieveDetailData(DetailType detailType, Int64 objectId, Action <string> callback, Action <string> errorCallback) { string parseDetailType = Enum.GetName(typeof(DetailType), detailType); string url = CHOOSE_HEALTHIER_URI + "db/" + parseDetailType + "/" + objectId; yield return(StartCoroutine(_PerformRequest <string>(url, null, callback, errorCallback))); }
public string CreateMessage(InquiryType inquiryType, DetailType detailType, string cprNumber) { return(string.Format("{0}{1}{2}", (int)inquiryType, (int)detailType, cprNumber )); }
private static DetailType UpdateEntity(DetailType entity, DetailTypeUpdateModel model) { entity.Code = model.Code; entity.DetailStartText = model.DetailStartText; entity.DetailEndText = model.DetailEndText; return(entity); }
public GrabDetail(int id, string displayName, string grabName, DetailType type, GrabberUrlClass.Grabber_Output outputmapping) { Id = id; DisplayName = displayName; GrabName = grabName; Type = type; OutputMapping = outputmapping; }
public DetailBook(Book book) { InitializeComponent(); this.book = book; detailType = DetailType.Edit; Loaded += DetailBook_Loaded; IsExcelData = false; }
public DetailStudent(bool IsExcelData, List <Student> students) { this.IsExcelData = IsExcelData; InitializeComponent(); detailType = DetailType.Edit; this.students = students; Loaded += DetailStudent_Loaded; student = students.FirstOrDefault(i => i.Identity == rowNumber); }
public void DisplayDetailsByType(DetailType type) { Console.WriteLine($"{type}:"); foreach (var item in Controller.GetDetailByType(type)) { Console.WriteLine(item); } Console.WriteLine(); }
public void Update(DetailTypeModel model) { var detailType = new DetailType { Type = model.Type }; detailTypeRepository.Update(detailType); }
public void Delete(DetailType type, long dataId) { var data = _detailRepository.GetAll().FirstOrDefault(t => t.Type == type && t.DataId == dataId); if (data != null) { _detailRepository.Delete(data); } }
public Detail(int xid, DetailType dt) : base() { InitializeComponent(); if (dt == DetailType.Movie) { type = DetailType.Movie; movie = Movie.LoadById(xid); person = null; if (movie.VideoFile != null && movie.VideoFile != "") { btnPlay.Visible = true; } else { btnPlay.Visible = false; } InitMovieDetails(); ResetPeople(); directors = Director.LoadByMovie(movie.MovieId); actors = Actor.LoadByMovie(movie.MovieId); InitPeopleList(); SetPageValues(); InitPeopleScreen(); } else if (dt == DetailType.Person) { btnPlay.Visible = false; type = DetailType.Person; person = Person.LoadById(xid); movie = null; InitPersonDetails(); ResetMovies(); moviesAct = Actor.LoadMoviesByPersonId(xid); moviesDir = Director.LoadMoviesByPersonId(xid); InitMovieList(); SetPageValues(); InitMovieScreen(); } }
internal Detail(Dictionary <int, DetailOperation> stages, string name) { Type = DetailType.Custom; Stages = stages; Name = name; Id = IdGenerator.GetId(); Log = new List <string>(); Marker = 1; }
public CDetail(DetailData data) { title = data.title; sprite = data.sprite; type = data.type; mass = data.mass; speed = data.speed; fuelCap = data.fuelCap; fuelCons = data.fuelCons; }
public static DetailTypeReadModel ToReadModel(this DetailType entity) { return(new DetailTypeReadModel { Id = entity.Id, Code = entity.Code, DetailStartText = entity.DetailStartText, DetailEndText = entity.DetailEndText }); }
public DetailBook(bool IsExcelData, List <Book> books) { Books = books; detailType = DetailType.Edit; this.IsExcelData = IsExcelData; InitializeComponent(); Loaded += DetailBook_Loaded; book = Books.FirstOrDefault(i => i.Identity == rowNumber); }
public Detail() { type = DetailType.Null; movie = null; directors = null; actors = null; detailNum = 0; pageNum = 0; }
public string Get(DetailType type, long dataId) { var data = _detailRepository.GetAll().FirstOrDefault(t => t.Type == type && t.DataId == dataId); if (data == null) { return(""); } else { return(data.Content); } }
public clsRunDetail(string name, DetailType detailType, Control control, bool usesP = false, CheckBox cbPeilDatumNull = null) { this._name = name; this._runDetailType = detailType; this._control = control; this._usesP = usesP; this._cbPeilDatumNull = cbPeilDatumNull; // Register OnCheckedChanged event if (cbPeilDatumNull != null) { cbPeilDatumNull.CheckedChanged += new System.EventHandler(this.cbCheckedChanged); } }
private void InitDetailOne() { Name = "Деталь 1"; Type = DetailType.One; Stages = new Dictionary <int, DetailOperation> { { 1, DetailOperation.Lathe }, { 2, DetailOperation.Milling }, { 3, DetailOperation.Bending }, { 4, DetailOperation.Drilling }, { 5, DetailOperation.Grinding }, { 6, DetailOperation.Washing }, { 7, DetailOperation.Drying } }; }
public Bookmark(string url, string title, string createdBy, BookmarkContentType contentType = BookmarkContentType.Website, DetailType detailType = DetailType.Simple, Identifier identifier = Identifier.Auto, string id = default) { _images = _images ?? new List <Image> (); this.Id = (string.IsNullOrEmpty(id) && identifier == Identifier.New) ? ObjectId.GenerateNewId().ToString() : id; Url = url; Title = title; ContentType = contentType; DetailType = detailType; IsDeleted = false; CreatedBy = createdBy; CreatedDate = DateTime.UtcNow; }
public void Create(DetailTypeModel model) { var detailType = new DetailType { Type = model.Type, Details = model.Details?.Select(x => new Detail { Price = x.Price, CarId = x.CarId, ManufacturerId = x.ManufacturerId, TypeId = x.TypeId }).ToList() }; detailTypeRepository.Create(detailType); }
/// <summary> /// The method throws an Exception of type <see cref="TException" /> if the Fiel is not valid. /// </summary> /// <typeparam name="TType"> /// Type of the argument. /// </typeparam> /// <typeparam name="TException"> /// Type of the exception that will be thrown. /// </typeparam> /// <param name="validator"> /// Validator that perfmorms the validation. /// </param> /// <param name="detailType"> /// Enum that defines witch detail is under evaluation. /// </param> /// <param name="country"> /// Country to perform the validation. /// </param> /// <param name="field"> /// Field to validate. /// </param> /// <param name="fieldName"> /// Name of the field to validate. /// </param> /// <exception> /// If the Field is not valid, an Exception of type <see cref="TException" /> will be thrown. /// </exception> protected static void CheckIsValidArgument <TType, TException>( IDetailValidator validator, DetailType detailType, ICountry country, string field, string fieldName) where TException : InvalidBbanDetailException { if (!validator.IsValid(country, field)) { throw (TException)Activator.CreateInstance( typeof(TException), detailType, string.Format( "Parameter '{0}' of type '{1}' is not valid.", detailType, typeof(TType).Name)); } }
public static Task GetDetails(Crash crash, DetailType dtype, CsvFileWriter writer) { Console.Write("\tProcessing crash #{0} ", crash.id); string url = "https://rink.hockeyapp.net/api/2/apps/{0}/crashes/{1}?format={2}"; url = string.Format(url, Constants.AppId, crash.id, dtype.ToString()); var details = WebHelper.Json<string>(url); return details.ContinueWith(t => { Console.WriteLine("Writing row"); string error = string.Empty; Regex re = new Regex(@"Application Specific Information:\n(.+)",RegexOptions.Multiline); MatchCollection mc = re.Matches(t.Result); if (mc.Count > 0) { error = mc[0].Groups[1].Value; } string stack = string.Empty; Regex re2 = new Regex(@"\n[0-9]+\s+CalorieCount\s+(.+)",RegexOptions.Multiline); MatchCollection mc2 = re2.Matches(t.Result); if (mc2.Count > 0) { foreach(Match match in mc2) { stack += match.Groups[1].Value + Environment.NewLine; } } string[] values = { crash.id.ToString(), crash.created_at, crash.bundle_short_version, crash.bundle_version, crash.jail_break.ToString(), crash.model, crash.os_version, crash.oem, crash.user_string, error, stack }; writer.WriteRow(values); }); }
public async Task<ReadingList> GetReadingList(ListState state = ListState.Unread, bool onlyFavorites = false, string tagname = "", ContentType content = ContentType.All, SortOn sort = SortOn.Newest, DetailType detail = DetailType.Simple) { List<Param> parameters = new List<Param>(); parameters.Add(new Param("state",state.ToString().ToLower())); parameters.Add(new Param("favorite", onlyFavorites ? "1" : "0")); if (tagname != "") { parameters.Add(new Param("tag", tagname)); } if (content != ContentType.All) { parameters.Add(new Param("contentType", content.ToString().ToLower())); } parameters.Add(new Param("sort", sort.ToString().ToLower())); parameters.Add(new Param("detailType", detail.ToString().ToLower())); IRestResponse resp = await HandleRequest("get.php", Call.POST, parameters); var regexd = Regex.Replace(Regex.Replace(resp.Content, @"""\d+"":", "").Replace("\"list\":{", "\"list\":[").Replace("}},\"error\"", "}],\"error\""), "{{(([^{}]|{[^{}]+}|)+)}(([^{}]|{[^{}]+}|)+)}", "[{$1}$3]"); return JsonConvert.DeserializeObject<ReadingList>(regexd); }
public GrabItem(int number, string displayName, string grabName, DetailType type, Grabber_Output outputmapping) { Number = number; DisplayName = displayName; GrabName = grabName; Type = type; OutputMapping = outputmapping; }
/// <summary> /// 跳转到文章详情页 /// </summary> /// <param name="id">文章详情ID</param> /// <param name="detailType">文章详情类型</param> public static void ToDetailPage( string id, DetailType detailType ) { //Tool. To( string. Format( "/DetailPage.xaml?id={0}&type={1}", id, ( int ) detailType ) ); Tool. To( string. Format( "/DetailPage2.xaml?id={0}&type={1}", id, ( int ) detailType ) ); }
private string GetDetailUrl(string id, DetailType type) { switch ( type ) { case DetailType. News: return string. Format( "{0}?id={1}", Config. api_news_detail, id ); case DetailType. Post: return string. Format( "{0}?id={1}", Config. api_post_detail, id ); case DetailType. Blog: return string. Format( "{0}?id={1}", Config. api_blog_detail, id ); case DetailType. Software: return string. Format( "{0}?ident={1}", Config. api_software_detail, id ); case DetailType. Tweet: return string. Format( "{0}?id={1}", Config. api_tweet_detail, id ); } return null; }
protected override void OnNavigatedTo(System. Windows. Navigation. NavigationEventArgs e) { /* * 因为所有的 文章详情都是 httpGet 操作,所以传递的 e.uri 我们拆分出 uri 就可以获取数据了 * 当然还需要 type 参数代表文章的类型 这个用于 xml 反序列化的结果分析 */ if ( this. NavigationContext. QueryString. ContainsKey( "id" ) && this. NavigationContext. QueryString. ContainsKey( "type" ) ) { this. DetailType = ( DetailType ) this. NavigationContext. QueryString[ "type" ]. ToInt32( ); //如果是软件类型 则去除掉一些东西 if ( this. DetailType == Model. AppOnly. DetailType. Software ) { this. LayoutRoot. Children. Remove( this. pivot ); this. browser = new WebBrowser( ) { Height = 772, VerticalAlignment = System. Windows. VerticalAlignment. Top }; this. LayoutRoot. Children. Add( this. browser ); } string url = this. GetDetailUrl( this. NavigationContext. QueryString[ "id" ], this. DetailType ); url = string. Format( "{0}&guid={1}", url, Guid. NewGuid( ). ToString( ) ); //下载文章 this. DownloadDocument( url ); //下载评论列表 this. DownloadComments( this. NavigationContext. QueryString[ "id" ]. ToInt32( ) ); //显示标题 this. DisplayPivotItem( ); } base. OnNavigatedTo( e ); }