Beispiel #1
0
        private void IrsaliyeBaslikKaydet()
        {
            Int64 vade = 0;

            try
            {
                vade = Convert.ToInt64(txtIrsaliyeNo.Text);
            }
            catch
            {
                MessageBox.Show("Irsaliye No alanýna sayýsal bir deðer girilmelidir");
                return;
            }

            SqlCeConnection CeConn = new SqlCeConnection("DataSource=ankara.sdf");

            CeConn.Open();

            DateTime IrsaliyeTarihi = dc.Getdate;
            Int64    SipNo          = 0;

            string dt    = DateTime.Now.ToString("MM/dd/yyyy");
            string Irsdt = IrsaliyeTarihi.ToString("MM/dd/yyyy");
            string sql   = "insert into " + tabloAd +
                           "(Musteri_Kodu, Belge_No, Tur, Musteri_Adi, Plasiyer_Kodu,Siparis_Tarihi, Teslim_Tarihi, " +
                           " Vade_Gunu, Odeme_Sekli, Teslim_Alan)" +
                           " VALUES (" +
                           " '" + carino.Text + "'," +
                           " '" + txtIrsaliyeNo.Text + "'," +
                           " '" + Tur + "'," +
                           " '" + label7.Text + "'," +
                           " '" + label8.Text + "'," +
                           " '" + dt + "'," +
                           " '" + Irsdt + "',1,'k'," +
                           " '" + comboBox2.Text + "')";

            try
            {
                SqlCeCommand cmd = new SqlCeCommand(sql, CeConn);
                cmd.ExecuteNonQuery();

                cmd.CommandText = "select @@identity";
                SipNo           = Convert.ToInt64(cmd.ExecuteScalar().ToString());

                SiparisNo = SipNo;
            }
            finally
            {
                CeConn.Close();
            }

            DetayKaydet dk = new DetayKaydet(SipNo, label8.Text, tabloAd, false, Tur, Convert.ToInt64(txtIrsaliyeNo.Text));

            dk.Show();
            this.Close();
        }
Beispiel #2
0
        private void Kaydet_Click_1(object sender, EventArgs e)
        {
            if (comboBox1.Text == "" || txtIrsaliyeNo.Text == "" || comboBox2.Text == "")
            {
                MessageBox.Show("Tüm alanlarý doldurunuz.");
            }
            else
            {
                Int64 vade = 0;
                try
                {
                    vade = Convert.ToInt64(txtIrsaliyeNo.Text);
                }
                catch
                {
                    MessageBox.Show("Irsaliye No alanýna sayýsal bir deðer girilmelidir");
                    return;
                }


                if (SiparisNoVarMi(Convert.ToInt64(txtIrsaliyeNo.Text)) == true)
                {
                    DialogResult dr = MessageBox.Show("Bu numara kayýtlýdýr. Düzenlemek istermisun ?", "Dikkat", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);
                    if (dr == DialogResult.Yes)
                    {
                        Int64       SiparisNo = SiparisNoBul(Convert.ToInt64(txtIrsaliyeNo.Text));
                        DetayKaydet dk        = new DetayKaydet(SiparisNo, label8.Text, tabloAd, true, Tur, Convert.ToInt64(txtIrsaliyeNo.Text));
                        dk.Show();
                        this.Close();
                    }
                }
                else
                {
                    IrsaliyeBaslikKaydet();
                }
            }
        }