コード例 #1
0
        //Регистрация
        protected void btEnter_Click(object sender, EventArgs e)
        {
            DBConnection connection = new DBConnection();

            if (connection.UnqLogin(tbLogin.Text) != 0)
            {
                lblLogin.Visible = true;
            }
            else
            {
                lblLogin.Visible = true;
                if (tbPassword.Text != tbPasswordConfirm.Text)
                {
                    tbPassword.BackColor        = System.Drawing.Color.Red;
                    tbPasswordConfirm.BackColor = System.Drawing.Color.Red;
                }
                else
                {
                    tbPassword.BackColor        = System.Drawing.Color.White;
                    tbPasswordConfirm.BackColor = System.Drawing.Color.White;
                    DBProcedures dBProcedures = new DBProcedures();
                    dBProcedures.RegistrationUsers(tbFamiliya.Text.ToString(), tbName.Text.ToString(), tbOtchestvo.Text.ToString(),
                                                   tbLogin.Text.ToString(), tbPassword.Text.ToString(), 1);
                    Response.Redirect("Authorization.aspx");
                }
            }
        }
コード例 #2
0
        protected void btInsert_Click(object sender, EventArgs e)
        {
            int        ArendaID;
            SqlCommand command = new SqlCommand("", DBConnection.connection);

            if (DBConnection.userID == 0)
            {
                Response.Redirect("Authorization.aspx");
            }
            else
            {
                decimal Cost;
                command.CommandType = System.Data.CommandType.Text;
                command.CommandText = "SELECT (Cena) FROM [Tovari] where [ID_Tovara] = " + Convert.ToInt32(ddlTovari.SelectedValue) + "";
                DBConnection.connection.Open();
                Cost = Convert.ToDecimal(command.ExecuteScalar().ToString());
                command.ExecuteNonQuery();
                DBConnection.connection.Close();
                int          Sum          = Convert.ToInt32(tbKolichestvo.Text) * Convert.ToInt32(Cost);
                string       time         = DateTime.Now.ToString("h:mm");
                DateTime     theDate      = DateTime.ParseExact(tbDate.Text, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
                string       date         = theDate.ToString("dd.MM.yyyy");
                DBProcedures dBProcedures = new DBProcedures();
                dBProcedures.Arenda_Insert(Convert.ToInt32(ddlTovari.SelectedValue), Convert.ToInt32(tbKolichestvo.Text), Convert.ToInt32(ddlKlienti.SelectedValue), Convert.ToDecimal(Sum));
                command.CommandType = System.Data.CommandType.Text;
                command.CommandText = "SELECT MAX(ID_Order) FROM [Order]";
                DBConnection.connection.Open();
                ArendaID = Convert.ToInt32(command.ExecuteScalar().ToString());
                command.ExecuteNonQuery();
                DBConnection.connection.Close();
                gvFill(QR);
            }
        }
コード例 #3
0
        protected void btUpdate_Click(object sender, EventArgs e)
        {
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Kategorii_Update(DBConnection.selectedRow, tbName.Text);
            tbName.Text = "";
            gvFill(QR);
        }
コード例 #4
0
        protected void btInsert_Click(object sender, EventArgs e)
        {
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Kategorii_Insert(tbName.Text);
            tbName.Text = "";
            gvFill(QR);
        }
コード例 #5
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Tovari_Delete(DBConnection.selectedRow);
            DBConnection.selectedRow = 0;
            gvFill(QR);
            DeleteDate();
        }
コード例 #6
0
        protected void btInsert_Click(object sender, EventArgs e)
        {
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Tovari_Insert(tbNazvanie.Text.ToString(), Convert.ToInt32(tbKolichestvo.Text.ToString()),
                                       Convert.ToDecimal(tbCena.Text.ToString()), Convert.ToInt32(ddlKategorii.SelectedValue));
            gvFill(QR);
            DeleteDate();
        }
