예제 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            配送管理 frm_配送管理 = new 配送管理();

            frm_配送管理.ShowDialog();
            FileHelper.timelist = GetPeopleMsg.GetTimeList();
            FileHelper.addrList = GetPeopleMsg.GetAddrList();
        }
예제 #2
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            DateTime tmpDt = DateTime.Parse(CurrentDate);

            tmpDt               = tmpDt.Date.AddDays(1);
            txt_Date.Text       = tmpDt.ToLongDateString();
            CurrentDate         = tmpDt.ToLongDateString();
            FileHelper.timelist = GetPeopleMsg.GetTimeList();
            if (tooldoWork != null)
            {
                tooldoWork.Invoke("Date");
            }
        }
예제 #3
0
        private void txt_Date_DoubleClick(object sender, EventArgs e)
        {
            string tDateTime = string.Empty;
            Point  t         = PointToScreen(new Point(txt_Date.Location.X, txt_Date.Location.Y + txt_Date.Height));

            NewOpenManager1.OpenWindow(ref tDateTime, t);
            if (tDateTime == null)
            {
            }
            else
            {
                txt_Date.Text       = tDateTime;
                CurrentDate         = txt_Date.Text;
                FileHelper.timelist = GetPeopleMsg.GetTimeList();
                if (tooldoWork != null)
                {
                    tooldoWork.Invoke("Date");
                }
            }
        }
예제 #4
0
        private void treeView1_DoubleClick(object sender, MouseEventArgs e)
        {
            var tmpControl = treeView1.GetNodeAt(new Point(e.X, e.Y));

            if (tmpControl == null)
            {
                return;
            }
            switch (tmpControl.Text)
            {
            case "主界面":
                frm_MainMenu = New_Form(frm_MainMenu);
                tooldoWork   = frm_MainMenu.doWork;
                if (frm_MainMenu != null)
                {
                    frm_MainMenu.setdgvPos(panel_Parent.Width, panel_Parent.Height);
                }
                break;

            case "机器管理":
                机器管理 frm_机器管理 = new 机器管理();
                frm_机器管理.ShowDialog();
                break;

            case "纸张管理":
                纸张管理 frm_纸张管理 = new 纸张管理();
                frm_纸张管理.ShowDialog();
                break;

            case "价格管理":
                价格管理 frm_价格管理 = new 价格管理();
                frm_价格管理.ShowDialog();
                break;

            case "配送管理":
                配送管理 frm_配送管理 = new 配送管理();
                frm_配送管理.ShowDialog();
                FileHelper.timelist = GetPeopleMsg.GetTimeList();
                FileHelper.addrList = GetPeopleMsg.GetAddrList();
                break;

            case "小票管理":
                //List<GroupMsg> tmpList = new List<GroupMsg>();
                //tmpList.Add( new GroupMsg { GroupName = "150001", Area = "地址", Note = "订单备注",Price = "15.3元", Phone = "189XXXXXXXX",
                //    FileMsgList = new List<FileMsg> { new FileMsg { Printer = "打印机1输出", FileName = "文件名1。。。" , Count = 1, VerForm = emVerForm.单面},
                //                                                            new FileMsg { Printer = "打印机1输出", FileName = "文件名2。。。" , Count = 1, VerForm = emVerForm.单面},
                //                                                            new FileMsg { Printer = "打印机1输出", FileName = "文件名3。。。" , Count = 1, VerForm = emVerForm.正反},
                //                                                            new FileMsg { Printer = "打印机1输出", FileName = "文件名4。。。" , Count = 1, VerForm = emVerForm.单面},
                //                                                            new FileMsg { Printer = "打印机2输出", FileName = "文件名1。。。" , Count = 1, VerForm = emVerForm.正反}} });
                //小票管理 f = new 小票管理();
                //f.CreateMsg(tmpList[0]);
                //f.ShowDialog();
                //f.Dispose();
                //f.Show();
                break;

            case "用户数据库":
                用户数据库 frm_user = new 用户数据库();
                frm_user.ShowDialog();
                break;

            case "账单":
                账单 frm_账单 = new 账单();
                frm_账单.ShowDialog();
                break;
            }
        }
