/// <summary> /// Özel Alanlar Sekmesini getiren Metod /// </summary> /// <param name="carikart_id"></param> /// <returns></returns> public carikart_firma_ozel DepokartOzelalanlarGetir(long carikart_id) { #region Query string query = @" --Table[0] Select CK.carikart_id, (select cari_unvan from carikart cr where cr.carikart_id= CK.satin_alma_sorumlu_carikart_id) as satin_alma_sorumlu_unvan, (select cari_unvan from carikart cr where cr.carikart_id= CK.satis_sorumlu_carikart_id) as satis_sorumlu_unvan, CK.baslamatarihi,CK.ozel FROM carikart_firma_ozel CK INNER JOIN carikart C ON c.carikart_id=CK.carikart_id WHERE CK.carikart_id = @carikart_id "; #endregion #region Parameters SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@carikart_id", carikart_id) }; #endregion dt = SqlHelper.ExecuteDataset(ConnectionStrings.SqlConn, CommandType.Text, query, parameters).Tables[0]; carikart_firma_ozel ozelalan = new carikart_firma_ozel(); if (dt != null && dt.Rows.Count > 0) { ozelalan.carikart_id = dt.Rows[0]["carikart_id"].acekaToLong(); ozelalan.baslamatarihi = dt.Rows[0]["baslamatarihi"].acekaToDateTime(); ozelalan.satis_sorumlu_cari_unvan = dt.Rows[0]["satis_sorumlu_unvan"].ToString(); ozelalan.satin_alma_sorumlu_cari_unvan = dt.Rows[0]["satin_alma_sorumlu_unvan"].ToString(); ozelalan.ozel = dt.Rows[0]["ozel"].ToString(); } return(ozelalan); }
private List <carikart_firma_ozel> CarikartFirmaOzelGetir(DataTable dt) { List <carikart_firma_ozel> carikartfirma_ozel = null; if (dt != null && dt.Rows.Count > 0) { carikartfirma_ozel = new List <carikart_firma_ozel>(); for (int i = 0; i < dt.Rows.Count; i++) { carikart_firma_ozel carikart_firma_ozel = new carikart_firma_ozel(); carikart_firma_ozel.carikart_id = Convert.ToInt64("0" + dt.Rows[i]["carikart_id"].ToString()); carikart_firma_ozel.degistiren_carikart_id = Convert.ToInt64(dt.Rows[i]["degistiren_carikart_id"].ToString()); carikart_firma_ozel.degistiren_tarih = Convert.ToDateTime(dt.Rows[i]["degistiren_tarih"].ToString()); carikart_firma_ozel.satin_alma_sorumlu_carikart_id = Convert.ToInt64(dt.Rows[i]["satin_alma_sorumlu_carikart_id"].ToString()); carikart_firma_ozel.satis_sorumlu_carikart_id = Convert.ToInt64(dt.Rows[i]["satis_sorumlu_carikart_id"].ToString()); carikart_firma_ozel.baslamatarihi = dt.Rows[i]["baslamatarihi"].acekaToDateTime().Date; carikart_firma_ozel.ozel = dt.Rows[i]["ozel"].ToString(); carikartfirma_ozel.Add(carikart_firma_ozel); carikart_firma_ozel = null; } } return(carikartfirma_ozel); }