private void SatislariWebeGonder() { //-- null ise insert 0 ise güncelle 1 ise gönderildi DataTable dt = DB.GetData("select top 100 * from Satislar with(nolock) where GonderildiWS is null "); for (int i = 0; i < dt.Rows.Count; i++) { ArrayList list = new ArrayList(); list.Add(new SqlParameter("@Tarih", Convert.ToDateTime(dt.Rows[i]["Tarih"].ToString()))); list.Add(new SqlParameter("@fkFirma", dt.Rows[i]["fkFirma"].ToString())); list.Add(new SqlParameter("@fkSatisDurumu", dt.Rows[i]["fkSatisDurumu"].ToString())); list.Add(new SqlParameter("@Aciklama", dt.Rows[i]["Aciklama"].ToString())); string sql = @"insert into Satislar (Tarih,fkFirma,fkSatisDurumu,Aciklama) values(@Tarih,@fkFirma,@fkSatisDurumu,@Aciklama)"; string sonuc = DBWeb.ExecuteSQL_Web(sql, list); if (sonuc == "0") { DB.ExecuteSQL("update Satislar set GonderildiWS=1 where pkSatislar=" + dt.Rows[i]["pkSatislar"].ToString()); } } }
private void SatisDetayWebeGonder() { //-- null ise insert 0 ise güncelle 1 ise gönderildi DataTable dt = DB.GetData("select top 100 * from SatisDetay with(nolock) where GonderildiWS is null "); for (int i = 0; i < dt.Rows.Count; i++) { ArrayList list = new ArrayList(); list.Add(new SqlParameter("@fkSatislar", dt.Rows[i]["fkSatislar"].ToString())); list.Add(new SqlParameter("@Tarih", Convert.ToDateTime(dt.Rows[i]["Tarih"].ToString()))); list.Add(new SqlParameter("@fkStokKarti", dt.Rows[i]["fkStokKarti"].ToString())); list.Add(new SqlParameter("@Adet", dt.Rows[i]["Adet"].ToString())); list.Add(new SqlParameter("@SatisFiyati", dt.Rows[i]["SatisFiyati"].ToString().Replace(",", "."))); string sql = @"insert into SatisDetay (Tarih,fkSatislar,fkStokKarti,Adet,SatisFiyati) values(@Tarih,@fkSatislar,@fkStokKarti,@Adet,@SatisFiyati)"; string sonuc = DBWeb.ExecuteSQL_Web(sql, list); if (sonuc == "0") { DB.ExecuteSQL("update SatisDetay set GonderildiWS=1 where pkSatisDetay=" + dt.Rows[i]["pkSatisDetay"].ToString()); } } }