private void SetForm(string id) { using (TextbookApplClient client = new TextbookApplClient()) { //取教材 var view = client.GetById(id); var isSelf = false; bool.TryParse(view.IsSelfCompile, out isSelf); //设置教材信息 clblTextbookId.Text = view.TextbookId; //教材ID ctxtTextbookName.Text = view.Name; //教材名称 ctxtISBN.Text = view.Isbn; //isbn ctxtRetailPrice.Text = view.Price.ToString(); //零售价 ctxtAuthor.Text = view.Author; //作者 ccmbPress.SelectedValue = view.PressId; //出版社 ctxtPressAddress.Text = view.PressAddress; //出版社地址 ctxtEdition.Text = view.Edition; //版本 ctxtPrintingCount.Text = view.PrintCount; //版次 ctxtPage.Text = view.PageCount; //页数 ctxtType.Text = view.TextbookType; //教材类型 chkIsSelfCompile.Checked = isSelf; //自编 ctxtPublishDate.SelectedDate = view.PublishDate; //出版日期 } }
/// <summary> /// 设置表单信息 /// </summary> /// <param name="id">教材ID</param> private void SetForm(string id) { using (TextbookApplClient client = new TextbookApplClient()) { //取教材 var view = client.GetById(id); //设置教材信息 clblTextbookId.Text = view.TextbookId; //教材ID ctxtTextbookNum.Text = view.Num; //教材编号 ctxtTextbookName.Text = view.Name; //教材名称 ctxtISBN.Text = view.Isbn; //isbn ctxtRetailPrice.Text = view.Price.ToString(); //零售价 ctxtAuthor.Text = view.Author; //作者 ctxtPress.Text = view.Press; //出版社 ctxtPressAddress.Text = view.PressAddress;//出版社地址 ctxtEdition.Text = view.Edition; //版本 ctxtPrintingCount.Text = view.PrintCount; //版次 ctxtPage.Text = view.PageCount; //页数 ctxtType.Text = view.TextbookType; //教材类型 ctxtIsSelfCompile.Text = view.IsSelfCompile;//自编 ctxtPublishDate.Text = view.PublishDate.ToLongDateString(); //出版日期 } }
/// <summary> /// 设置表单信息 /// </summary> /// <param name="id">教材ID</param> private void SetForm(string id) { using (TextbookApplClient client = new TextbookApplClient()) { //取教材 var view = client.GetById(id); //设置教材信息 clblTextbookId.Text = view.TextbookId; //教材ID ctxtTextbookNum.Text = view.Num; //教材编号 ctxtTextbookName.Text = view.Name; //教材名称 ctxtISBN.Text = view.Isbn; //isbn ctxtRetailPrice.Text = view.Price.ToString(); //零售价 ctxtAuthor.Text = view.Author; //作者 ctxtPress.Text = view.Press; //出版社 ctxtPressAddress.Text = view.PressAddress; //出版社地址 ctxtEdition.Text = view.Edition; //版本 ctxtPrintingCount.Text = view.PrintCount; //版次 ctxtPage.Text = view.PageCount; //页数 ctxtType.Text = view.TextbookType; //教材类型 ctxtIsSelfCompile.Text = view.IsSelfCompile; //自编 ctxtPublishDate.Text = view.PublishDate.ToLongDateString(); //出版日期 } }
private void SetForm(string id) { using (TextbookApplClient client = new TextbookApplClient()) { //取教材 var view = client.GetById(id); var isSelf = false; bool.TryParse(view.IsSelfCompile, out isSelf); //设置教材信息 clblTextbookId.Text = view.TextbookId; //教材ID ctxtTextbookName.Text = view.Name; //教材名称 ctxtISBN.Text = view.Isbn; //isbn ctxtRetailPrice.Text = view.Price.ToString(); //零售价 ctxtAuthor.Text = view.Author; //作者 ccmbPress.SelectedValue = view.PressId; //出版社 ctxtPressAddress.Text = view.PressAddress;//出版社地址 ctxtEdition.Text = view.Edition; //版本 ctxtPrintingCount.Text = view.PrintCount; //版次 ctxtPage.Text = view.PageCount; //页数 ctxtType.Text = view.TextbookType; //教材类型 chkIsSelfCompile.Checked = isSelf;//自编 ctxtPublishDate.SelectedDate = view.PublishDate; //出版日期 } }