Ejemplo n.º 1
0
        private static void UpdateLastBackupDate()
        {
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet        ds = new DataSet();

            da.UpdateCommand            = new SqlCommand();
            da.UpdateCommand.Connection = new SqlConnection();
            da.UpdateCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.UpdateCommand.CommandText = "update BookAddInf..[BackupPeriodic] set [BACKUPLASTDATE] = getdate() where ID = 1";
            da.UpdateCommand.Connection.Open();
            da.UpdateCommand.ExecuteNonQuery();
            da.UpdateCommand.Connection.Close();
        }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CurReader = new Reader("", "");
        if (!Page.IsPostBack)
        {
            string f = System.AppDomain.CurrentDomain.BaseDirectory;
            Login1.Focus();
        }
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.SelectCommand            = new SqlCommand();
        DA.SelectCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/Turn"));
        if (Request["pin"] == null)
        {
            return;
        }
        if (Request["baza"] == null)
        {
            return;
        }

        if (Request["baza"] == "1")
        {
            DA.SelectCommand.CommandText = "select avtp.PLAIN avt,zagp.PLAIN zag from BJVVV..DATAEXT A " +
                                           " left join BJVVV..DATAEXT zag on A.IDMAIN = zag.IDMAIN and zag.MNFIELD = 200 and zag.MSFIELD = '$a' " +
                                           " left join BJVVV..DATAEXTPLAIN zagp on zag.ID = zagp.IDDATAEXT " +
                                           " left join BJVVV..DATAEXT avt on A.IDMAIN = avt.IDMAIN and avt.MNFIELD = 700 and avt.MSFIELD = '$a' " +
                                           " left join BJVVV..DATAEXTPLAIN avtp on avt.ID = avtp.IDDATAEXT " +
                                           " where A.IDMAIN = " + Request["PIN"];
        }
        else if (Request["baza"] == "2")
        {
            DA.SelectCommand.CommandText = "select avtp.PLAIN avt,zagp.PLAIN zag from REDKOSTJ..DATAEXT A " +
                                           " left join REDKOSTJ..DATAEXT zag on A.IDMAIN = zag.IDMAIN and zag.MNFIELD = 200 and zag.MSFIELD = '$a' " +
                                           " left join REDKOSTJ..DATAEXTPLAIN zagp on zag.ID = zagp.IDDATAEXT " +
                                           " left join REDKOSTJ..DATAEXT avt on A.IDMAIN = avt.IDMAIN and avt.MNFIELD = 700 and avt.MSFIELD = '$a' " +
                                           " left join REDKOSTJ..DATAEXTPLAIN avtp on avt.ID = avtp.IDDATAEXT " +
                                           " where A.IDMAIN = " + Request["PIN"];
        }
        else
        {
            return;
        }
        DataSet res = new DataSet();

        int i = DA.Fill(res, "t");


        Label1.Text = "Вы собираетесь поставить в очередь на оцифровку издание: <br/> <b>Автор:</b>&nbsp" + res.Tables["t"].Rows[0]["avt"].ToString() + ";&nbsp<b>Заглавие:</b>&nbsp" + res.Tables["t"].Rows[0]["zag"].ToString() +
                      "<br/><br/> Для выполнения этого действия необходимо авторизоваться <br/>";
    }
Ejemplo n.º 3
0
 internal bool IsForAbonement()
 {
     DA  = new SqlDataAdapter();
     con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
     DA.SelectCommand             = new SqlCommand();
     DA.SelectCommand.Connection  = con;
     DA.SelectCommand.CommandText = "select * from BJVVV..DATAEXT A where IDMAIN = " + this.ID +
                                    " and exists (select 1 from BJVVV..DATAEXT B where A.IDMAIN = B.IDMAIN and B.MNFIELD = 899 and B.MSFIELD = '$a' and B.SORT = 'ЦДДАбонемент')";
     DA.Fill(DS, "Name");
     DA.SelectCommand.Connection.Close();
     con.Dispose();
     DA.Dispose();
     return(DS.Tables["Name"].Rows.Count > 0 ? true : false);
 }
