示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            fBJAuthorization fAuth = new fBJAuthorization("BJVVV");

            fAuth.ShowDialog();
            if (fAuth.DialogResult == DialogResult.Cancel || fAuth.User == null)
            {
                Close();
                return;
            }
            user        = fAuth.User;
            label1.Text = $"{user.SelectedUserStatus.DepName} {user.FIO}";
            //для 0 и 4 этажа требования выводить в одну таблицу.
            if (user.SelectedUserStatus.DepId == 8 || user.SelectedUserStatus.DepId == 15)
            {
                this.ForSQL = $" and mhran.ID in (8, 15) ";
            }
            else
            {
                this.ForSQL = $" and mhran.ID =  {user.SelectedUserStatus.DepId}  ";
            }
            db = new DbForEmployee(this.OrderTableType, this.BASE, this);
        }
示例#2
0
        public PrintBlank(DbForEmployee db_, System.Windows.Forms.DataGridView dg_, string Dept)
        {
            this.db = db_;
            this.dg = dg_;
            pd      = new PrintDocument();
            switch (Dept)
            {
            case "…Хран… Сектор книгохранения - 2 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 2nd floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 3 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 3rd floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 4 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 zero floor";
                break;
            }

            case "…Хран… Сектор книгохранения - Новая периодика":
            {
                //pd.PrinterSettings.PrinterName = "Zebra TLP2844 4th floor";
                pd.PrinterSettings.PrinterName = XmlConnections.GetConnection("/Connections/FourthFloorNewPeriodica");
                break;
            }

            case "…Хран… Сектор книгохранения - 5 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 5th floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 6 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 6th floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 7 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 7th floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 0 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 zero floor";
                break;
            }

            case "…Хран… Сектор книгохранения - Абонемент":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 CDD";
                break;
            }
            }
            //pd.PrinterSettings.PrinterName = "Zebra TLP2844";
            //pd.PrinterSettings.PrinterName = XmlConnections.GetConnection("/Connections/Printer");//"Zebra TLP2844";
            this.printFont = new Font("Arial Unicode MS", 10f);
            //num = this.printFont.Height;
            //pd.PrinterSettings.PrinterName = "Zebra  TLP2844";
            //pd.PrinterSettings.PrinterName = "HP LaserJet M1522 MFP Series PCL 6";
            pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, 490);

            pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
        }
示例#3
0
        public PrintBlankReaders(DbForEmployee db_, System.Windows.Forms.DataGridView dg_, string Dept, Form1 f1)
        {
            this.F1 = f1;
            this.db = db_;
            this.dg = dg_;
            pd      = new PrintDocument();
            switch (Dept)
            {
            case "Книгохранение - 2 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 2nd floor";
                break;
            }

            case "Книгохранение - 3 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 3rd floor";
                break;
            }

            case "Книгохранение - 4 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 zero floor";
                break;
            }

            case "Книгохранение - 5 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 5th floor";
                break;
            }

            case "Книгохранение - 6 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 6th floor";
                break;
            }

            case "Книгохранение - 7 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 7th floor";
                break;
            }

            case "Книгохранение - цоколь":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 zero floor";
                break;
            }

            case "ЦДД - Абонемент":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 CDD";
                break;
            }
            }
            //pd.PrinterSettings.PrinterName = "Zebra TLP2844";
            //pd.PrinterSettings.PrinterName = XmlConnections.GetConnection("/Connections/Printer");//"Zebra TLP2844";
            this.printFont = new Font("Arial Unicode MS", 10f);
            //num = this.printFont.Height;
            //pd.PrinterSettings.PrinterName = "Zebra TLP2844";
            //pd.PrinterSettings.PrinterName = "Zebra  TLP2844";
            F1.SqlDA.SelectCommand             = new SqlCommand();
            F1.SqlDA.SelectCommand.Connection  = F1.SqlCon;
            F1.SqlDA.SelectCommand.CommandText = "select * from Readers..Main where NumberReader = " + dg.SelectedRows[0].Cells["fio"].Value.ToString();
            DataSet DS = new DataSet();

            F1.SqlDA.Fill(DS, "t");
            if ((int)DS.Tables["t"].Rows[0]["WorkDepartment"] == 1)
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, PaperSizeForReaders);
            }
            else
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, PaperSizeForEmployee);
            }

            pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
        }
示例#4
0
        public PrintBlankReaders(DbForEmployee db_, System.Windows.Forms.DataGridView dg_, string Dept, Form1 f1)
        {
            this.F1 = f1;
            this.db = db_;
            this.dg = dg_;
            pd      = new PrintDocument();

            #region PrinterNaming
            switch (Dept)
            {
            case "…Хран… Сектор книгохранения - 2 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 2nd floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 3 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 3rd floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 4 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 zero floor";
                break;
            }

            case "…Хран… Сектор книгохранения - Новая периодика":
            {
                //pd.PrinterSettings.PrinterName = "Zebra TLP2844 4th floor";
                pd.PrinterSettings.PrinterName = XmlConnections.GetConnection("/Connections/FourthFloorNewPeriodica");
                break;
            }

            case "…Хран… Сектор книгохранения - 5 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 5th floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 6 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 6th floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 7 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 7th floor";
                break;
            }

            case "…Хран… Сектор книгохранения - 0 этаж":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 zero floor";
                break;
            }

            case "…Хран… Сектор книгохранения - Абонемент":
            {
                pd.PrinterSettings.PrinterName = "Zebra TLP2844 CDD";

                break;
            }
            }
            #endregion

            this.printFont = new Font("Arial Unicode MS", 10f);
            //pd.PrinterSettings.PrinterName = "Zebra TLP2844";
            //pd.PrinterSettings.PrinterName = "HP LaserJet 5000 Series PCL 5";
            //pd.PrinterSettings.PrinterName = "HP LaserJet M1522 MFP Series PCL 6";


            //Reader = ReaderInfo.GetReader(Convert.ToInt32(dg.SelectedRows[0].Cells["readerid"].Value));
            //ReaderRight EmployeeRight = new ReaderRight();

            //if (Reader.Rights.RightsList.Exists( x => x.ReaderRightValue == ReaderRightsEnum.Employee))
            //{
            //    pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, PaperSizeForReaders);
            //}
            //else
            //{
            //    pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, PaperSizeForEmployee);
            //}

            F1.SqlDA.SelectCommand             = new SqlCommand();
            F1.SqlDA.SelectCommand.Connection  = F1.SqlCon;
            F1.SqlDA.SelectCommand.CommandText = "select * from Readers..ReaderRight where IDReaderRight = 3 and IDReader = " + dg.SelectedRows[0].Cells["readerid"].Value.ToString();
            DataSet DS = new DataSet();
            int     cc = F1.SqlDA.Fill(DS, "t");
            if (cc != 0)
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, PaperSizeForReaders);
            }
            else
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("rdr", 315, PaperSizeForEmployee);
            }

            pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
        }