private void initConfig() { fEdit = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Regular); fEditB = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Bold); tcMain = new C1DockingTab(); tcMain.Dock = System.Windows.Forms.DockStyle.Fill; tcMain.Location = new System.Drawing.Point(0, 266); tcMain.Name = "c1DockingTab1"; tcMain.Size = new System.Drawing.Size(669, 200); tcMain.TabIndex = 0; tcMain.TabsSpacing = 5; panel2.Controls.Add(tcMain); theme1.SetTheme(tcMain, mposC.iniC.themeApplication); theme1.SetTheme(panel1, mposC.iniC.themeApplication); theme1.SetTheme(panel2, mposC.iniC.themeApplication); theme1.SetTheme(cboYear, mposC.iniC.themeApplication); theme1.SetTheme(label7, mposC.iniC.themeApplication); mposC.setCboYear(cboYear); tabOnhand = new C1DockingTabPage(); tabOnhand.Location = new System.Drawing.Point(1, 24); //tabScan.Name = "c1DockingTabPage1"; tabOnhand.Size = new System.Drawing.Size(667, 175); tabOnhand.TabIndex = 0; tabOnhand.Text = "Material"; tabOnhand.Name = "tabMat"; //theme1.SetTheme(tabOnhand, mposC.iniC.themeApplication); tcMain.Controls.Add(tabOnhand); initgrfOnhand(); }
private void GrfStk_DoubleClick(object sender, EventArgs e) { //throw new NotImplementedException(); String id = "", name = ""; if (grfStk[grfStk.Row, colId] == null) { return; } id = grfStk[grfStk.Row, colId] != null ? grfStk[grfStk.Row, colId].ToString() : ""; name = grfStk[grfStk.Row, colName] != null ? grfStk[grfStk.Row, colName].ToString() : ""; C1DockingTabPage tabItem = new C1DockingTabPage(); tabItem.TabIndex = 0; tabItem.Name = "tabItem"; tabItem.Text = name; C1FlexGrid grf = new C1FlexGrid(); grf.Font = fEdit; grf.Dock = DockStyle.Fill; grf.Location = new Point(0, 0); grf.Rows.Count = 1; grf.Name = "grf_" + id; theme1.SetTheme(grf, "VS2013Tan"); setGrfItem(id, grf); tabItem.Controls.Add(grf); lgrfPkg.Add(grf); tC1.Controls.Add(tabItem); }
private void listOpenFiles_DoubleClick(object sender, System.EventArgs e) { C1DockingTabPage page = tabMain.TabPages[listOpenFiles.SelectedIndex]; Editor ed = page == null ? null : page.Tag as Editor; ShowEditor(ed); }
private void btnAddTab_Click(object sender, EventArgs e) { C1DockingTabPage page = new C1DockingTabPage(); page.Text = "Page" + (c1DockingTab1.TabPages.Count + 1).ToString(); page.ImageIndex = c1DockingTab1.TabPages.Count % 3; c1DockingTab1.TabPages.Add(page); }
public C1DockingTabPage AddNewTab(Form frm, String label) { //foreach (Control y in tC1.Controls) //{ // if (y is C1DockingTabPage) // { // if (y.Text.Equals("Import JOB")) // { // if (label.Equals("Import JOB")) // { // tC1.SelectedTab = (C1DockingTabPage)y; // return null; // } // } // } //} C1DockingTabPage tab = new C1DockingTabPage(); tab.SuspendLayout(); frm.TopLevel = false; tab.Width = tCC1.Width - 10; tab.Height = tCC1.Height - 35; frm.Parent = tab; frm.Dock = DockStyle.Fill; frm.Width = tab.Width; frm.Height = tab.Height; tab.Text = label; //foreach (Control x in frm.Controls) //{ // if (x is DataGridView) // { // //x.Dock = DockStyle.Fill; // } //} //tab.BackColor = System.Drawing.ColorTranslator.FromHtml("#1E1E1E"); frm.Visible = true; tC1.TabPages.Add(tab); //frm.Location = new Point((tab.Width - frm.Width) / 2, (tab.Height - frm.Height) / 2); frm.Location = new Point(0, 0); tab.ResumeLayout(); tab.Refresh(); tab.Text = label; if (bc.iniC.statusAppDonor.Equals("1")) { theme1.SetTheme(tC1, bc.iniC.themeDonor); } else { theme1.SetTheme(tC1, "Office2007Blue"); } tC1.SelectedTab = tab; //theme1.SetTheme(tC1, "Office2010Blue"); //theme1.SetTheme(tC1, "Office2010Green"); return(tab); }
private void ShowTabPage(C1DockingTabPage page) { var tab = page.Parent as C1DockingTab; if (tab != null) { tab.SelectedTab = page; } }
private void CloseEditor(Editor ed) { if (ed.Closing()) { C1DockingTabPage page = ed.TextBox.Parent as C1DockingTabPage; System.Diagnostics.Debug.Assert(page != null); tabMain.TabPages.Remove(page); ListOpenFiles(); } }
public bool CloseRightPage(string path) { if (!_tabDetailPanel.Controls.ContainsKey(path)) { return(false); } C1DockingTabPage tabPage = (C1DockingTabPage)_tabDetailPanel.Controls[path]; _tabDetailPanel.Close(tabPage); return(true); }
private void ShowTab(C1DockingTabPage p) { c1DockingTab1.SelectedTab = p; if (p == tabDesign) { cbDesign_Style.Items.Clear(); foreach (string style in _styles) { cbDesign_Style.Items.Add(style); } cbDesign_Flavor.Items.Clear(); foreach (string flavor in _flavors) { cbDesign_Flavor.Items.Add(flavor); } //Navigate to a specific topic in C1DynamicHelp c1DynamicHelp1.ShowTopic("WordDocuments/dessertdesign.htm"); } else if (p == tabNew) { //Navigate to a specific topic in C1DynamicHelp c1DynamicHelp1.ShowTopic("WordDocuments/tostarttheicecreamcreationsimulator1.htm"); } else if (p == tabNewStyle) { if (rbNew_Style.Checked) { label15.Text = "New Style"; label12.Text = "Style Name"; } else if (rbNew_Flavor.Checked) { label15.Text = "New Flavor"; label12.Text = "Flavor Name:"; } //Navigate to a specific topic in C1DynamicHelp c1DynamicHelp1.ShowTopic("WordDocuments/addinganewstyleorflavor.htm"); } else if (p == tabAddRecipe) { //Navigate to a specific topic in C1DynamicHelp c1DynamicHelp1.ShowTopic("WordDocuments/recipedatabase1.htm"); } else if (p == tabDatabase) { c1FlexGrid1.DataSource = null; c1FlexGrid1.DataSource = _recipes; //Navigate to a specific topic in C1DynamicHelp c1DynamicHelp1.ShowTopic("WordDocuments/workingwiththerecipedatabase.htm"); } }
public static void NavigateTo(string clase, string assembly, string titulo) { UITemplateAccess ustmp = (UITemplateAccess)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance(assembly); string _name = ustmp.Name; if (IDE.c1DockingTab1.TabPages.IndexOfKey(ustmp.Name) == -1) { UITemplateAccess userControl = (UITemplateAccess)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance(assembly); userControl.Dock = DockStyle.Fill; userControl.Tag = assembly; Model.onStatusChanged(assembly, userControl); C1DockingTabPage page = new C1DockingTabPage(); page.Controls.Add(userControl); page.Text = titulo; page.Name = userControl.Name; page.Image = (Image)Halley.Presentacion.Properties.Resources.Form_16x16; page.Focus(); page.Tag = userControl.Name + ";" + assembly; IDE.c1DockingTab1.TabPages.Add(page); IDE.c1DockingTab1.SelectedIndex = IDE.c1DockingTab1.TabPages.Count; } else { //Buscar el control en el tab IDE.c1DockingTab1.SelectedIndex = IDE.c1DockingTab1.TabPages.IndexOfKey(_name); object[] obj = null; int _idx; _idx = IDE.c1DockingTab1.Controls.IndexOfKey(ustmp.Name); obj = IDE.c1DockingTab1.Controls.Find(ustmp.Name, true); UserControl x = null; for (int i = 0; i <= obj.Length - 1; i++) { if (obj[i].GetType().Name == ustmp.Name) { x = (UserControl)obj[i]; } } Model.onStatusChanged(assembly, x); } ustmp = null; }
private void openStockRec() { String name = "", txt = ""; FrmStockRec frm = new FrmStockRec(ic, menu, this, "", ""); if (!name.Equals("")) { txt = " " + name; } frm.FormBorderStyle = FormBorderStyle.None; C1DockingTabPage tab = menu.AddNewTab(frm, txt); //frm.tab = tab; }
private void setControlGrf() { String id = "", vn = "", an = "", preno = "", vsdate = "", hn = "", name = "", dateDisc = "", chk = ""; if (grfVs.Row <= 0) { return; } if (grfVs.Col <= 0) { return; } id = grfVs[grfVs.Row, colID] != null ? grfVs[grfVs.Row, colID].ToString() : ""; vn = grfVs[grfVs.Row, colVn] != null ? grfVs[grfVs.Row, colVn].ToString() : ""; an = grfVs[grfVs.Row, colAn] != null ? grfVs[grfVs.Row, colAn].ToString() : ""; preno = grfVs[grfVs.Row, colPreno] != null ? grfVs[grfVs.Row, colPreno].ToString() : ""; vsdate = grfVs[grfVs.Row, colDate] != null ? grfVs[grfVs.Row, colDate].ToString() : ""; hn = grfVs[grfVs.Row, colHn] != null ? grfVs[grfVs.Row, colHn].ToString() : ""; name = grfVs[grfVs.Row, colName] != null ? grfVs[grfVs.Row, colName].ToString() : ""; dateDisc = grfVs[grfVs.Row, colDateDisc] != null ? grfVs[grfVs.Row, colDateDisc].ToString() : ""; chk = grfVs[grfVs.Row, colChk] != null ? grfVs[grfVs.Row, colChk].ToString() : ""; tabVs = new C1DockingTabPage(); tabVs.Location = new System.Drawing.Point(1, 24); tabVs.Name = "c1DockingTabPage1"; tabVs.Size = new System.Drawing.Size(667, 175); tabVs.TabIndex = 0; tabVs.Text = name; tabVs.Name = "tabVs_" + vn; tC.Controls.Add(tabVs); Panel pn = new Panel(); pn.Dock = DockStyle.Fill; pn.Name = "pn_" + vn; tabVs.Controls.Add(pn); C1FlexGrid grf = new C1FlexGrid(); grf.Dock = DockStyle.Fill; grf.Font = fEdit; grf.Dock = System.Windows.Forms.DockStyle.Fill; grf.Location = new System.Drawing.Point(0, 0); //grf.Rows[0].Visible = false; //grf.Cols[0].Visible = false; grf.Rows.Count = 1; grf.Name = "grf_" + vn; pn.Controls.Add(grf); theme1.SetTheme(grf, bc.iniC.themeApplication); setGrf(hn, vn, preno, dateDisc, chk, an, grf); }
private void openDtrAdd(String pttId, String vn, String name) { FrmDoctorAdd frm = new FrmDoctorAdd(ic, menu, pttId, vn); String txt = ""; if (!name.Equals("")) { txt = " " + name; } frm.FormBorderStyle = FormBorderStyle.None; C1DockingTabPage tab = menu.AddNewTab(frm, txt); frm.tab = tab; }
private void openNurseAdd1() { String chk = "", name = "", id = "", pttId = "", vn = "", pid = ""; id = grfStk[grfStk.Row, colRecId] != null ? grfStk[grfStk.Row, colRecId].ToString() : ""; FrmStockRec frm = new FrmStockRec(ic, menu, this, id, ""); String txt = ""; txt = grfStk[grfStk.Row, colRecDoc] != null ? "รับเข้า เลขที่ " + grfStk[grfStk.Row, colRecDoc].ToString() : ""; frm.FormBorderStyle = FormBorderStyle.None; C1DockingTabPage tab = menu.AddNewTab(frm, txt); frm.tab = tab; }
private void NewEditor(string filename) { Editor ed = new Editor(this, filename); ed.TextBox.Dock = DockStyle.Fill; C1DockingTabPage page = new C1DockingTabPage(); page.Controls.Add(ed.TextBox); page.Text = ed.FileName; // IMPORTANT! used for internal "plumbing" page.Tag = ed; this.tabMain.TabPages.Add(page); ShowEditor(ed); ListOpenFiles(); }
private void openNurseAdd(String pttId, String vsid, String name, String flagview) { FrmPharmaAdd frm = new FrmPharmaAdd(ic, menu, pttId, vsid, flagview); String txt = ""; if (!name.Equals("")) { txt = "Pharmacy " + name; } frm.FormBorderStyle = FormBorderStyle.None; C1DockingTabPage tab = menu.AddNewTab(frm, txt); frm.tab = tab; frm.frmPharView = this; }
private void initConfig() { pageLoad = true; fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold); lgrfPkg = new List <C1FlexGrid>(); //C1ThemeController.ApplicationTheme = ic.iniC.themeApplication; theme1.Theme = ic.iniC.themeApplication; theme1.SetTheme(sB, "BeigeOne"); cboStkSubName.SelectedIndexChanged += CboStkSubName_SelectedIndexChanged; ic.ivfDB.stknDB.setCboStockSubName(cboStkSubName); cboStkSubName.SelectedIndex = 0; tC1 = new C1DockingTab(); tabOnhand = new C1DockingTabPage(); tC1.SuspendLayout(); tabOnhand.SuspendLayout(); tC1.Dock = System.Windows.Forms.DockStyle.Fill; tC1.HotTrack = true; tC1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; tC1.TabSizeMode = C1.Win.C1Command.TabSizeModeEnum.Fit; tC1.TabsShowFocusCues = true; tC1.Alignment = TabAlignment.Top; tC1.SelectedTabBold = true; tC1.Name = "tC1"; tC1.CanCloseTabs = true; tabOnhand.Name = "tabOnhand"; tabOnhand.TabIndex = 0; tabOnhand.Text = "Onhand"; theme1.SetTheme(tC1, ic.theme); //theme1.SetTheme(groupBox1, theme2); tC1.ResumeLayout(false); tabOnhand.ResumeLayout(false); tC1.PerformLayout(); tabOnhand.PerformLayout(); tC1.Controls.Add(tabOnhand); pnStock.Controls.Add(tC1); initGrfStk(); sB1.Text = ""; pageLoad = false; }
public C1DockingTabPage AddNewTab(Form frm, String label) { frm.FormBorderStyle = FormBorderStyle.None; C1DockingTabPage tab = new C1DockingTabPage(); tab.SuspendLayout(); frm.TopLevel = false; tab.Width = tC1.Width - 10; tab.Height = tC1.Height - 35; tab.Name = frm.Name; frm.Parent = tab; frm.Dock = DockStyle.Fill; frm.Width = tab.Width; frm.Height = tab.Height; tab.Text = label; tab.TabIndex = tC1.TabCount + 1; //foreach (Control x in frm.Controls) //{ // if (x is DataGridView) // { // //x.Dock = DockStyle.Fill; // } //} //tab.BackColor = System.Drawing.ColorTranslator.FromHtml("#1E1E1E"); frm.Visible = true; //tC1.TabPages.Add(tab); tC1.TabPages.Insert(tC1.TabCount, tab); //frm.Location = new Point((tab.Width - frm.Width) / 2, (tab.Height - frm.Height) / 2); frm.Location = new Point(0, 0); tab.ResumeLayout(); tab.Refresh(); tab.Text = label; tab.Closing += Tab_Closing; theme1.SetTheme(tC1, bc.iniC.themeApplication); tC1.SelectedTab = tab; //theme1.SetTheme(tC1, "Office2010Blue"); //theme1.SetTheme(tC1, "Office2010Green"); return(tab); }
private void initCompoment() { int gapLine = 25, gapX = 20, gapY = 20, xCol2 = 130, xCol1 = 80, xCol3 = 330, xCol4 = 640, xCol5 = 950; Size size = new Size(); tcMain = new C1DockingTab(); tcMain.Dock = System.Windows.Forms.DockStyle.Fill; tcMain.Location = new System.Drawing.Point(0, 266); tcMain.Name = "tcMain"; tcMain.Size = new System.Drawing.Size(669, 200); tcMain.TabIndex = 0; tcMain.TabsSpacing = 5; tcMain.SelectedTabChanged += TcMain_SelectedTabChanged; tabOPBkk = new C1DockingTabPage(); tabOPBkk.Location = new System.Drawing.Point(1, 24); //tabScan.Name = "c1DockingTabPage1"; tabOPBkk.Size = new System.Drawing.Size(667, 175); tabOPBkk.TabIndex = 0; tabOPBkk.Text = "Vaccine"; tabOPBkk.Name = "tabVaccine"; tcMain.Controls.Add(tabOPBkk); tabOP = new C1DockingTabPage(); tabOP.Dock = System.Windows.Forms.DockStyle.Fill; tabOP.Name = "tabOP"; tabOP.Text = "OPBKK Main"; tcMain.Controls.Add(tabOP); grfSelect = new C1FlexGrid(); grfSelect.Font = fEdit; grfSelect.Dock = System.Windows.Forms.DockStyle.Fill; grfSelect.Location = new System.Drawing.Point(0, 0); grfSelect.Rows.Count = 1; grfSelect.Name = "grfSelect"; tabOPBkk.Controls.Add(grfSelect); theme1.SetTheme(grfSelect, "Office2010Red"); theme1.SetTheme(this, bc.iniC.themeApp); theme1.SetTheme(tcMain, bc.iniC.themeApp); this.Controls.Add(tcMain); }
public void ShowRightPage(string path) { C1DockingTabPage tabPage; if (!_tabDetailPanel.Controls.ContainsKey(path)) { tabPage = new C1DockingTabPage(); tabPage.Controls.Add(new DevicePage() { Name = path }); tabPage.Name = path; _tabDetailPanel.Controls.Add(tabPage); } tabPage = (C1DockingTabPage)_tabDetailPanel.Controls[path]; tabPage.Text = path.Replace(TreeLocalHost.PathString + "_", ""); int index = _tabDetailPanel.Controls.IndexOfKey(path); _tabDetailPanel.SelectedIndex = index; }
private void BtnCap1_Click(object sender, EventArgs e) { //throw new NotImplementedException(); if (!Directory.Exists(bc.iniC.pathScreenCaptureSend)) { Directory.CreateDirectory(bc.iniC.pathScreenCaptureSend); } this.Hide(); Thread.Sleep(200); Application.DoEvents(); ScreenCapture sc = new ScreenCapture(); sc.CaptureScreenToFile(bc.iniC.pathScreenCaptureSend + "\\cap1.jpg", ImageFormat.Jpeg); Thread.Sleep(200); Application.DoEvents(); C1DockingTabPage tabCap = new C1DockingTabPage(); Panel pnCap = new Panel(); pnCap.Dock = DockStyle.Fill; C1PictureBox pic = new C1PictureBox(); pic.Dock = DockStyle.Fill; pic.SizeMode = PictureBoxSizeMode.StretchImage; if (File.Exists(bc.iniC.pathScreenCaptureSend + "\\cap1.jpg")) { pic.Image = Image.FromFile(bc.iniC.pathScreenCaptureSend + "\\cap1.jpg"); } tabCap.Name = "tabCap"; tabCap.TabIndex = 0; tabCap.Text = "Capture 1"; tabCap.Font = fEditB; tC1.Controls.Add(tabCap); tabCap.Controls.Add(pnCap); pnCap.Controls.Add(pic); this.Show(); }
private void GrfOrder_DoubleClick(object sender, EventArgs e) { //throw new NotImplementedException(); String id = "", name = ""; id = grfOrder[grfOrder.Row, colId] != null ? grfOrder[grfOrder.Row, colId].ToString() : ""; name = grfOrder[grfOrder.Row, colName] != null ? grfOrder[grfOrder.Row, colName].ToString() : ""; C1DockingTabPage tabMat = new C1DockingTabPage(); tabMat.Location = new System.Drawing.Point(1, 24); //tabScan.Name = "c1DockingTabPage1"; tabMat.Size = new System.Drawing.Size(667, 175); tabMat.TabIndex = 0; tabMat.Text = name; tabMat.Name = "tab" + id; //theme1.SetTheme(tabOnhand, mposC.iniC.themeApplication); tcMain.Controls.Add(tabMat); C1FlexGrid grf = new C1FlexGrid(); grf = new C1FlexGrid(); grf.Font = fEdit; grf.Dock = System.Windows.Forms.DockStyle.Fill; grf.Location = new System.Drawing.Point(0, 0); grf.Rows[0].Visible = false; grf.Cols[0].Visible = true; grf.Cols[colId].Visible = false; //grf.DoubleClick += GrfOrder_DoubleClick; grf.Name = "grf" + id; theme1.SetTheme(grf, "Office2016Black"); tabMat.Controls.Add(grf); setGrf(grf, id); tcMain.SelectedTab = tabMat; }
private void AddOrRemove(Control control, string pagename, int menuid) { try { string pageindex = "tabpage_" + menuid; if (!dockingTab_Main.Controls.ContainsKey(pageindex)) { if (control.Visible) { C1DockingTabPage page = new C1DockingTabPage(); page.Text = pagename; page.Name = "tabpage_" + menuid; page.ImageIndex = dockingTab_Main.TabPages.Count % 3; page.Controls.Add(control); control.Dock = DockStyle.Fill; control.Visible = true; dockingTab_Main.Controls.Add(page); dockingTab_Main.SelectedTab = page; } else { control.Dispose(); } } else { Control[] cts = dockingTab_Main.Controls.Find(pageindex, false); if (cts.Count() > 0) { C1DockingTabPage page = (C1DockingTabPage)cts[0]; dockingTab_Main.SelectedTab = page; } } } catch (Exception e) { MessageBox.Show(e.Message); } }
public void removeTab(C1DockingTabPage tab) { tC1.TabPages.Remove(tab); }
private void initComponent() { //new LogWriter("d", "FrmDoctorView initComponent 00 "); int gapLine = 20, gapX = 20; Size size = new Size(); int scrW = Screen.PrimaryScreen.Bounds.Width; theme1 = new C1.Win.C1Themes.C1ThemeController(); this.sb1 = new C1.Win.C1Ribbon.C1StatusBar(); panel1 = new System.Windows.Forms.Panel(); pnHead = new System.Windows.Forms.Panel(); pnBotton = new System.Windows.Forms.Panel(); pnQue = new System.Windows.Forms.Panel(); pnApm = new System.Windows.Forms.Panel(); pnFinish = new System.Windows.Forms.Panel(); pnIPD = new System.Windows.Forms.Panel(); //theme1 = new C1.Win.C1Themes.C1ThemeController(); tC1 = new C1.Win.C1Command.C1DockingTab(); tabQue = new C1.Win.C1Command.C1DockingTabPage(); tabApm = new C1.Win.C1Command.C1DockingTabPage(); tabFinish = new C1.Win.C1Command.C1DockingTabPage(); tabIPD = new C1.Win.C1Command.C1DockingTabPage(); panel1.SuspendLayout(); pnHead.SuspendLayout(); pnBotton.SuspendLayout(); pnQue.SuspendLayout(); pnApm.SuspendLayout(); pnFinish.SuspendLayout(); pnIPD.SuspendLayout(); tC1.SuspendLayout(); tabQue.SuspendLayout(); tabApm.SuspendLayout(); tabFinish.SuspendLayout(); tabIPD.SuspendLayout(); this.SuspendLayout(); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.TabIndex = 0; //panel1.BackColor = Color.Brown; this.sb1.AutoSizeElement = C1.Framework.AutoSizeElement.Width; this.sb1.Location = new System.Drawing.Point(0, 620); this.sb1.Name = "sb1"; this.sb1.Size = new System.Drawing.Size(956, 22); this.sb1.VisualStyle = C1.Win.C1Ribbon.VisualStyle.Office2007Blue; pnHead.Size = new System.Drawing.Size(scrW, 50); pnHead.BorderStyle = BorderStyle.Fixed3D; tabQue.Name = "tabQue"; tabQue.TabIndex = 0; tabQue.Text = "Queue"; tabQue.Font = fEditB; //tabQue.TabIndex = tC1.TabCount + 1; tabApm.Name = "tabApm"; tabApm.TabIndex = 1; tabApm.Text = "Appointment"; tabApm.Font = fEditB; tabFinish.Name = "tabFinish"; tabFinish.TabIndex = 2; tabFinish.Text = "Finish"; tabFinish.Font = fEditB; tabIPD.Name = "tabIPD"; tabIPD.TabIndex = 3; tabIPD.Text = "IPD"; tabIPD.Font = fEditB; tC1.Dock = System.Windows.Forms.DockStyle.Fill; tC1.HotTrack = true; tC1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; tC1.TabSizeMode = C1.Win.C1Command.TabSizeModeEnum.Fit; tC1.TabsShowFocusCues = true; tC1.Alignment = TabAlignment.Top; tC1.SelectedTabBold = true; tC1.Name = "tC1"; tC1.Font = fEditB; tC1.CanCloseTabs = true; tC1.CanAutoHide = false; tC1.SelectedTabBold = true; //tC1.Location = new System.Drawing.Point(0, 0); //tC1.BackColor = Color.White; pnHead.Dock = DockStyle.Top; pnBotton.Dock = DockStyle.Fill; pnBotton.BorderStyle = BorderStyle.FixedSingle; pnQue.Dock = DockStyle.Fill; pnApm.Dock = DockStyle.Fill; pnFinish.Dock = DockStyle.Fill; pnIPD.Dock = DockStyle.Fill; //new LogWriter("d", "FrmDoctorView initComponent 01 "); setControlComponent(); this.Controls.Add(panel1); this.Controls.Add(this.sb1); panel1.Controls.Add(pnBotton); panel1.Controls.Add(pnHead); pnBotton.Controls.Add(tC1); tC1.Controls.Add(tabQue); tC1.Controls.Add(tabApm); tC1.Controls.Add(tabFinish); tC1.Controls.Add(tabIPD); tabQue.Controls.Add(pnQue); tabApm.Controls.Add(pnApm); tabFinish.Controls.Add(pnFinish); tabIPD.Controls.Add(pnIPD); pnHead.Controls.Add(lbDtrName); pnHead.Controls.Add(txtPttHn); pnHead.Controls.Add(btnHnSearch); pnHead.Controls.Add(txtDate); pnHead.Controls.Add(lbTxtDate); pnHead.Controls.Add(lbTxtPttHn); //pnHead.Controls.Add(lbPttName); this.WindowState = FormWindowState.Maximized; //lbDtrName.ResumeLayout(false); //lbTxtPttHn.ResumeLayout(false); panel1.ResumeLayout(false); pnHead.ResumeLayout(false); pnBotton.ResumeLayout(false); pnQue.ResumeLayout(false); pnApm.ResumeLayout(false); pnFinish.ResumeLayout(false); pnIPD.ResumeLayout(false); tC1.ResumeLayout(false); tabQue.ResumeLayout(false); tabApm.ResumeLayout(false); tabFinish.ResumeLayout(false); tabIPD.ResumeLayout(false); this.ResumeLayout(false); pnQue.PerformLayout(); pnApm.PerformLayout(); tC1.PerformLayout(); tabQue.PerformLayout(); tabApm.PerformLayout(); this.PerformLayout(); }
private void OpenMDIForm(MenuDTO menuItem) { if (menuItem.AssociatedForm.Assembly == null) throw new Exception(string.Format("No assembly was found with associated form '{0}'", menuItem.AssociatedForm.Name)); string assemblyFile = menuItem.AssociatedForm.Assembly.Name; string fullFormName = menuItem.AssociatedForm.Name; if (!System.IO.File.Exists(assemblyFile)) throw new System.IO.FileNotFoundException(string.Format("Assembly file '{0}' not found.", assemblyFile)); Assembly assembly = Assembly.LoadFrom(assemblyFile); if (assembly == null) throw new Exception("Loading assembly file error"); Type formType = assembly.GetType(fullFormName); if (formType == null) throw new Exception(string.Format("Can not get form type in assembly file '{0}' with form name '{1}'", assemblyFile, fullFormName)); object obj = Activator.CreateInstance(formType); C1DockingTabPage tabPage = new C1DockingTabPage() { Text = menuItem.Name, Tag = menuItem }; c1DockingTab.TabPages.Add(tabPage); Form childForm = (obj as Form); childForm.TopLevel = false; childForm.Parent = tabPage; childForm.Tag = menuItem; childForm.Text = menuItem.Name; childForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; childForm.Dock = DockStyle.Fill; tabPage.Controls.Add(childForm); c1DockingTab.SelectedTab = tabPage; SetWindowTheme(c1DockingTab); childForm.Show(); }
private void BtnOpen_Click(object sender, EventArgs e) { //throw new NotImplementedException(); int i = 0; Boolean findPaid = false; lItm = new List <String>(); lPaid = new List <String>(); lPaidCntErr = new List <int>(); lPaidCnt = new List <int>(); const Int32 BufferSize = 4096; dtChk.Clear(); using (var fileStream = File.OpenRead(txtPath.Text)) using (var streamReader = new StreamReader(fileStream, Encoding.UTF8, true, BufferSize)) { lItm.Clear(); String line; try { while ((line = streamReader.ReadLine()) != null) { findPaid = false; String[] line1 = line.Split('|'); if (line1.Length <= 1) { continue; } if (i == 17939) { String sql = ""; } String hn = "", date = "", year = "", month = "", date1 = "", paidtype = "", labcode = "", name = "", fntype = "", price = "", labname = "", netprice = "", col1 = ""; if (i == 0) { int day = 0; hn = line1[2]; date = line1[1]; year = date.Substring(date.Length - 4); month = date.Substring(3, 2); date1 = date.Substring(0, 2); int.TryParse(date1, out day); if (hn.Substring(0, 1).Equals("1")) { chkBn1.Checked = true; chkBn2.Checked = false; chkBn5.Checked = false; } else if (hn.Substring(0, 1).Equals("2")) { chkBn1.Checked = false; chkBn2.Checked = true; chkBn5.Checked = false; } else if (hn.Substring(0, 1).Equals("5")) { chkBn1.Checked = false; chkBn2.Checked = false; chkBn5.Checked = true; } cboYear.Text = year; cboMonth.Text = bc.getMonth(month); if (day <= 15) { cboPeriod.Text = "1"; } else { cboPeriod.Text = "2"; } } col1 = line1[0]; hn = line1[2]; date = line1[1]; name = line1[3]; paidtype = line1[4]; price = line1[5]; labcode = line1[7]; labname = line1[8]; netprice = line1[6]; foreach (String paid in lPaid) { if (paid.Equals(paidtype)) { findPaid = true; } } if (!findPaid) { lPaid.Add(paidtype); lPaidCntErr.Add(0); lPaidCnt.Add(0); } DataRow row1 = dtChk.NewRow(); row1["row1"] = i; row1["lab_code"] = labcode; row1["lab_name"] = labname; row1["qty"] = 1; row1["price"] = price; row1["net_price"] = netprice; row1["amount"] = labcode; row1["paidtype"] = paidtype; row1["status_chk"] = "0"; row1["ptt_name"] = name; row1["date"] = date; row1["hn"] = hn; row1["col1"] = col1; //dtChk.Columns.Add("lab_name", typeof(String)); //dtChk.Columns.Add("qty", typeof(int)); //dtChk.Columns.Add("price", typeof(String)); //dtChk.Columns.Add("net_price", typeof(String)); //dtChk.Columns.Add("amount", typeof(String)); //dtChk.Rows.InsertAt(row1, i); dtChk.Rows.Add(row1); listBox1.Items.Add(line + "|0|0"); lItm.Add(line + "|0|0"); i++; } } catch (Exception ex) { MessageBox.Show("error i = " + i + " " + ex.Message, ""); } btnCheck.Enabled = true; label6.Text = "จำนวนข้อมูล " + i; } if (lPaid.Count > 0) { C1DockingTabPage tabsum = new C1DockingTabPage(); C1DockingTabPage tabsum1 = new C1DockingTabPage(); tabsum.Text = "สรุป"; tabsum.Name = "tabsum"; tabsum1.Text = "สรุป"; tabsum1.Name = "tabsum1"; tC1.TabPages.Add(tabsum1); tC3.TabPages.Add(tabsum); ListBox listsum = new ListBox(); listsum.BackColor = System.Drawing.Color.White; listsum.Dock = System.Windows.Forms.DockStyle.Fill; listsum.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(68)))), ((int)(((byte)(68))))); listsum.FormattingEnabled = true; listsum.Name = "listBoxSum3"; theme1.SetTheme(listsum, "(default)"); ListBox listsum1 = new ListBox(); listsum1.BackColor = System.Drawing.Color.White; listsum1.Dock = System.Windows.Forms.DockStyle.Fill; listsum1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(68)))), ((int)(((byte)(68))))); listsum1.FormattingEnabled = true; listsum1.Name = "listBoxSum1"; theme1.SetTheme(listsum1, "(default)"); tabsum.Controls.Add(listsum); tabsum1.Controls.Add(listsum1); int ii = 0; foreach (String paid in lPaid) { int cnt = 0; //C1DockingTabPage tab = new C1DockingTabPage(); C1DockingTabPage tab1 = new C1DockingTabPage(); //tab.Text = paid; tab1.Text = paid; tC1.TabPages.Add(tab1); //tC3.TabPages.Add(tab); //ListBox list = new ListBox(); //list.BackColor = System.Drawing.Color.White; //list.Dock = System.Windows.Forms.DockStyle.Fill; //list.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(68)))), ((int)(((byte)(68))))); //list.FormattingEnabled = true; //list.Name = "listBox1"+ paid; //theme1.SetTheme(list, "(default)"); ListBox list1 = new ListBox(); list1.BackColor = System.Drawing.Color.White; list1.Dock = System.Windows.Forms.DockStyle.Fill; list1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(68)))), ((int)(((byte)(68))))); list1.FormattingEnabled = true; list1.Name = "listBox1" + paid; theme1.SetTheme(list1, "(default)"); //tab.Controls.Add(list); tab1.Controls.Add(list1); foreach (String txt in lItm) { String[] line1 = txt.Split('|'); String hn = "", date = "", year = "", month = "", date1 = "", paidtype = ""; paidtype = line1[4]; if (paid.Equals(paidtype)) { //findPaid = true; //list.Items.Add(txt); list1.Items.Add(txt); cnt++; } } lPaidCnt[ii] = cnt; listsum.Items.Add(paid + " จำนวน " + cnt); listsum1.Items.Add(paid + " จำนวน " + cnt); ii++; } } panel8.Show(); }
private void BtnCheck2_Click(object sender, EventArgs e) { int cnt = 0, cntErr = 0; Decimal sum = 0, price1 = 0, net = 0, minus = 0; //throw new NotImplementedException(); pB2.Show(); pB2.Minimum = 0; pB2.Maximum = lItm.Count; ConnectDB conn; conn = new ConnectDB(bc.iniC); lItmC = new List <string>(); lItmE = new List <string>(); label11.Text = chkBn1.Checked ? "bangna1" : chkBn2.Checked ? "bangna2" : chkBn5.Checked ? "bangna5" : ""; label12.Text = cboYear.Text; label13.Text = cboMonth.Text; label14.Text = cboPeriod.Text; Application.DoEvents(); //foreach (String str in lItm) foreach (DataRow str in dtChk.Rows) { try { //String[] itm = str.Split('|'); //String[] itm = str.Split('|'); String col1 = "", date = "", hn = "", name = "", fntype = "", col6 = "", labname = "", labcode = "", labdate1 = "", labdate = "", labdateOld = "", price = ""; //col1 = itm[0]; //date = itm[1]; //hn = itm[2]; //name = itm[3]; //fntype = itm[4]; //col6 = itm[5]; //price = itm[6]; //labcode = itm[7]; //labname = itm[8]; col1 = str["col1"].ToString(); date = str["date"].ToString(); hn = str["hn"].ToString(); name = str["ptt_name"].ToString(); fntype = str["paidtype"].ToString(); col6 = str["net_price"].ToString(); price = str["price"].ToString(); labcode = str["lab_code"].ToString(); labname = str["lab_name"].ToString(); labdate1 = (int.Parse(date.Substring(6)) - 543) + "-" + date.Substring(3, 2) + "-" + date.Substring(0, 2); price1 = 0; if (Decimal.TryParse(price, out price1)) { sum += price1; } String sql = ""; DataTable dt = new DataTable(); //sql = "select lab_t05.MNC_req_no,LAB_T01.MNC_PRE_NO " + // "from PATIENT_T01 " + // "inner join LAB_T01 on LAB_T01.mnc_hn_no = PATIENT_T01.mnc_hn_no " + // "and LAB_T01.mnc_pre_no = PATIENT_T01.mnc_pre_no " + // "and LAB_T01.mnc_date = PATIENT_T01.MNC_DATE " + // "inner join LAB_T05 on lab_t05.MNC_REQ_YR = lab_t01.MNC_REQ_YR " + // "and lab_t05.MNC_REQ_no = lab_t01.MNC_REQ_no " + // "and lab_t05.MNC_REQ_dat = lab_t01.MNC_REQ_dat " + // "where lab_t05.MNC_REQ_DAT >= '" + labdate1 + "' " + // "and lab_t05.MNC_REQ_DAT <= '" + labdate1 + "' " + // //"and patient_t01.MNC_STS = 'f' " + // //"and LAB_T01.MNC_REQ_STS = 'Q' " + // "and LAB_T01.mnc_hn_no ='" + hn + "' " + // "and lab_t05.mnc_lb_cd ='" + labcode + "'"; sql = "select lab_t02.MNC_req_no,LAB_T01.MNC_PRE_NO " + "from PATIENT_T01 " + "inner join LAB_T01 on LAB_T01.mnc_hn_no = PATIENT_T01.mnc_hn_no " + "and LAB_T01.mnc_pre_no = PATIENT_T01.mnc_pre_no " + "and LAB_T01.mnc_date = PATIENT_T01.MNC_DATE " + "inner join lab_t02 on lab_t02.MNC_REQ_YR = lab_t01.MNC_REQ_YR " + "and lab_t02.MNC_REQ_no = lab_t01.MNC_REQ_no " + "and lab_t02.MNC_REQ_dat = lab_t01.MNC_REQ_dat " + "where lab_t02.MNC_REQ_DAT >= '" + labdate1 + "' " + "and lab_t02.MNC_REQ_DAT <= '" + labdate1 + "' " + //"and patient_t01.MNC_STS = 'f' " + //"and LAB_T01.MNC_REQ_STS = 'Q' " + "and LAB_T01.mnc_hn_no ='" + hn + "' " + "and lab_t02.mnc_lb_cd ='" + labcode + "'"; dt = conn.selectData(conn.connMainHIS, sql); if (dt.Rows.Count > 0) { //itm[8] = dt.Rows[0]["MNC_PRE_NO"].ToString(); //itm[9] = dt.Rows[0]["MNC_req_no"].ToString(); str["status_chk"] = "1"; listBox2.Items.Add(date + " " + hn + " " + name + " " + labcode + " " + labname); lItmC.Add(col1 + "|" + date + "|" + hn + "|" + name + "|" + fntype + "|" + col6 + "|" + price + "|" + labcode + "|" + labname + "|" + dt.Rows[0]["MNC_PRE_NO"].ToString() + "|" + dt.Rows[0]["MNC_req_no"].ToString()); cnt++; net += price1; if ((cnt % 100) == 0) { Application.DoEvents(); } } else { cntErr++; minus += price1; listBox3.Items.Add(date + " " + hn + " " + name + " " + labcode + " " + labname); lItmC.Add(col1 + "|" + date + "|" + hn + "|" + name + "|" + fntype + "|" + col6 + "|" + price + "|" + labcode + "|" + labname + "|0|0|-" + "|-"); lItmE.Add(col1 + "|" + date + "|" + hn + "|" + name + "|" + fntype + "|" + col6 + "|" + price + "|" + labcode + "|" + labname + "|0|0|-" + "|-"); int cnt1 = 0; foreach (String paid in lPaid) { if (paid.Equals(fntype)) { //int cnt2 = 0; lPaidCntErr[cnt1]++; //int.TryParse(lPaidCnt[cnt1],out cnt2); } cnt1++; } //itm[8] = dt.Rows[0]["MNC_PRE_NO"].ToString(); //itm[9] = dt.Rows[0]["MNC_req_no"].ToString(); //listBox2.Items.Add(itm.ToString()); } pB2.Value++; } catch (Exception ex) { MessageBox.Show("ex" + ex.Message, ""); } } //Control ctn = this.GetControl("listBoxSum3"); ListBox listsum = new ListBox(); foreach (Control ctl in this.Controls) { if ((ctl is C1DockingTab) && (ctl.Name.Equals("tC"))) { foreach (Control ctl1 in ctl.Controls) { if ((ctl1 is C1DockingTabPage) && (ctl1.Name.Equals("tab3"))) { foreach (Control ctl2 in ctl1.Controls) { if ((ctl2 is Panel) && (ctl2.Name.Equals("panel3"))) { foreach (Control ctl3 in ctl2.Controls) { if ((ctl3 is C1DockingTab) && (ctl3.Name.Equals("tC3"))) { foreach (Control ctl4 in ctl3.Controls) { if ((ctl4 is C1DockingTabPage) && (ctl4.Name.Equals("tabsum"))) { foreach (Control ctl5 in ctl4.Controls) { if ((ctl5 is ListBox) && (ctl5.Name.Equals("listBoxSum3"))) { listsum = (ListBox)ctl5; listsum.Items.Clear(); int i = 0; foreach (String txt in lPaid) { listsum.Items.Add(txt + " จำนวน " + lPaidCnt[i] + " ไม่พบ จำนวน " + lPaidCntErr[i]); i++; } } } } } } } } } } } } } //listsum.Items.Clear(); //int i = 0; //foreach (String txt in lPaid) //{ // listsum.Items.Add(txt + " จำนวน " + lPaidCnt[i]+" ไม่พบ จำนวน "+ lPaidCntErr[i]); // i++; //} pB1.Hide(); label18.Text = lItm.Count.ToString(); label17.Text = cnt.ToString(); label16.Text = cntErr.ToString(); label15.Text = sum.ToString("#,###.00"); label23.Text = net.ToString("#,###.00"); label26.Text = minus.ToString("#,###.00"); btnTab3.Enabled = true; pB2.Hide(); tC.SelectedTab = tab3; setGrf(); //DataTable dt11 = new DataTable(); dtChkGrp = GroupBy("paidtype", "paidtype", dtChk); setGrf11(dtChkGrp); if (dtChkGrp.Rows.Count > 0) { foreach (DataRow row in dtChkGrp.Rows) { C1DockingTabPage tab1 = new C1DockingTabPage(); tab1.Text = row["paidtype"].ToString(); tC3.TabPages.Add(tab1); C1FlexGrid grf = new C1FlexGrid(); grf.Font = fEdit; grf.Dock = System.Windows.Forms.DockStyle.Fill; grf.Location = new System.Drawing.Point(0, 0); tab1.Controls.Add(grf); DataRow[] result = dtChk.Select("paidtype = '" + row["paidtype"].ToString() + "'"); DataTable dt1 = new DataTable(); addColumn(dt1); foreach (DataRow row1 in result) { DataRow row2 = dt1.NewRow(); ///row2 = row1; row2["row1"] = int.Parse(row1["row1"].ToString()) + 1; row2["lab_code"] = row1["lab_code"]; row2["lab_name"] = row1["lab_name"]; row2["qty"] = row1["qty"]; row2["price"] = row1["price"]; row2["net_price"] = row1["net_price"]; row2["amount"] = row1["amount"]; row2["paidtype"] = row1["paidtype"]; row2["status_chk"] = row1["status_chk"]; row2["ptt_name"] = row1["ptt_name"]; row2["date"] = row1["date"]; row2["hn"] = row1["hn"]; row2["col1"] = row1["col1"]; dt1.Rows.Add(row2); } DataTable dt2 = new DataTable(); dt2 = GroupBy1("lab_code", "lab_code", dt1); foreach (DataRow row3 in dt2.Rows) { DataRow[] result1 = dtChk.Select("lab_code = '" + row3 ["lab_code"].ToString() + "'"); if (result.Length > 0) { row3["lab_name"] = result1[0]["lab_name"].ToString(); } Console.WriteLine("{0}, {1}", row[0], row[1]); } //dt1.ad grf.DataSource = dt2; grf.Cols["price"].Visible = false; grf.Cols["net_price"].Visible = false; grf.Cols["amount"].Visible = false; grf.Cols["lab_code"].Width = 100; grf.Cols["lab_name"].Width = 300; C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false); C1ThemeController.ApplyThemeToObject(grf, theme); } } //pB1.Show(); }
private void initTab() { int gapLine = 15, gapX = 20; Size size = new Size(); Size size1 = new Size(); int scrW = Screen.PrimaryScreen.Bounds.Width; tC1 = new C1.Win.C1Command.C1DockingTab(); tC1.Dock = System.Windows.Forms.DockStyle.Fill; tC1.HotTrack = true; tC1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; tC1.TabSizeMode = C1.Win.C1Command.TabSizeModeEnum.Fit; tC1.TabsShowFocusCues = true; tabItem = new C1.Win.C1Command.C1DockingTabPage(); tabItem.Name = "tabItem"; tabItem.TabIndex = 0; tabItem.Text = "Item Master"; tabDrug = new C1.Win.C1Command.C1DockingTabPage(); tabDrug.Name = "tabDrug"; tabDrug.TabIndex = 0; tabDrug.Text = "Drug"; tabSpecial = new C1.Win.C1Command.C1DockingTabPage(); tabSpecial.Name = "tabSpecial"; tabSpecial.TabIndex = 0; tabSpecial.Text = "Special Item"; tabLab = new C1.Win.C1Command.C1DockingTabPage(); tabLab.Name = "tabLab"; tabLab.TabIndex = 0; tabLab.Text = "Lab Item"; pnItem = new Panel(); pnItem.Dock = DockStyle.Fill; lbCboname = new Label(); lbCboname.Text = "Type :"; lbCboname.Font = fEdit; lbCboname.Location = new System.Drawing.Point(gapX, 10); lbCboname.AutoSize = true; cboItemType = new C1ComboBox(); size = ic.MeasureString(lbCboname); cboItemType.Location = new System.Drawing.Point(gapX + size.Width, lbCboname.Location.Y); cboItemType.SelectedItemChanged += CboItemType_SelectedItemChanged; lbItem = new Label(); lbItem.Text = "Item :"; lbItem.Font = fEdit; lbItem.Location = new System.Drawing.Point(gapX, gapLine + cboItemType.Height); lbItem.AutoSize = true; txtCode = new C1TextBox(); txtCode.Font = fEdit; txtCode.Location = new System.Drawing.Point(cboItemType.Location.X, lbItem.Location.Y); lbItemName = new Label(); lbItemName.Text = "..."; lbItemName.Font = fEdit; lbItemName.Location = new System.Drawing.Point(txtCode.Location.X + txtCode.Width, txtCode.Location.Y); lbItemName.AutoSize = true; btnSave = new C1Button(); btnSave.Name = ""; btnSave.Text = "Save"; btnSave.Font = fEdit; btnSave.Location = new System.Drawing.Point(txtCode.Location.X + txtCode.Width + 300, txtCode.Location.Y); btnSave.Click += BtnSave_Click; btnClear = new C1Button(); btnClear.Name = ""; btnClear.Text = "Clear"; btnClear.Font = fEdit; btnClear.Location = new System.Drawing.Point(btnSave.Location.X + btnSave.Width + 10, btnSave.Location.Y); btnClear.Click += BtnClear_Click; lbMessage = new Label(); lbMessage.Text = ""; lbMessage.Font = fEditB; lbMessage.Location = new System.Drawing.Point(btnClear.Location.X + btnClear.Width + 10, btnClear.Location.Y); lbMessage.AutoSize = true; panel1.Controls.Add(tC1); tC1.Controls.Add(tabItem); tC1.Controls.Add(tabDrug); tC1.Controls.Add(tabSpecial); tC1.Controls.Add(tabLab); grfItem = new C1FlexGrid(); grfItem.Font = fEdit; grfItem.Location = new System.Drawing.Point(gapX, gapLine + txtCode.Height + txtCode.Location.Y); grfItem.Size = new Size(900, 300); grfItem.RowColChange += GrfItem_RowColChange; lbCapPtt = new Label(); lbCapPtt.Text = "Master"; lbCapPtt.Font = fEdit; lbCapPtt.Location = new System.Drawing.Point(gapX, gapLine + grfItem.Location.Y + grfItem.Height); lbCapPtt.AutoSize = true; size = ic.MeasureString(lbCapPtt); txtItemCode = new C1TextBox(); txtItemCode.Font = fEdit; txtItemCode.Location = new System.Drawing.Point(gapX + size.Width, lbCapPtt.Location.Y); lbItemCode = new Label(); lbItemCode.Text = "..."; lbItemCode.Font = fEdit; lbItemCode.Location = new System.Drawing.Point(gapX + txtItemCode.Location.X + txtItemCode.Width, lbCapPtt.Location.Y); lbItemCode.AutoSize = true; lbCapLink = new Label(); lbCapLink.Text = "Link"; lbCapLink.Font = fEdit; lbCapLink.Location = new System.Drawing.Point(scrW / 2, lbCapPtt.Location.Y); lbCapLink.AutoSize = true; size = ic.MeasureString(lbCapLink); txtLinkCode = new C1TextBox(); txtLinkCode.Font = fEdit; txtLinkCode.Location = new System.Drawing.Point(lbCapLink.Location.X + size.Width, lbCapLink.Location.Y); lbLinkCode = new Label(); lbLinkCode.Text = "..."; lbLinkCode.Font = fEdit; lbLinkCode.Location = new System.Drawing.Point(gapX + txtLinkCode.Location.X + txtLinkCode.Width, lbCapPtt.Location.Y); lbLinkCode.AutoSize = true; grfPtt = new C1FlexGrid(); grfPtt.Font = fEdit; grfPtt.Location = new System.Drawing.Point(gapX, lbCapPtt.Height + lbCapPtt.Location.Y); grfPtt.Size = new Size((scrW / 2) - 50, 300); grfPtt.RowColChange += GrfPtt_RowColChange; grfLink = new C1FlexGrid(); grfLink.Font = fEdit; grfLink.Location = new System.Drawing.Point(gapX + grfPtt.Width + gapX, grfPtt.Location.Y); grfLink.Size = new Size((scrW / 2) - 50, 300); grfLink.RowColChange += GrfLink_RowColChange; tabItem.Controls.Add(pnItem); pnItem.Controls.Add(lbCboname); pnItem.Controls.Add(cboItemType); pnItem.Controls.Add(lbItemName); pnItem.Controls.Add(lbItem); pnItem.Controls.Add(txtCode); pnItem.Controls.Add(grfItem); pnItem.Controls.Add(lbCapPtt); pnItem.Controls.Add(lbCapLink); pnItem.Controls.Add(grfPtt); pnItem.Controls.Add(grfLink); pnItem.Controls.Add(txtItemCode); pnItem.Controls.Add(txtLinkCode); pnItem.Controls.Add(lbItemCode); pnItem.Controls.Add(lbLinkCode); pnItem.Controls.Add(btnSave); pnItem.Controls.Add(btnClear); pnItem.Controls.Add(lbMessage); theme1.SetTheme(panel1, ic.iniC.themeApp); theme1.SetTheme(tC1, ic.iniC.themeApp); theme1.SetTheme(tC1, ic.iniC.themeApp); theme1.SetTheme(lbMessage, ic.iniC.themeApp); lbMessage.Text = "สร้างข้อมูลLinkใหม่"; }
private void initConfig() { fEdit = new Font(bc.iniC.grdViewFontName, bc.grdViewFontSize, FontStyle.Regular); fEditB = new Font(bc.iniC.grdViewFontName, bc.grdViewFontSize, FontStyle.Bold); bc.bcDB.dgsDB.setCboDgs(cboDgs, ""); array1 = new ArrayList(); lStream = new List <listStream>(); strm = new listStream(); grfOrder = new C1FlexGrid(); //timer1 = new Timer(); //int chk = 0; //int.TryParse(bc.iniC.timerImgScanNew, out chk); //timer1.Interval = chk; //timer1.Enabled = true; //timer1.Tick += Timer1_Tick; //timer1.Stop(); theme1.SetTheme(sb1, "ExpressionDark"); theme1.SetTheme(groupBox1, "ExpressionDark"); theme1.SetTheme(panel2, "ExpressionDark"); theme1.SetTheme(panel3, "ExpressionDark"); foreach (Control con in groupBox1.Controls) { theme1.SetTheme(con, "ExpressionDark"); } //foreach (Control con in grfScan.Controls) //{ // theme1.SetTheme(con, "ExpressionDark"); //} initGrf(); txtHn.Value = hn; setGrf(); btnHn.Click += BtnHn_Click; btnOpen.Click += BtnOpen_Click; btnRefresh.Click += BtnRefresh_Click; txtHn.KeyUp += TxtHn_KeyUp; tcDtr = new C1DockingTab(); tcDtr.Dock = System.Windows.Forms.DockStyle.Fill; tcDtr.Location = new System.Drawing.Point(0, 266); tcDtr.Name = "c1DockingTab1"; tcDtr.Size = new System.Drawing.Size(669, 200); tcDtr.TabIndex = 0; tcDtr.TabsSpacing = 5; panel3.Controls.Add(tcDtr); tabScan = new C1DockingTabPage(); tabScan.Location = new System.Drawing.Point(1, 24); //tabScan.Name = "c1DockingTabPage1"; tabScan.Size = new System.Drawing.Size(667, 175); tabScan.TabIndex = 0; tabScan.Text = "ใบยา / Staff's Note"; tabScan.Name = "tabPageScan"; tcDtr.Controls.Add(tabScan); tabOrder = new C1DockingTabPage(); tabOrder.Location = new System.Drawing.Point(1, 24); //tabScan.Name = "c1DockingTabPage1"; tabOrder.Size = new System.Drawing.Size(667, 175); tabOrder.TabIndex = 0; tabOrder.Text = "ประวัติการสั่งการ"; tabOrder.Name = "tabOrder"; tcDtr.Controls.Add(tabOrder); grfOrder.Font = fEdit; grfOrder.Dock = System.Windows.Forms.DockStyle.Fill; grfOrder.Location = new System.Drawing.Point(0, 0); grfOrder.Rows[0].Visible = false; grfOrder.Cols[0].Visible = false; grfOrder.Cols[colOrderId].Visible = false; grfOrder.Rows.Count = 1; grfOrder.Cols.Count = 5; grfOrder.Cols[colOrderName].Caption = "ชื่อ"; grfOrder.Cols[colOrderMed].Caption = "-"; grfOrder.Cols[colOrderQty].Caption = "QTY"; grfOrder.Cols[colOrderName].Width = 300; grfOrder.Cols[colOrderMed].Width = 200; grfOrder.Cols[colOrderQty].Width = 60; grfOrder.Name = "grfOrder"; theme1.SetTheme(grfOrder, "Office2016Black"); tabOrder.Controls.Add(grfOrder); setPicStaffNote(); theme1.SetTheme(tcDtr, theme1.Theme); int i = 0; String idOld = ""; if (bc.bcDB.dgssDB.lDgss.Count <= 0) { bc.bcDB.dgssDB.getlBsp(); } foreach (DocGroupSubScan dgss in bc.bcDB.dgssDB.lDgss) { String dgsid = ""; dgsid = bc.bcDB.dgssDB.getDgsIdDgss(dgss.doc_group_sub_name); if (!dgsid.Equals(idOld)) { idOld = dgsid; String name = ""; name = bc.bcDB.dgsDB.getNameDgs(dgss.doc_group_id); C1DockingTabPage tabPage = new C1DockingTabPage(); tabPage.Location = new System.Drawing.Point(1, 24); tabPage.Size = new System.Drawing.Size(667, 175); tabPage.TabIndex = 0; tabPage.Text = " " + name + " "; tabPage.Name = dgsid; tcDtr.Controls.Add(tabPage); i++; C1DockingTab tabDtr1 = new C1DockingTab(); tabDtr1.Dock = System.Windows.Forms.DockStyle.Fill; tabDtr1.Location = new System.Drawing.Point(0, 266); tabDtr1.Name = "c1DockingTab1"; tabDtr1.Size = new System.Drawing.Size(669, 200); tabDtr1.TabIndex = 0; tabDtr1.TabsSpacing = 5; tabPage.Controls.Add(tabDtr1); theme1.SetTheme(tabDtr1, "Office2010Red"); foreach (DocGroupSubScan dgsss in bc.bcDB.dgssDB.lDgss) { if (dgsss.doc_group_id.Equals(dgss.doc_group_id)) { //addDevice.MenuItems.Add(new MenuItem(dgsss.doc_group_sub_name, new EventHandler(ContextMenu_upload))); C1DockingTabPage tabPage2 = new C1DockingTabPage(); tabPage2.Location = new System.Drawing.Point(1, 24); tabPage2.Size = new System.Drawing.Size(667, 175); tabPage2.TabIndex = 0; tabPage2.Text = " " + dgsss.doc_group_sub_name + " "; tabPage2.Name = "tab" + dgsss.doc_group_sub_id; tabDtr1.Controls.Add(tabPage2); C1FlexGrid grf = new C1FlexGrid(); grf.Font = fEdit; grf.Dock = System.Windows.Forms.DockStyle.Fill; grf.Location = new System.Drawing.Point(0, 0); grf.Rows[0].Visible = false; grf.Cols[0].Visible = false; grf.Rows.Count = 1; grf.Name = dgsss.doc_group_sub_id; grf.Cols.Count = 5; Column colpic1 = grf.Cols[colPic1]; colpic1.DataType = typeof(Image); Column colpic2 = grf.Cols[colPic2]; colpic2.DataType = typeof(String); Column colpic3 = grf.Cols[colPic3]; colpic3.DataType = typeof(Image); Column colpic4 = grf.Cols[colPic4]; colpic4.DataType = typeof(Image); grf.Cols[colPic1].Width = 310; grf.Cols[colPic2].Width = 310; grf.Cols[colPic3].Width = 310; grf.Cols[colPic4].Width = 310; grf.ShowCursor = true; grf.Cols[colPic2].Visible = false; grf.Cols[colPic3].Visible = true; grf.Cols[colPic4].Visible = false; grf.Cols[colPic1].AllowEditing = false; grf.Cols[colPic3].AllowEditing = false; grf.DoubleClick += Grf_DoubleClick; tabPage2.Controls.Add(grf); } } } else { } } }
private void initConfig() { pageLoad = true; fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold); //C1ThemeController.ApplicationTheme = ic.iniC.themeApplication; theme1.Theme = ic.iniC.themeApplication; theme1.SetTheme(sB, "BeigeOne"); //theme1.SetTheme(tC, "Office2010Blue"); sB1.Text = ""; bg = txtSearch.BackColor; fc = txtSearch.ForeColor; ff = txtSearch.Font; stt = new C1SuperTooltip(); sep = new C1SuperErrorProvider(); tabReport = new C1DockingTabPage(); tabReport.Location = new System.Drawing.Point(1, 24); //tabScan.Name = "c1DockingTabPage1"; tabReport.Size = new System.Drawing.Size(667, 175); tabReport.TabIndex = 0; tabReport.Text = "Report"; tabReport.Name = "tabReport"; tC.Controls.Add(tabReport); sCRpt = new C1.Win.C1SplitContainer.C1SplitContainer(); scRptLeft = new C1.Win.C1SplitContainer.C1SplitterPanel(); scRptRight = new C1.Win.C1SplitContainer.C1SplitterPanel(); sCRptReport = new C1.Win.C1SplitContainer.C1SplitContainer(); scRptReportName = new C1.Win.C1SplitContainer.C1SplitterPanel(); scRptReportCriteria = new C1.Win.C1SplitContainer.C1SplitterPanel(); sCRpt.SuspendLayout(); scRptRight.SuspendLayout(); scRptLeft.SuspendLayout(); sCRptReport.SuspendLayout(); scRptReportName.SuspendLayout(); scRptReportCriteria.SuspendLayout(); scRptLeft.Collapsible = true; scRptLeft.Dock = C1.Win.C1SplitContainer.PanelDockStyle.Left; scRptLeft.Location = new System.Drawing.Point(0, 21); scRptLeft.Name = "scRptLeft"; scRptLeft.Controls.Add(sCRptReport); scRptLeft.ClientSize = new Size(20, 80); scRptLeft.Collapsible = true; scRptLeft.SizeRatio = 15; scRptRight.Collapsible = false; scRptRight.Dock = C1.Win.C1SplitContainer.PanelDockStyle.Right; scRptRight.Location = new System.Drawing.Point(0, 21); scRptRight.Name = "scRptRight"; //scRptRight.Controls.Add(day0View); sCRpt.AutoSizeElement = C1.Framework.AutoSizeElement.Both; sCRpt.Name = "sCRpt"; sCRpt.Dock = System.Windows.Forms.DockStyle.Fill; sCRpt.Panels.Add(scRptLeft); sCRpt.Panels.Add(scRptRight); tabReport.Controls.Add(sCRpt); scRptReportCriteria.Collapsible = true; scRptReportCriteria.Dock = C1.Win.C1SplitContainer.PanelDockStyle.Bottom; scRptReportCriteria.Location = new System.Drawing.Point(0, 21); scRptReportCriteria.Name = "scRptReportCriteria"; //scRptLeft.Controls.Add(pnEmailDay0); scRptReportCriteria.ClientSize = new Size(20, 80); scRptReportCriteria.Collapsible = true; scRptReportCriteria.SizeRatio = 25; scRptReportName.Collapsible = false; scRptReportName.Dock = C1.Win.C1SplitContainer.PanelDockStyle.Top; scRptReportName.Location = new System.Drawing.Point(0, 21); scRptReportName.Name = "scRptReportName"; sCRptReport.AutoSizeElement = C1.Framework.AutoSizeElement.Both; sCRptReport.Name = "sCRptReport"; sCRptReport.Dock = System.Windows.Forms.DockStyle.Fill; sCRptReport.Panels.Add(scRptReportCriteria); sCRptReport.Panels.Add(scRptReportName); scRptLeft.ResumeLayout(false); scRptRight.ResumeLayout(false); sCRpt.ResumeLayout(false); scRptReportCriteria.ResumeLayout(false); scRptReportName.ResumeLayout(false); sCRptReport.ResumeLayout(false); scRptLeft.PerformLayout(); scRptRight.PerformLayout(); sCRpt.PerformLayout(); scRptReportCriteria.PerformLayout(); scRptReportName.PerformLayout(); sCRptReport.PerformLayout(); //txtDateStart.Value = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd"); txtDateStart.Value = ""; cboVisitBsp.SelectedItemChanged += CboVisitBsp_SelectedItemChanged; ic.ivfDB.bspDB.setCboBsp(cboVisitBsp, ic.iniC.service_point_id); //btnNew.Click += BtnNew_Click; txtSearch.KeyUp += TxtSearch_KeyUp; //txtDateStart.ValueChanged += TxtDateStart_ValueChanged; txtDateStart.DropDownClosed += TxtDateStart_DropDownClosed; tC.SelectedTabChanged += TC_SelectedTabChanged; btnSearch.Click += BtnSearch_Click; initGrfQue(); initGrfFinish(); initGrfSearch(); initGrfRptName(); initGrfRpt(); int timerlab = 0; int.TryParse(ic.iniC.timerlabreqaccept, out timerlab); timer = new Timer(); timer.Interval = timerlab * 1000; timer.Tick += Timer_Tick; timer.Enabled = true; timer.Start(); pageLoad = false; }