Ejemplo n.º 4
0
        public void delFromBasketE(string idr)
        {
            DataSet        DS    = new DataSet();
            SqlDataAdapter sdvig = new SqlDataAdapter();

            //SqlConnection con = new SqlConnection("Data Source=192.168.3.63;Initial Catalog=Reservation;Persist Security Info=True;User ID=Sasha;Password=Corpse536");
            con = new SqlConnection(XmlConnections.GetConnection("/Connections/Zakaz"));
            con.Open();
            sdvig.DeleteCommand = new SqlCommand("delete from Reservation_E..Basket where IDMAIN = " + this.ID + " and IDREADER = " + idr, con);
            sdvig.DeleteCommand.ExecuteNonQuery();
            con.Close();
            con.Dispose();
            sdvig.Dispose();
        }
Ejemplo n.º 5
0
    public void InsertELOPENEDWAR(string sid)
    {
        da.SelectCommand.Parameters.Clear();
        da.SelectCommand.Parameters.Add("idbase", SqlDbType.Int);
        da.SelectCommand.Parameters.Add("idbook", SqlDbType.Int);
        da.SelectCommand.Parameters.Add("sid", SqlDbType.NVarChar);
        da.SelectCommand.Parameters["idbase"].Value = 1;
        da.SelectCommand.Parameters["idbook"].Value = this.IDMAIN;
        da.SelectCommand.Parameters["sid"].Value    = sid;
        da.SelectCommand.CommandText = "select top 1 * from Reservation_R..ELOPEN_WITHOUTAUTHRGHT " +
                                       " where IDMAIN = @idbook and BASE = @idbase and SESSION = @sid order by DATEOPENING desc";
        ds = new DataSet();
        int i = da.Fill(ds, "t");

        if (i > 0)
        {
            return;
        }
        //DataRow r = ds.Tables["t"].Rows[0];

        //if (((DateTime)r["DATEOPENING"]).Date == DateTime.Now.Date)
        //return;
        da.InsertCommand            = new SqlCommand();
        da.InsertCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
        da.InsertCommand.Connection.Open();
        da.InsertCommand.Parameters.Clear();
        da.InsertCommand.Parameters.Add("idbase", SqlDbType.Int);
        da.InsertCommand.Parameters.Add("idbook", SqlDbType.Int);
        da.InsertCommand.Parameters.Add("idr", SqlDbType.Int);
        da.InsertCommand.Parameters.Add("dateopn", SqlDbType.DateTime);
        da.InsertCommand.Parameters.Add("sid", SqlDbType.NVarChar);
        da.InsertCommand.Parameters["idbase"].Value = this.Baza;
        da.InsertCommand.Parameters["idbook"].Value = this.IDMAIN;
        if (this.IDReader == null)
        {
            da.InsertCommand.Parameters["idr"].Value = "0";
        }
        else
        {
            da.InsertCommand.Parameters["idr"].Value = this.IDReader;
        }

        da.InsertCommand.Parameters["dateopn"].Value = DateTime.Now;
        da.InsertCommand.Parameters["sid"].Value     = sid;
        da.InsertCommand.CommandText = "insert into Reservation_R..ELOPEN_WITHOUTAUTHRGHT " +
                                       "(IDMAIN,IDREADER,BASE,DATEOPENING,SESSION) values (@idbook,@idr,@idbase,@dateopn,@sid)";
        da.InsertCommand.ExecuteNonQuery();
        da.InsertCommand.Connection.Close();
    }
Ejemplo n.º 6
0
        public bool IsOrderedAsAligatByCurReader(string idr)
        {
            SqlDataAdapter da;

            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            da  = new SqlDataAdapter("select * from Reservation_O..Orders where ID_Reader = " + idr + " and ALGIDM =" + this.IdmainOfMainAllig, con);
            DataSet ds    = new DataSet();
            int     count = da.Fill(ds);

            if (count > 0)
            {
                return(true);
            }

            da    = new SqlDataAdapter("select * from Reservation_O..Orders where ID_Reader = " + idr + " and ID_Book_EC =" + this.IdmainOfMainAllig, con);
            ds    = new DataSet();
            count = da.Fill(ds);
            if (count > 0)
            {
                return(true);
            }

            da    = new SqlDataAdapter("select * from Reservation_R..ISSUED where IDREADER = " + idr + " and  IDMAIN =" + this.IdmainOfMainAllig, con);
            ds    = new DataSet();
            count = da.Fill(ds);
            if (count > 0)
            {
                return(true);
            }

            da    = new SqlDataAdapter("select * from Reservation_R..ISSUED_OF where IDREADER = " + idr + " and  IDMAIN_CONST = " + this.IdmainOfMainAllig, con);
            ds    = new DataSet();
            count = da.Fill(ds);
            if (count > 0)
            {
                return(true);
            }

            da    = new SqlDataAdapter("select * from Reservation_R..RecievedBooks where  IDREADER = " + idr + " and IDMAIN =" + this.IdmainOfMainAllig + " and RETINBK = 0", con);
            ds    = new DataSet();
            count = da.Fill(ds);
            if (count > 0)
            {
                return(true);
            }
            da.Dispose();
            con.Dispose();
            return(false);
        }
