Ejemplo n.º 1
0
 private void fr_SendMailCompleted(object sender, WebServices.SendMailCompletedEventArgs e)
 {
     System.Threading.Thread.Sleep(700);
     WebServices.SALES_INVOICES fr = new WebServices.SALES_INVOICES();
     fr.DeleteDocumentAsync(FILE_NAME_ADRESS);
     fr.DeleteDocumentCompleted += fr_DeleteDocumentCompleted;
 }
Ejemplo n.º 2
0
        private void fr_SendMailCompleted(object sender, WebServices.SendMailCompletedEventArgs e)
        {
            selectrowcount++;
            SelectDrRow = gridView_MUTABAKAT_LISTESI.GetDataRow(selectedRows[selectrowcount]);
            DateTime dtm = DateTime.Now;

            if (e.Result)
            {
                /// GATE_DB VERİ YAZILDI
                using (SqlConnection qcon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["_CONNECTIONSTRING_WEB"].ConnectionString))
                {
                    qcon.Open();
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        string LINE_SQL = @" INSERT INTO dbo.FTR_MUTABAKAT (SIRKET_KODU, GUID, FORM_TURU, UNVANI, DONEM_BILGISI, VERGI_NO, TUTAR    )  
                                                                             Values  (@SIRKET_KODU,@GUID, @FORM_TURU, @UNVANI, @DONEM_BILGISI, @VERGI_NO, @TUTAR )";

                        cmd.CommandText = LINE_SQL;
                        cmd.Parameters.AddWithValue("@SIRKET_KODU", _GLOBAL_PARAMETERS._SIRKET_KODU);
                        cmd.Parameters.AddWithValue("@MUTABAKAT_KODU", _MUTABAKAT_KODU);
                        cmd.Parameters.AddWithValue("@GUID", SelectDrRow["GUID"].ToString().ToUpper());
                        cmd.Parameters.AddWithValue("@FORM_TURU", _MUTABAKAT_FORM_TURU);
                        cmd.Parameters.AddWithValue("@DONEM_BILGISI", _MUTABAKAT_DONEMI);
                        cmd.Parameters.AddWithValue("@UNVANI", SelectDrRow["CARI_ADI"]);
                        cmd.Parameters.AddWithValue("@VERGI_NO", SelectDrRow["VKN"]);
                        cmd.Parameters.AddWithValue("@TUTAR", SelectDrRow["BAKIYE"]);
                        cmd.Parameters.AddWithValue("@ADET", SelectDrRow["ADET"]);
                        cmd.Connection = qcon;
                        cmd.ExecuteNonQuery();
                    }
                }

                using (SqlConnection myConnections = new SqlConnection(_GLOBAL_PARAMETERS._CONNECTIONSTRING_MDB))
                {
                    myConnections.Open();
                    string SQL_ROW = @" UPDATE FTR_FATURA_MUTABAKAT SET ILETISIM_DURUMU=@ILETISIM_DURUMU,MAIL_TARIH=@MAIL_TARIH,MAIL_SAAT=@MAIL_SAAT  Where SIRKET_KODU=@SIRKET_KODU AND GUID=@GUID ";
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        cmd.Parameters.AddWithValue("@SIRKET_KODU", _GLOBAL_PARAMETERS._SIRKET_KODU);
                        cmd.Parameters.AddWithValue("@ILETISIM_DURUMU", "TRUE");
                        cmd.Parameters.AddWithValue("@MAIL_TARIH", dtm.ToString("yyyy-MM-dd"));
                        cmd.Parameters.AddWithValue("@MAIL_SAAT", dtm.ToString("hh:mm:ss"));
                        cmd.Parameters.AddWithValue("@GUID", SelectDrRow["GUID"]);
                        cmd.CommandText = SQL_ROW;
                        cmd.Connection  = myConnections;
                        cmd.ExecuteNonQuery();
                        SelectDrRow["ILETISIM_DURUMU"] = "TRUE";
                    }
                }
            }
            else
            {
                using (SqlConnection myConnections = new SqlConnection(_GLOBAL_PARAMETERS._CONNECTIONSTRING_MDB))
                {
                    myConnections.Open();
                    string SQL_ROW = @" UPDATE FTR_FATURA_MUTABAKAT SET ILETISIM_DURUMU=@ILETISIM_DURUMU,MAIL_TARIH=@MAIL_TARIH,MAIL_SAAT=@MAIL_SAAT  Where SIRKET_KODU=@SIRKET_KODU AND GUID=@GUID ";
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        cmd.Parameters.AddWithValue("@SIRKET_KODU", _GLOBAL_PARAMETERS._SIRKET_KODU);
                        cmd.Parameters.AddWithValue("@ILETISIM_DURUMU", "FALSE");
                        cmd.Parameters.AddWithValue("@MAIL_TARIH", dtm.ToString("yyyy-MM-dd"));
                        cmd.Parameters.AddWithValue("@MAIL_SAAT", dtm.ToString("hh:mm:ss"));
                        cmd.Parameters.AddWithValue("@GUID", SelectDrRow["GUID"]);
                        cmd.CommandText = SQL_ROW;
                        cmd.Connection  = myConnections;
                        cmd.ExecuteNonQuery();
                        SelectDrRow["ILETISIM_DURUMU"] = "FALSE";
                    }
                }
            }
        }