예제 #5
0
 private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (tooldoWork != null)
     {
         if (HitFlag)
         {
             if (e.ClickedItem.Name.Substring(0, 2) == "刷新")
             {
                 ContextMenu contextMenu = new ContextMenu();
                 contextMenu.MenuItems.Add(0, new MenuItem("保存", subMenuItemClick));
                 int i = contextMenu.MenuItems.Add(1, new MenuItem("上次刷新" + ((int)((DateTime.Now - RefreshDateTime).TotalMinutes)).ToString() + "min"));
                 contextMenu.MenuItems[i].Enabled = false;
                 Point p = PointToClient(MousePosition);
                 contextMenu.Show(toolStrip1, p);
             }
             else if (e.ClickedItem.Name.Substring(0, 2) == "开始")
             {
                 ContextMenu contextMenu = new ContextMenu();
                 contextMenu.MenuItems.Add(0, new MenuItem("封面输出", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("合并输出", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("定时输出", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("多线输出", subMenuItemClick));
                 Point p = PointToClient(MousePosition);
                 contextMenu.Show(toolStrip1, p);
             }
             else if (e.ClickedItem.Name.Substring(0, 2) == "删除")
             {
                 ContextMenu contextMenu = new ContextMenu();
                 contextMenu.MenuItems.Add(0, new MenuItem("复制", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("合并", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("拆分", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("预览", subMenuItemClick));
                 contextMenu.MenuItems.Add(0, new MenuItem("中止", subMenuItemClick));
                 Point p = PointToClient(MousePosition);
                 contextMenu.Show(toolStrip1, p);
             }
         }
         else
         {
             if (e.ClickedItem.Name.Substring(0, 2) == "刷新")
             {
                 txt_user.Text   = "";
                 RefreshDateTime = DateTime.Now;
             }
             tooldoWork.Invoke(e.ClickedItem.Name.Substring(0, 2));
             if (e.ClickedItem.Name.Substring(0, 2) == "设置")
             {
                 系统设置 frm_sys = new 系统设置();
                 frm_sys.ShowDialog();
                 sysConfigData.printerName = ConfigClass.GetConfigString("sys", "小票打印机", "");
                 sysConfigData.ShopName    = ConfigClass.GetConfigString("sys", "店铺名称", "");
                 sysConfigData.BarcodePath = ConfigClass.GetConfigString("sys", "二维码路径", "");
                 FileHelper.timelist       = GetPeopleMsg.GetTimeList();
                 FileHelper.addrList       = GetPeopleMsg.GetAddrList();
                 FileHelper.rowMsg         = GetDefaultAddMsg.getMsg();
                 GetPaperType.UpdatePaperList();
                 GetPrinterType.UpdatePrinterList();
                 GetPaperPrice.getPrice();
             }
         }
     }
 }
예제 #6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //File.AppendAllLines(@"E:\代码\C#\Winform\私单\打印管理20190916\20190820\打印管理\打印管理\bin\Debug\log\logtext 20190926 171728.txt",new string[] { "123456"});

            bool b = SQLiteHelper.SQLiteInit(string.Format(@"Data Source={0}\PrintDB.db", Application.StartupPath), "jtmes");

            if (b)
            {
                KeyPreview = true;
                try
                {
                    foreach (var v in toolStrip1.Items)
                    {
                        if (v is ToolStripButton)
                        {
                            ToolStripButton Tbtn = v as ToolStripButton;
                            if (Convert.ToString(Tbtn.Tag) == "1")
                            {
                                Tbtn.Paint     += toolStrip1_Paint;
                                Tbtn.MouseMove += toolStrip1_MouseMove;
                            }
                        }
                    }
                    logFlag = Convert.ToBoolean(ConfigClass.GetConfigString("sys", "log", "true"));
                    LogOperate.Init();
                    LogOperate.Start();
                    LogOperate.Add("软件运行");
                    CurrentPath = ConfigClass.GetConfigString("File", "path", "");
                    if (!Directory.Exists(CurrentPath))
                    {
                        FolderBrowserDialog f = new FolderBrowserDialog();
                        if (f.ShowDialog() == DialogResult.OK)
                        {
                            CurrentPath = f.SelectedPath;
                            ConfigClass.SetConfigString("File", "path", CurrentPath);
                        }
                        else
                        {
                            unInit = true;
                            Application.Exit();
                        }
                    }
                    string strFastPrint = ConfigClass.GetConfigString("Printer", "speed", "false");
                    CK_fastPrint.Checked = strFastPrint.ToUpper() == "TRUE" ? true : false;
                    nFastPrint           = CK_fastPrint.Checked;
                    bool bConvert = Convert.ToBoolean(ConfigClass.GetConfigString("sys", "Convert", "false"));
                    if (bConvert)
                    {
                        timer2.Interval = 1000;
                        timer2.Enabled  = true;
                    }
                    else
                    {
                        fileWatcher.Path = CurrentPath;
                        fileWatcher.EnableRaisingEvents = true;
                    }
                    sysConfigData.printerName = ConfigClass.GetConfigString("sys", "小票打印机", "");
                    sysConfigData.ShopName    = ConfigClass.GetConfigString("sys", "店铺名称", "");
                    sysConfigData.BarcodePath = ConfigClass.GetConfigString("sys", "二维码路径", "");
                    sound = new System.Media.SoundPlayer("Audio.wav");
                    sound.Load();
                    //main.groupList = ConfigClass.LoadCookie<GroupMsg>("cookie.dat");
                    main.groupList = SqlModlus.selectTmpUserMsg();
                    if (main.groupList == null)
                    {
                        main.groupList = new List <GroupMsg>();
                    }
                    foreach (var v in main.groupList)
                    {
                        if (!v.isManual)
                        {
                            List <FileMsg> fmsg = SqlModlus.selectTmpFileMsg(v.UserID);
                            v.FileMsgList = fmsg;
                        }
                    }
                    main.groupList.ForEach(t => t.isPrint = false);
                    main.groupList.RemoveAll(t => t.isRemove == true);
                    txt_Date.Text = DateTime.Now.Date.ToLongDateString();
                    CurrentDate   = txt_Date.Text;

                    FileHelper.timelist = GetPeopleMsg.GetTimeList();
                    FileHelper.addrList = GetPeopleMsg.GetAddrList();
                    FileHelper.rowMsg   = GetDefaultAddMsg.getMsg();
                    GetPaperType.UpdatePaperList();
                    GetPrinterType.UpdatePrinterList();
                    GetPaperPrice.getPrice();

                    GetUserMsg(CurrentPath);
                    WordToPdf.Start();
                    DealControl(new int[] { 0, 0, 0 });
                    CheckForIllegalCrossThreadCalls = false;
                    treeView1.ExpandAll();
                    treeView1.MouseDoubleClick += new MouseEventHandler(treeView1_DoubleClick);
                    txt_path.Text = CurrentPath;
                    //FileHelper.act.BeginInvoke(frm_Main.CurrentPath, callback, null);
                    frm_MainMenu = New_Form(frm_MainMenu);
                    tooldoWork   = frm_MainMenu.doWork;
                    if (frm_MainMenu != null)
                    {
                        frm_MainMenu.setdgvPos(panel_Parent.Width, panel_Parent.Height);
                    }
                    ExcelHelper.Start();
                    frm_MainMenu.refresh("");
                    toolStrip2.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStrip2_ItemClicked);
                    unInit = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("数据库连接异常!");
            }
        }