Ejemplo n.º 7
0
        private void DeleteNodeByIDZ(int IDZ)
        {
            SqlDataAdapter da = new SqlDataAdapter();

            da.SelectCommand             = new SqlCommand();
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Connection  = new SqlConnection();
            da.SelectCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.SelectCommand.Parameters.Add("IDZS", SqlDbType.Int);
            da.SelectCommand.Parameters["IDZS"].Value = IDZ;
            da.SelectCommand.CommandText = "PERIOD.dbo.[PI_DEL_VETVJ]";
            da.SelectCommand.Connection.Open();
            da.SelectCommand.ExecuteNonQuery();
            da.SelectCommand.Connection.Close();
        }
Ejemplo n.º 8
0
        private static DateTime GetLastBackUpDate()
        {
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet        ds = new DataSet();

            da.SelectCommand            = new SqlCommand();
            da.SelectCommand.Connection = new SqlConnection();
            da.SelectCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.SelectCommand.CommandText = "select * from BookAddInf..[BackupPeriodic] where ID = 1";
            if (da.Fill(ds, "t") == 0)
            {
                throw new Exception("Не найдена последняя дата бэкапа в базе!");
            }
            return((DateTime)ds.Tables["t"].Rows[0]["BACKUPLASTDATE"]);
        }
Ejemplo n.º 9
0
    protected void delmark_click(object sender, CommandEventArgs e)
    {
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.UpdateCommand             = new SqlCommand();
        DA.UpdateCommand.Connection  = new SqlConnection(XmlConnections.GetConnection("/Connections/Turn"));
        DA.UpdateCommand.CommandText = "update  Reservation_R..TURNTODIGITIZE set MARK = 0 " +
                                       " where ID = " + e.CommandArgument.ToString();
        DA.UpdateCommand.Connection.Open();
        DA.UpdateCommand.ExecuteNonQuery();
        DA.UpdateCommand.Connection.Close();
        LoadData();
        //GridView1.DataBind();
        //GridView1.DataSource = SqlDataSource1;
        //GridView1.DataBind();
    }
