public fDanhSoCT(DataMasterDetail data, FormDesigner designer) { InitializeComponent(); _data = data; _designer = designer; }
private void grLoaiCT_EditValueChanged(object sender, EventArgs e) { string systableID = grLoaiCT.EditValue.ToString(); //int packageID = int.Parse(Config.GetValue("sysPackageID").ToString()); _data = new DataMasterDetail(systableID); _data.GetData(); _designer = new FormDesigner(_data); //_data.GetInfor() gMain = _designer.GenGridControl(_data.DsStruct.Tables[0], false, DockStyle.Fill); gMain.DataSource = _data.DsData.Tables[0]; panelControl3.Controls.Clear(); panelControl3.Controls.Add(gMain); }
public fShowDocWF(DataMasterDetail _data) { InitializeComponent(); graph = Pic.CreateGraphics(); wF = new WF(_data.DrTable["sysTableID"].ToString()); lTask = wF.lTask; lAction = wF.lAction; BgC = this.BackColor; _Data = _data; this.Paint += new PaintEventHandler(fShowDocWF_Paint); this.Resize += new EventHandler(fShowDocWF_Resize); this.ResizeEnd += new EventHandler(fShowDocWF_ResizeEnd); this.MaximumSizeChanged += new EventHandler(fShowDocWF_MaximumSizeChanged); this.ResizeRedraw = true; this.Activated += new EventHandler(fShowDocWF_Activated); Pic.Resize += new EventHandler(Pic_Resize); Pic.Paint += new PaintEventHandler(Pic_Paint); //DrawAll(); }
public static CDTData Create(DataType type, string TableName, string sysPackageID) { CDTData tmp = null; switch (type) { case DataType.Detail: tmp = new DataDetail(TableName, sysPackageID); break; case DataType.MasterDetail: tmp = new DataMasterDetail(TableName, sysPackageID); break; case DataType.Single: tmp = new DataSingle(TableName, sysPackageID); break; } return(tmp); }
public fBanhang() { InitializeComponent(); _data = new DataMasterDetail("DT3B", "7"); _frmDesign = new FormDesigner(_data, bs); _data.GetData(); dt = Getstruct(); getdata(); bs.DataSource = _data.DsData; this.bs.DataMember = _data.DsData.Tables[0].TableName; _data.DsData.Tables[0].ColumnChanged += FBanhang_ColumnChanged; gridControl1.DataSource = bs; bs.CurrentChanged += Bs_CurrentChanged; gridControl1.DataMember = this._data.DrTable["TableName"].ToString(); gridLookUpEdit1.Properties.ImmediatePopup = true; gridView1.KeyUp += new KeyEventHandler(gridView1_KeyUp); this.KeyUp += new KeyEventHandler(fBanhang_KeyUp); MaCN = Config.GetValue("MaCN").ToString(); sysDBID = Config.GetValue("sysDBID").ToString(); NewCT(); }
public static CDTData Create(DataType type, DataRow drTable) { CDTData tmp = null; switch (type) { case DataType.Detail: tmp = new DataDetail(drTable); break; case DataType.MasterDetail: tmp = new DataMasterDetail(drTable); break; case DataType.Single: tmp = new DataSingle(drTable); break; case DataType.Report: tmp = new DataReport(drTable); break; } return(tmp); }
/// <param name="rptTmp">DevReport file.</param> /// <param name="_Script">Script get data for report.</param> /// <param name="index">Index Row which get data</param> /// <param name="isPrint">Print or Preview</param> /// <param name="j">Liên Parameter</param> private void PrintPreview(DevExpress.XtraReports.UI.XtraReport rptTmp, string _Script, int index, int isPrint, int j) { DataTable dtReport = new DataTable(); try { if (_Script == string.Empty) { dtReport = _data.GetDataForPrint(index); DataMasterDetail dta = (_data as DataMasterDetail); if (dta != null) { richTextBox1.Text = dta.PrintSQL; } } else { dtReport = _data.GetDataForPrint(index, _Script); DataMasterDetail dta = (_data as DataMasterDetail); if (dta != null) { richTextBox1.Text = dta.PrintSQL; } } } catch { } dtReport = AddRecordToData(dtReport); DevExpress.XtraReports.UI.XRControl xrcTitle = rptTmp.FindControl("title", true); if (xrcTitle != null) { xrcTitle.Text = textEditTitle.Text.ToUpper(); } DevExpress.XtraReports.UI.XRControl xrcSoCTGoc = rptTmp.FindControl("SoCTGoc", true); if (xrcSoCTGoc != null) { xrcSoCTGoc.Text = textEditSoCTGoc.Text; } //SetVariables(rptTmp); if (dtReport == null) { return; } rptTmp.DataSource = dtReport; rptTmp.ScriptReferences = new string[] { Application.StartupPath + "\\CDTLib.dll" }; SetVariables(rptTmp); if (Config.GetValue("Language").ToString() == "1") { Translate(rptTmp); } SetVariables(rptTmp, j); rptTmp.ShowPrintMarginsWarning = false; if (isPrint == 0) { rptTmp.Print(); //Update LanIn } else if (isPrint == 1) { rptTmp.ShowPreview(); } else if (isPrint == 2) { SaveFileDialog fd = new SaveFileDialog(); fd.Filter = "(*.xls)|*.xls"; fd.AddExtension = true; fd.ShowDialog(); if (fd.FileName != string.Empty) { rptTmp.ExportToXls(fd.FileName); } } }
public fShowHistoryMtdt(DataMasterDetail _data) { _Data = _data; InitializeComponent(); Getdata(); }
/// <param name="rptTmp">DevReport file.</param> /// <param name="_Script">Script get data for report.</param> /// <param name="index">Index Row which get data</param> /// <param name="isPrint">Print or Preview</param> /// <param name="j">Liên Parameter</param> private void PrintPreview(DevExpress.XtraReports.UI.XtraReport rptTmp, string _Script, int index, bool isPrint, int j) { DataTable dtReport = new DataTable(); try { if (_Script == string.Empty) { dtReport = _data.GetDataForPrint(index); DataMasterDetail dta = (_data as DataMasterDetail); if (dta != null) { richTextBox1.Text = dta.PrintSQL; } } else { dtReport = _data.GetDataForPrint(index, _Script); DataMasterDetail dta = (_data as DataMasterDetail); if (dta != null) { richTextBox1.Text = dta.PrintSQL; } } } catch { } dtReport = AddRecordToData(dtReport); DevExpress.XtraReports.UI.XRControl xrcTitle = rptTmp.FindControl("title", true); if (xrcTitle != null) { xrcTitle.Text = textEditTitle.Text.ToUpper(); } DevExpress.XtraReports.UI.XRControl xrcSoCTGoc = rptTmp.FindControl("SoCTGoc", true); if (xrcSoCTGoc != null) { xrcSoCTGoc.Text = textEditSoCTGoc.Text; } //SetVariables(rptTmp); if (dtReport == null) { return; } rptTmp.DataSource = dtReport; rptTmp.ScriptReferences = new string[] { Application.StartupPath + "\\CDTLib.dll" }; SetVariables(rptTmp); if (Config.GetValue("Language").ToString() == "1") { Translate(rptTmp); } SetVariables(rptTmp, j); if (isPrint) { rptTmp.Print(); } else { rptTmp.ShowPreview(); } }
private void Init_MT35() { MT35 = new DataMasterDetail("DT35", "7"); designer_MT35 = new FormDesigner(MT35); if (Tungay == null || Denngay == null) { return; } if (MT35.DsData == null) { GetData_MT35(); } gc_MT35 = designer_MT35.GenGridControl(MT35.DsStruct.Tables[0], false, DockStyle.Fill); gv_MT35 = gc_MT35.ViewCollection[0] as DevExpress.XtraGrid.Views.Grid.GridView; gv_MT35.OptionsView.ShowDetailButtons = false; gv_MT35.OptionsBehavior.Editable = true; gv_MT35.OptionsBehavior.ReadOnly = true; //foreach (GridColumn gc in gv_MT35.Columns) //{ // if (gc.ColumnEdit != null && (gc.ColumnEdit as CDTRepGridLookup) != null) // { // foreach (EditorButton b in (gc.ColumnEdit as CDTRepGridLookup).Buttons) // if (b.Kind == ButtonPredefines.Plus) b.Visible = false; // } //} pOrder.Controls.Add(gc_MT35); SplitterControl spc = new SplitterControl(); spc.Dock = DockStyle.Bottom; pOrder.Controls.Add(spc); gc_DT35 = designer_MT35.GenGridControl(MT35.DsStruct.Tables[1], false, DockStyle.Bottom); gv_DT35 = gc_DT35.ViewCollection[0] as DevExpress.XtraGrid.Views.Grid.GridView; gv_DT35.OptionsBehavior.Editable = true; gv_DT35.OptionsBehavior.ReadOnly = true; gv_DT35.OptionsView.ShowFooter = false; gv_DT35.OptionsView.ShowGroupPanel = false; gv_DT35.OptionsView.ShowDetailButtons = false; //foreach (GridColumn gc in gvDegv_DT35tail.Columns) //{ // if (gc.ColumnEdit != null && (gc.ColumnEdit as CDTRepGridLookup) != null) // { // foreach (EditorButton b in (gc.ColumnEdit as CDTRepGridLookup).Buttons) // if (b.Kind == ButtonPredefines.Plus) b.Visible = false; // } //} pOrder.Controls.Add(gc_DT35); try { int i = MT35.DsData.Tables[0].Rows.IndexOf(MT35.DrCurrentMaster); i = gv_MT35.GetRowHandle(i); if (!gv_MT35.IsGroupRow(i)) { RowGroup_MT35 = gv_MT35.GetParentRowHandle(i); } } catch { } foreach (DevExpress.XtraGrid.Columns.GridColumn col in gv_MT35.Columns) { if (col.FieldName.ToUpper() == "TASKID") { DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox repTask = new DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox(); this.gc_MT35.RepositoryItems.Add(repTask); repTask.AutoHeight = false; repTask.GlyphAlignment = DevExpress.Utils.HorzAlignment.Center; if (MT35.tbTask != null) { for (int i = 0; i < MT35.tbTask.Rows.Count; i++) { DataRow drTask = MT35.tbTask.Rows[i]; if (drTask["Icon"] != DBNull.Value) { if (imageList_Order == null) { imageList_Order = new ImageList(); } this.imageList_Order.Images.Add(GetImage(drTask["Icon"] as byte[])); repTask.Items.AddRange(new DevExpress.XtraEditors.Controls.ImageComboBoxItem[] { new DevExpress.XtraEditors.Controls.ImageComboBoxItem(drTask["TaskLabel"].ToString(), drTask["ID"], repTask.Items.Count) }); } } } repTask.SmallImages = this.imageList_Order; col.ColumnEdit = repTask; col.Caption = ""; } } }
public fShowActionHistory(DataMasterDetail _data) { InitializeComponent(); _Data = _data; tb = getHistoryData(); }