private void UcPartInfo1_SelectValueChange(object sender, object obj) { this.ucPartBody1.Clear(); Model.Tb_tmp_part info = obj as Model.Tb_tmp_part; this.ucPartBody1.SetDataSource(info); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!this.blNewFlag) { Model.Tb_tmp_part info = modelObj as Model.Tb_tmp_part; SetAccountInfo(info); } }
private void MDataGrid1_CurrentRowChanged(object sender, EventArgs e) { if (this.mDataGrid1.CurrentRow == null) { this.DoSelectValueEvent(null); return; } Model.Tb_tmp_part info = mDataGrid1.GetCurrentEntity() as Model.Tb_tmp_part; this.DoSelectValueEvent(info); }
private void BtnDelete_Click(object sender, EventArgs e) { if (mDataGrid1.CurrentRow == null) { return; } Model.Tb_tmp_part info = mDataGrid1.GetCurrentEntity() as Model.Tb_tmp_part; if (Miles.Framework.UI.Function.Dialog.ShowWarningYesNo("确定要删除:" + info.Part_Name + "信息?")) { if (manager.RemovePart(info)) { mDataGrid1.DeleteCurrentItem <Model.Info_tmp>(); } } }
private void BtnEdit_Click(object sender, EventArgs e) { if (this.mDataGrid1.CurrentRow == null) { this.DoSelectValueEvent(null); return; } Model.Tb_tmp_part info = mDataGrid1.GetCurrentEntity() as Model.Tb_tmp_part; FmPartInfo fm = new FmPartInfo(info); fm.Tag = this.Tag; fm.SelectValue += FmEdit_SelectValue; fm.ShowDialog(); }
public byte[] GetTmpClause(long tmp_Id) { Model.Tb_tmp_part part = Repository.Query() .From <Model.Tb_tmp_part>() .ToSelect() .EndSelect() .ToWhere() .And(Model.Tb_tmp_part.Table.Tmp_Id, tmp_Id) .And(Model.Tb_tmp_part.Table.Part_Seq, 3) .EndWhere() .ToQuery() .First <Model.Tb_tmp_part>(); return(part != null ? part.Part_File : null); }
protected override bool BtnOkClick() { if (string.IsNullOrEmpty(this.d_partName.Text)) { Miles.Framework.UI.Function.MForm.SetToolTip(this.d_partName, "名称不能为空", 1000); return(false); } if (string.IsNullOrEmpty(this.d_partExplain.Text)) { Miles.Framework.UI.Function.MForm.SetToolTip(this.d_partExplain, "说明不能为空", 1000); return(false); } if (d_partSeq.Value == 0) { Miles.Framework.UI.Function.MForm.SetToolTip(this.d_partSeq, "顺序不能为空", 1000); return(false); } Model.Tb_tmp_part info = this.GetDataBind <Model.Tb_tmp_part>(); if (this.blNewFlag) { info.Tmp_Id = (long)this.Tag; if (!manager.AddPartInfo(info)) { return(false); } } else { Model.Tb_tmp_part old = modelObj as Model.Tb_tmp_part; info.Part_Id = old.Part_Id; info.Tmp_Id = (long)this.Tag; if (!manager.UpdatePartInfo(info)) { return(false); } } this.DoSelectValueEvent(info); return(true); }
void btnSave_Click(object sender, EventArgs e) { Model.Tb_tmp_part info = dataSource as Model.Tb_tmp_part; if (streamBody == null || streamBody.Length < 1) { Miles.Framework.UI.Function.MForm.SetToolTip(this.mRichEditOnly1, "文本不能为空", 1000); return; } info.Part_File = streamBody.ToArray(); if (!tmpManager.SavePartBody(info)) { Miles.Framework.UI.Function.MForm.SetToolTip(this.btnSave.Owner, "保存失败", 500, Miles.Framework.UI.Function.MForm.ToolTipSite.FollowMouse); return; } Miles.Framework.UI.Function.MForm.SetToolTip(this.btnSave.Owner, "保存成功", 500, Miles.Framework.UI.Function.MForm.ToolTipSite.FollowMouse); this.DoSelectValueEvent(info); }
private void SetAccountInfo(Model.Tb_tmp_part info) { this.SetDataBind(info); }
public FmPartInfo(Model.Tb_tmp_part info) : base(info) { InitializeComponent(); }
public override void SetDataSource(object dataSource) { base.SetDataSource(dataSource); this.selectValue = dataSource; this.mRichEditOnly1.ResetText(); Model.Tb_tmp_part info = dataSource as Model.Tb_tmp_part; if (info == null) { return; } if (info.Part_File != null) { streamBody = Doc.DocBuilder.LoadCtrViewDoc(this.mRichEditOnly1, new MemoryStream(info.Part_File)); //streamBody = new MemoryStream(info.Part_File); //using (DocX document = DocX.Load(streamBody)) //{ // string filename = System.IO.Path.Combine("Report", "tmp.docx"); // document.SaveAs(filename); // this.richEditControl1.LoadDocument(filename); //} } else { string filename = System.IO.Path.Combine("Report", "init.docx"); if (File.Exists(filename)) { this.mRichEditOnly1.LoadDocument(filename); } //using (DocX document = DocX.Create(filename)) //{ // Miles.Coro.Common.Print.PrintPageInfo pageInfo = Miles.Coro.Common.Print.PrintConfigManager.GetPrintPageInfo(this.ReportName); // //按照设定好的页面大小来配置,可以做一个模板,读取 // document.PageWidth = Miles.Coro.Common.Print.PrintHelper.FromInchToPt(pageInfo.PageWidth); // document.PageHeight = Miles.Coro.Common.Print.PrintHelper.FromInchToPt(pageInfo.PageHeight); // document.PageLayout.Orientation =pageInfo.Landscape? Xceed.Words.NET.Orientation.Landscape:Xceed.Words.NET.Orientation.Portrait; // // Set the document margins. // document.MarginLeft = Miles.Coro.Common.Print.PrintHelper.FromInchToPt(pageInfo.MarginLeft); // document.MarginRight = Miles.Coro.Common.Print.PrintHelper.FromInchToPt(pageInfo.MarginRight); // document.MarginTop = Miles.Coro.Common.Print.PrintHelper.FromInchToPt(pageInfo.MarginTop); // document.MarginBottom = Miles.Coro.Common.Print.PrintHelper.FromInchToPt(pageInfo.MarginBottom); // document.Save(); //} //using (var ms = new MemoryStream()) //{ // using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) // { // var data = new byte[fs.Length]; // fs.Read(data, 0, (int)fs.Length); // ms.Write(data, 0, (int)fs.Length); // } // ms.Seek(0, SeekOrigin.Begin); // this.richEditControl1.LoadDocument(ms, DevExpress.XtraRichEdit.DocumentFormat.OpenXml); //} } }