コード例 #7
0
        protected void btUpdate_Click(object sender, EventArgs e)
        {
            DateTime     theDate      = DateTime.ParseExact(tbData_Yvolneniya.Text, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            string       date         = theDate.ToString("dd.MM.yyyy");
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Yvolnenie_Update(DBConnection.selectedRow, tbPrichina_yvolneniya.Text, Convert.ToInt32(ddlSotrydniki.SelectedValue.ToString()), date);
            gvFill(QR);
            DeleteDate();
        }
コード例 #8
0
        protected void btUpdate_Click(object sender, EventArgs e)
        {
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Sotrydniki_Update(DBConnection.selectedRow, tbFamiliya.Text, tbName.Text, tbOtchestvo.Text, tbLogin.Text, DBConnection.contractID, tbPassword.Text, false,
                                           Convert.ToInt32(ddlRole.SelectedValue.ToString()));
            gvFill(QR);
            DeleteDate();
            DBConnection.contractID  = 0;
            DBConnection.selectedRow = 0;
        }
コード例 #9
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            SqlCommand command = new SqlCommand("", DBConnection.connection);

            if (DBConnection.selectedRow != 0)
            {
                DBProcedures dBProcedures = new DBProcedures();
                dBProcedures.Arenda_Delete(DBConnection.selectedRow);
                DeleteData();
            }
            gvFill(QR);
        }
コード例 #10
0
        protected void btUpdate_Click(object sender, EventArgs e)
        {
            DBProcedures dBProcedures = new DBProcedures();
            SqlCommand   command      = new SqlCommand("", DBConnection.connection);
            string       time         = DateTime.Now.ToString("h:mm");
            DateTime     theDate      = DateTime.ParseExact(tbDate.Text, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            string       date         = theDate.ToString("dd.MM.yyyy");

            dBProcedures.Arenda_Update(DBConnection.selectedRow, Convert.ToInt32(ddlTovari.SelectedValue), Convert.ToInt32(tbKolichestvo.Text), Convert.ToInt32(ddlKlienti.SelectedValue));
            command.CommandType = System.Data.CommandType.Text;
            DBConnection.connection.Open();
            gvFill(QR);
            DeleteData();
        }
コード例 #11
0
        protected void btInsert_Click(object sender, EventArgs e)
        {
            DBConnection connection = new DBConnection();

            if (connection.UnqLogin(tbLogin.Text) != 0)
            {
                lblError.Visible = true;
            }
            else
            {
                lblError.Visible = false;
                DBProcedures dBProcedures = new DBProcedures();
                dBProcedures.Sotrydniki_Insert(tbFamiliya.Text, tbName.Text, tbOtchestvo.Text, tbLogin.Text, tbPassword.Text, Convert.ToInt32(ddlRole.SelectedValue.ToString()));
                gvFill(QR);
                DeleteDate();
            }
        }
コード例 #12
0
        protected void btInsert_Click(object sender, EventArgs e)
        {
            SqlCommand   command = new SqlCommand("", DBConnection.connection);
            int          orderID;
            DateTime     theDate      = DateTime.ParseExact(tbData_Yvolneniya.Text, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            string       date         = theDate.ToString("dd.MM.yyyy");
            DBProcedures dBProcedures = new DBProcedures();

            dBProcedures.Yvolnenie_Insert(tbPrichina_yvolneniya.Text, Convert.ToInt32(ddlSotrydniki.SelectedValue.ToString()), date);
            command.CommandType = System.Data.CommandType.Text;
            command.CommandText = "SELECT MAX(ID_Fired_Order) FROM [Fired_Order]";
            DBConnection.connection.Open();
            orderID = Convert.ToInt32(command.ExecuteScalar().ToString());
            command.ExecuteNonQuery();
            DBConnection.connection.Close();
            gvFill(QR);
            DeleteDate();
        }
コード例 #13
0
 protected void gvTovari_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         decimal     Cymma;
         GridViewRow rows = gvTovari.SelectedRow;
         DBConnection.selectedRow = Convert.ToInt32(rows.Cells[1].Text);
         Cymma = Convert.ToDecimal(rows.Cells[4].Text);
         DBProcedures dBProcedures = new DBProcedures();
         dBProcedures.Arenda_Insert(DBConnection.selectedRow, 1, DBConnection.userID, Cymma);
     }
     catch
     {
     }
     finally
     {
         gvFill(QR);
         DBConnection.selectedRow = 0;
     }
 }