Ejemplo n.º 10
0
        private bool IsAlreadyInOrderWithAnotherNote(int reader)
        {
            DataSet DS = new DataSet();

            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            SqlDataAdapter Status = new SqlDataAdapter("select * from Reservation_O..Orders where ID_Book_EC = " + this.IDMAIN + " and ID_Reader = " + reader + " and InvNumber = '" + this.inv + "' and INOTE = '" + this.note + "'", con);

            Status.Fill(DS, "Name");
            Status.Dispose();
            con.Dispose();
            if (DS.Tables["Name"].Rows.Count > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 11
0
        private bool IsELOrderedByCurrentReader(int idr, int rtype)
        {
            DataSet DS = new DataSet();

            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            SqlDataAdapter da = new SqlDataAdapter("select * from Reservation_R..ELISSUED where IDMAIN = " + this.IDMAIN + " and R_TYPE = " + rtype.ToString() + " and IDREADER = " + idr.ToString(), con);
            int            i  = da.Fill(DS, "Name");

            if (i == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 12
0
        private bool IsFiveElBooksIssued(int idr, int rtype)
        {
            DataSet DS = new DataSet();

            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            SqlDataAdapter da = new SqlDataAdapter("select * from Reservation_R..ELISSUED where R_TYPE = " + rtype.ToString() + " and IDREADER = " + idr.ToString(), con);
            int            i  = da.Fill(DS, "Name");

            if (i >= 5)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 13
0
        public Reader(string login, string sess)
        {
            SqlDataAdapter DA = new SqlDataAdapter();

            DA.SelectCommand             = new SqlCommand();
            DA.SelectCommand.Connection  = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
            DA.SelectCommand.CommandText = "select * from Readers.dbo.Main where NumberReader = " + login;
            //DA.SelectCommand.Connection.Open();
            DataSet DS   = new DataSet();
            int     recc = DA.Fill(DS, "Reader");

            this.ID = DS.Tables["Reader"].Rows[0]["NumberReader"].ToString();
            //this.Login = DS.Tables["Reader"].Rows[0]["login"].ToString();
            this.FIO     = DS.Tables["Reader"].Rows[0]["FamilyName"].ToString() + " " + DS.Tables["Reader"].Rows[0]["Name"].ToString() + " " + DS.Tables["Reader"].Rows[0]["FatherName"].ToString();
            this.Session = sess;
            //DA.SelectCommand.Connection.Close();
        }
Ejemplo n.º 14
0
        public void BuildAndInsertHyperLink(string PIN, string year)
        {
            SqlDataAdapter da = new SqlDataAdapter();

            da.UpdateCommand            = new SqlCommand();
            da.UpdateCommand.Connection = new SqlConnection();
            da.UpdateCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.UpdateCommand.Parameters.Add("HL", SqlDbType.NVarChar);
            da.UpdateCommand.Parameters["HL"].Value = @"http://opac.libfl.ru/elcirp/viewer.aspx?pin=" + PIN + "&year=" + year;
            da.UpdateCommand.Parameters.Add("IDZ", SqlDbType.Int);
            da.UpdateCommand.Parameters["IDZ"].Value = GetIDZofHYPERLINKbyPINandYEAR(PIN, year);

            da.UpdateCommand.CommandText = "update PERIOD..PI set POLE = @HL where IDZ = @IDZ";
            da.UpdateCommand.Connection.Open();
            da.UpdateCommand.ExecuteNonQuery();
            da.UpdateCommand.Connection.Close();
        }
Ejemplo n.º 15
0
        private DataRowCollection GetIDZofAllPackagesByHyperLinkIDZ(int IDZ)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet        ds = new DataSet();

            da.SelectCommand            = new SqlCommand();
            da.SelectCommand.Connection = new SqlConnection();
            da.SelectCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.SelectCommand.Parameters.Add("IDZ", SqlDbType.Int);
            da.SelectCommand.Parameters["IDZ"].Value = IDZ;
            da.SelectCommand.CommandText             = "select IDZ from PERIOD..[PI] where IDF = 240 and VVERH = (select VVERH from PERIOD..[PI] where IDZ = @IDZ)";
            if (da.Fill(ds, "t") == 0)
            {
                throw new Exception("Не найден состав комплекта.");
            }
            return(ds.Tables["t"].Rows);
        }
Ejemplo n.º 16
0
    private string GetFolderByIDZ(string idz)
    {
        SqlDataAdapter da;
        DataSet        ds;

        da = new SqlDataAdapter();
        da.SelectCommand            = new SqlCommand();
        da.SelectCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
        ds = new DataSet();
        da.SelectCommand.CommandText = "select top 1 * from BookAddInf..ScanInfo_PER_UPLOAD where IDZ = " + idz + " order by ID desc";
        int i = da.Fill(ds, "t");

        if (i == 0)
        {
            throw new Exception("В базе нет записей по изданию.");
        }
        return(ds.Tables["t"].Rows[0]["TITLE"].ToString() + "\\" + ds.Tables["t"].Rows[0]["YEAR"].ToString());
    }
Ejemplo n.º 17
0
        public string GetPINbyIDZ(int idz)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet        ds = new DataSet();

            da.SelectCommand            = new SqlCommand();
            da.SelectCommand.Connection = new SqlConnection();
            da.SelectCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.SelectCommand.Parameters.Add("IDZ", SqlDbType.Int);
            da.SelectCommand.Parameters["IDZ"].Value = idz;

            da.SelectCommand.CommandText = " select POLE from PERIOD..[PI]  " +
                                           " where IDZ = @IDZ and IDF = 120 ";
            if (da.Fill(ds, "t") == 0)
            {
                throw new Exception("В базе не найден ПИН!");
            }
            return(ds.Tables["t"].Rows[0]["POLE"].ToString());
        }
Ejemplo n.º 18
0
 public void InsertAgreement()
 {
     da.InsertCommand            = new SqlCommand();
     da.InsertCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
     da.InsertCommand.Connection.Open();
     da.InsertCommand.Parameters.Clear();
     da.InsertCommand.Parameters.Add("idbase", SqlDbType.Int);
     da.InsertCommand.Parameters.Add("idbook", SqlDbType.Int);
     da.InsertCommand.Parameters.Add("idr", SqlDbType.Int);
     da.InsertCommand.Parameters.Add("dateagr", SqlDbType.DateTime);
     da.InsertCommand.Parameters["idbase"].Value  = this.Baza;
     da.InsertCommand.Parameters["idbook"].Value  = this.IDMAIN;
     da.InsertCommand.Parameters["idr"].Value     = this.IDReader;
     da.InsertCommand.Parameters["dateagr"].Value = DateTime.Now;
     da.InsertCommand.CommandText = "insert into Reservation_R..AGREEMENT " +
                                    "(IDMAIN,IDREADER,BASE,DATEAGR) values (@idbook,@idr,@idbase,@dateagr)";
     da.InsertCommand.ExecuteNonQuery();
     da.InsertCommand.Connection.Close();
 }
Ejemplo n.º 19
0
 public void DeleteAgreement()
 {
     da.DeleteCommand            = new SqlCommand();
     da.DeleteCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
     da.DeleteCommand.Connection.Open();
     da.DeleteCommand.Parameters.Clear();
     da.DeleteCommand.Parameters.Add("idbase", SqlDbType.Int);
     da.DeleteCommand.Parameters.Add("idbook", SqlDbType.Int);
     da.DeleteCommand.Parameters.Add("idr", SqlDbType.Int);
     da.DeleteCommand.Parameters.Add("dateagr", SqlDbType.DateTime);
     da.DeleteCommand.Parameters["idbase"].Value  = this.Baza;
     da.DeleteCommand.Parameters["idbook"].Value  = this.IDMAIN;
     da.DeleteCommand.Parameters["idr"].Value     = this.IDReader;
     da.DeleteCommand.Parameters["dateagr"].Value = DateTime.Now;
     da.DeleteCommand.CommandText = "Delete from Reservation_R..AGREEMENT " +
                                    " where IDMAIN =@idbook and IDREADER = @idr and BASE = @idbase";
     da.DeleteCommand.ExecuteNonQuery();
     da.DeleteCommand.Connection.Close();
 }
Ejemplo n.º 20
0
        public bool ISExtremistLiterature()//проверить, является ли данная электронная копия экстремистской
        {
            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            SqlDataAdapter da = new SqlDataAdapter("select 1 from BJVVV..DATAEXT  " +

                                                   "where IDMAIN = " + this.IDMAIN + " and MNFIELD = 899 and MSFIELD = '$x' and SORT = 'Э' ", con);
            DataSet ds    = new DataSet();
            int     count = da.Fill(ds, "t");

            da.Dispose();
            con.Dispose();
            if (count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 21
0
        private int AddPackageNode(int IDZ)
        {
            SqlDataAdapter da = new SqlDataAdapter();

            da.SelectCommand             = new SqlCommand();
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Connection  = new SqlConnection();
            da.SelectCommand.Connection.ConnectionString = XmlConnections.GetConnection("/Connections/BJVVV");
            da.SelectCommand.Parameters.Add("IDZ", SqlDbType.Int);
            da.SelectCommand.Parameters["IDZ"].Direction = ParameterDirection.Input;
            da.SelectCommand.Parameters["IDZ"].Value     = IDZ;
            da.SelectCommand.Parameters.Add("IDZ_OUT", SqlDbType.Int);
            da.SelectCommand.Parameters["IDZ_OUT"].Value     = IDZ;
            da.SelectCommand.Parameters["IDZ_OUT"].Direction = ParameterDirection.Output;
            da.SelectCommand.CommandText = "PERIOD.dbo.[PI_ADD_VETVJ_VPRAVO]";
            da.SelectCommand.Connection.Open();
            da.SelectCommand.ExecuteNonQuery();
            da.SelectCommand.Connection.Close();
            return((int)da.SelectCommand.Parameters["IDZ_OUT"].Value);
        }
Ejemplo n.º 22
0
    //private string GetTitle(int idz)
    //{
    //    SqlDataAdapter da;
    //    DataSet ds;
    //    da = new SqlDataAdapter();
    //    da.SelectCommand = new SqlCommand();
    //    da.SelectCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
    //    ds = new DataSet();
    //    da.SelectCommand.CommandText = "select top 1 * from BookAddInf..ScanInfo_PER_UPLOAD where IDZ = " + idz + " order by ID desc";
    //    int i = da.Fill(ds, "t");
    //    if (i == 0)
    //    {
    //        throw new Exception("В базе нет записей по изданию.");
    //    }
    //    return ds.Tables["t"].Rows[0]["TITLE"].ToString();
    //}
    private string GetTitle()
    {
        SqlDataAdapter da;
        DataSet        ds;

        da = new SqlDataAdapter();
        da.SelectCommand            = new SqlCommand();
        da.SelectCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
        ds = new DataSet();
        da.SelectCommand.CommandText = " select B.POLE TITLE from PERIOD..PI A " +
                                       " left join PERIOD..PI B on B.VVERH = A.IDZ" +
                                       " where A.POLE = " + Request["pin"] + " and A.IDF=120 and B.IDF = 121 ";
        int i = da.Fill(ds, "t");

        if (i == 0)
        {
            throw new Exception("В базе нет записей по изданию.");
        }
        return(ds.Tables["t"].Rows[0]["TITLE"].ToString());
    }
Ejemplo n.º 23
0
        private bool IsAlreadyInOrderAsNOTMAINALLIGAT(int reader)
        {
            if (this.inv.Contains("Электронная"))
            {
                return(false);
            }

            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            DataSet        DS     = new DataSet();
            SqlDataAdapter Status = new SqlDataAdapter("select * from Reservation_O..Orders where ALGIDM = " + this.IDMAIN + " and ID_Reader = " + reader, con);

            Status.Fill(DS, "Name");
            con.Dispose();
            Status.Dispose();
            if (DS.Tables["Name"].Rows.Count > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 24
0
        public Reader(string login, string sess)
        {
            this.Type = 0;
            SqlDataAdapter DA = new SqlDataAdapter();

            DA.SelectCommand             = new SqlCommand();
            DA.SelectCommand.Connection  = new SqlConnection(XmlConnections.GetConnection("/Connections/BJVVV"));
            DA.SelectCommand.CommandText = "select * from Readers.dbo.Main where NumberReader = " + login;
            DataSet DS   = new DataSet();
            int     recc = DA.Fill(DS, "Reader");

            this.ID = DS.Tables["Reader"].Rows[0]["NumberReader"].ToString();
            //this.Login = DS.Tables["Reader"].Rows[0]["login"].ToString();
            this.FIO     = DS.Tables["Reader"].Rows[0]["FamilyName"].ToString() + " " + DS.Tables["Reader"].Rows[0]["Name"].ToString() + " " + DS.Tables["Reader"].Rows[0]["FatherName"].ToString();
            this.Session = sess;
            DA.SelectCommand.CommandText = "select * from Readers..ReaderRight where IDReader = " + login;
            DS = new DataSet();
            DA.Fill(DS, "t");
            string retval = string.Empty;

            foreach (DataRow r in DS.Tables["t"].Rows)
            {
                if ((int)r["IDReaderRight"] == 3)
                {
                    retval += "Сотрудник ВГБИЛ; ";
                }
                if ((int)r["IDReaderRight"] == 4)
                {
                    retval += "Индивидуальный абонемент; ";
                }
                if ((int)r["IDReaderRight"] == 5)
                {
                    retval += "Персональный абонемент; ";
                }
                if ((int)r["IDReaderRight"] == 6)
                {
                    retval += "Коллективный абонемент; ";
                }
                this.Abonement = retval.TrimEnd();
            }
        }
Ejemplo n.º 25
0
        private void FillNote(string iddata)
        {
            DA = new SqlDataAdapter();
            DA.SelectCommand = new SqlCommand();
            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            DA.SelectCommand.Connection  = con;
            DA.SelectCommand.CommandText = "select A.PLAIN note " +
                                           "from BJVVV..DATAEXT B " +
                                           "left join BJVVV..DATAEXTPLAIN A on B.ID = A.IDDATAEXT  " +
                                           "where " +
                                           " B.MNFIELD = 899 and B.MSFIELD = '$x' and B.IDDATA = " + iddata;
            DS = new DataSet();
            int cnt2 = DA.Fill(DS, "note");

            if (cnt2 != 0)
            {
                this.note = DS.Tables["note"].Rows[0]["note"].ToString();
            }
            DA.Dispose();
            con.Dispose();
        }
Ejemplo n.º 26
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.UpdateCommand            = new SqlCommand();
        DA.UpdateCommand.Connection = new SqlConnection(XmlConnections.GetConnection("/Connections/Turn"));
        DA.UpdateCommand.Parameters.AddWithValue("delcause", TextBox1.Text);
        DA.UpdateCommand.Parameters.AddWithValue("deldate", DateTime.Now);
        DA.UpdateCommand.CommandText = "update Reservation_R..TURNTODIGITIZE set DELETED = 1, MARK = 0, DELCAUSE = @delcause, DELDATE = @deldate " +
                                       " where ID = " + hfIDOFSELECTEDROW.Value.ToString();
        DA.UpdateCommand.Connection.Open();
        DA.UpdateCommand.ExecuteNonQuery();
        DA.UpdateCommand.Connection.Close();
        //GridView1.DataSource = SqlDataSource1;
        //GridView1.DataBind();
        LoadData();
        //UpdatePanel1.Update();
        //GridView1.DataBind();
        //LoadData();
        //SqlDataSource1.DeleteParameters["id"]. = hfIDOFSELECTEDROW.Value.ToString();
    }
Ejemplo n.º 27
0
        public void OrdE(InvOfBook _inv, int dur, DateTime date, int idr) //перенос из таблицы корзина в таблицу читатели
        {
            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");
            con = new SqlConnection(XmlConnections.GetConnection("/Connections/Zakaz"));
            SqlDataAdapter sdvig = new SqlDataAdapter("select * from Reservation_E..Orders where ID_Book_EC =" + this.ID, con);

            sdvig.Fill(DS, "Name");
            con.Close();
            DataRow r = DS.Tables["Name"].NewRow();

            r["ID_Reader"]   = idr;
            r["ID_Book_EC"]  = ID;
            r["ID_Book_CC"]  = 0; //че сюда загонять?????пока ноль. это номер книги карточного каталога
            r["Status"]      = 0; //изначально статус нулевой
            r["Start_Date"]  = date;
            r["Change_Date"] = date;
            r["InvNumber"]   = _inv.inv;
            r["Form_Date"]   = DateTime.Now;
            r["Duration"]    = dur;
            r["Who"]         = 0;//кто сменил статус
            r["IDDATA"]      = int.Parse(_inv.iddata);
            //r["INOTE"] = _inv.note;
            if (_inv.IsAllig)
            {
                r["ALGIDM"] = _inv.IdmainOfMainAllig;
            }
            DS.Tables["Name"].Rows.Add(r);


            SqlCommandBuilder cb = new SqlCommandBuilder(sdvig);

            sdvig.InsertCommand = cb.GetInsertCommand();

            sdvig.Update(DS.Tables["Name"]);
            con.Dispose();
            sdvig.Dispose();
        }
Ejemplo n.º 28
0
        private void button5_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Продолжить?", "Внимание!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.No)
            {
                return;
            }
            string     store_ip                 = XmlConnections.GetConnection("/Connections/store_ip");
            string     sTargetConnect           = @"\\" + store_ip + @"\BookAddInf\PERIOD\";
            string     sTarget                  = @"\\" + store_ip + @"\BookAddInf\PERIOD\";
            string     sTargetConnectBookAddInf = @"\\" + store_ip + @"\BookAddInf";
            DBScanInfo db = new DBScanInfo();

            Package = "";

            int Number = 1;
            int Total  = new PdfReader(fPDF.FullName).NumberOfPages;

            fp           = new fProgress(Total);
            this.Enabled = false;
            fp.Show();
            Application.DoEvents();

            //преобразовать и скопиировать все изображения номера
            //int Total = new PdfReader(fPDF.FullName).NumberOfPages;
            //fp.ResetProgress(Total, Number, Total);
            try
            {
                CopyPDFToTarget(store_ip, sTarget, fPDF.DirectoryName, fPDF, Number, Total, fp, sTargetConnectBookAddInf);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Произошла ошибка: " + ex.Message + ". Попробуйте еще раз!", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                fp.Close();
                this.Enabled = true;
                return;
            }
        }
Ejemplo n.º 29
0
        private string PreparedForBK()
        {
            if (this.inv.Contains("Электронная"))
            {
                return("");
            }
            con = new SqlConnection(XmlConnections.GetConnection("/Connections/ZakazO"));
            SqlDataAdapter da = new SqlDataAdapter("select * from Reservation_R..RecievedBooks A where A.BAR = '" + this.Bar + "' and A.IDDATA ='" + this.iddata +
                                                   "' and A.RETINBK = 0 and A.PFORBK = 1 ", con);
            DataSet ds    = new DataSet();
            int     count = da.Fill(ds, "t");

            da.Dispose();
            con.Dispose();
            if (count > 0)
            {
                return(ds.Tables["t"].Rows[0]["DEPNAME"].ToString());
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.SelectCommand             = new SqlCommand();
        DA.SelectCommand.Connection  = new SqlConnection(XmlConnections.GetConnection("/Connections/Turn"));
        DA.SelectCommand.CommandText = "with main as ( select row_number() over (order by (A.DELDATE )) num,A.IDMAIN pin,case when A.BAZA = 1 then avtp.PLAIN else ravtp.PLAIN end avt, A.DELDATE dd," +
                                       "case when A.BAZA = 1 then zagp.PLAIN else rzagp.PLAIN end zag,A.CREATED cre,case when A.BAZA = 1 then 'Основной фонд' else 'Фонд редкой книги' end baza, A.ID id,A.DELCAUSE dc " +
                                       " from Reservation_R..TURNTODIGITIZE A " +
                                       " left join BJVVV..DATAEXT zag on A.IDMAIN = zag.IDMAIN and zag.MNFIELD = 200 and zag.MSFIELD = '$a' " +
                                       " left join BJVVV..DATAEXTPLAIN zagp on zag.ID = zagp.IDDATAEXT " +
                                       " left join BJVVV..DATAEXT avt on A.IDMAIN = avt.IDMAIN and avt.MNFIELD = 700 and avt.MSFIELD = '$a' " +
                                       " left join BJVVV..DATAEXTPLAIN avtp on avt.ID = avtp.IDDATAEXT " +
                                       " left join REDKOSTJ..DATAEXT rzag on A.IDMAIN = rzag.IDMAIN and rzag.MNFIELD = 200 and rzag.MSFIELD = '$a' " +
                                       " left join REDKOSTJ..DATAEXTPLAIN rzagp on zag.ID = rzagp.IDDATAEXT " +
                                       " left join REDKOSTJ..DATAEXT ravt on A.IDMAIN = ravt.IDMAIN and ravt.MNFIELD = 700 and ravt.MSFIELD = '$a' " +
                                       " left join REDKOSTJ..DATAEXTPLAIN ravtp on ravt.ID = ravtp.IDDATAEXT " +
                                       " where A.DELETED = 1) " +
                                       " select top 100 * from main   where num<=100 order by num desc";

        DataSet DS = new DataSet();
        int     i  = DA.Fill(DS, "data");

        GridView1.DataSource = DS.Tables["data"];
        ((BoundField)GridView1.Columns[0]).DataField = "num";
        //((BoundField)GridView1.Columns[0]).
        ((BoundField)GridView1.Columns[1]).DataField        = "baza";
        ((BoundField)GridView1.Columns[2]).DataField        = "pin";
        ((BoundField)GridView1.Columns[3]).DataField        = "avt";
        ((BoundField)GridView1.Columns[4]).DataField        = "zag";
        ((BoundField)GridView1.Columns[5]).DataField        = "cre";
        ((BoundField)GridView1.Columns[5]).DataFormatString = "{0:dd.MM.yyyy HH:mm}";
        ((BoundField)GridView1.Columns[6]).DataField        = "dd";
        ((BoundField)GridView1.Columns[7]).DataField        = "dc";

        GridView1.DataBind();
    }