public void OrdHis(string oid, string empl) //перенос из таблицы корзина в таблицу читатели { DataSet DS = new DataSet(); //SqlConnection con = new SqlConnection("Data Source=192.168.3.63;Initial Catalog=Reservation;Persist Security Info=True;User ID=Sasha;Password=Corpse536"); SqlConnection con = new SqlConnection(XmlConnections.GetConnection("/Connections/Zakaz")); SqlDataAdapter sdvig = new SqlDataAdapter("select * from Reservation_E..Orders where ID = " + oid, con); int u = sdvig.Fill(DS, "ord"); con.Close(); sdvig = new SqlDataAdapter("select * from Reservation_E..OrdHis where ID_Book_EC = 9999999", con); sdvig.Fill(DS, "ordhis"); DataRow r = DS.Tables["ordhis"].NewRow(); r["ID_Reader"] = DS.Tables["ord"].Rows[0]["ID_Reader"].ToString(); r["ID_Book_EC"] = DS.Tables["ord"].Rows[0]["ID_Book_EC"].ToString(); r["ID_Book_CC"] = DS.Tables["ord"].Rows[0]["ID_Book_CC"].ToString(); //че сюда загонять?????пока ноль. это номер книги карточного каталога r["Status"] = 1; //требование распечатано r["Start_Date"] = DS.Tables["ord"].Rows[0]["Start_Date"].ToString(); r["Change_Date"] = DateTime.Now; r["InvNumber"] = DS.Tables["ord"].Rows[0]["InvNumber"].ToString(); r["Form_Date"] = DS.Tables["ord"].Rows[0]["Form_Date"].ToString(); r["Duration"] = DS.Tables["ord"].Rows[0]["Duration"].ToString(); r["Who"] = empl; //этаж r["OID"] = DS.Tables["ord"].Rows[0]["ID"]; //кто сменил статус r["REFUSUAL"] = DS.Tables["ord"].Rows[0]["REFUSUAL"]; //отказ r["IDDATA"] = DS.Tables["ord"].Rows[0]["IDDATA"]; r["ALGIDM"] = DS.Tables["ord"].Rows[0]["ALGIDM"]; r["DepId"] = DS.Tables["ord"].Rows[0]["DepId"]; DS.Tables["ordhis"].Rows.Add(r); //SqlTransaction tract = new SqlTransaction(); SqlCommandBuilder cb = new SqlCommandBuilder(sdvig); sdvig.InsertCommand = cb.GetInsertCommand(); sdvig.Update(DS.Tables["ordhis"]); }
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); }
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); }