Example #1
0
 public Reporter()
 {
     SasonBaseApplicationPool sasonBaseApplicationPool = AppPool;
 }
Example #2
0
        public static MethodReturn RepairTRCeviri(string tableName, string columnName, decimal ownerId, string dilKarsiligiDeger)
        {
            //exec ceviri_pkg.ekle2 (0, 'BAKIMDEGISIMKALEMLER', 'AD', 676, 'Alçak basýnç Gaz Tahliye Hortumu', 'Turkish');
            MethodReturn mr = new MethodReturn();

            SasonBaseApplicationPool appPool = SasonBaseApplicationPool.Get;
            DataTable dtb = appPool.EbaTestConnector.GetDataTable($@"SELECT  CEV.ID AS CEVIRILER_ID, LID.ID AS LISTELER_ID, LAID.ID AS LISTEALAN_ID FROM 
                (SELECT ID FROM LISTELER WHERE KOD = '{tableName}') LID
                    LEFT JOIN LISTEALANLAR LAID ON LAID.LISTEID = LID.ID AND LAID.KOD = '{columnName}'
                    LEFT JOIN CEVIRILER CEV ON CEV.LISTEALANID = LAID.ID AND CEV.DILID = 0 AND CEV.ALANID = {ownerId}", mr);

            decimal ceviriId    = 0;
            decimal listeAlanId = 0;

            if (dtb.IsNotEmpty())
            {
                ceviriId    = dtb.FirstRow()["CEVIRILER_ID"].cto <decimal>();
                listeAlanId = dtb.FirstRow()["LISTEALAN_ID"].cto <decimal>();
            }
            else
            {
                return(mr);
            }

            if (mr.ok())
            {
                CEVIRILER ceviri = Select.First(t => t.ID == ceviriId);
                if (ceviri.isNull())
                {
                    decimal seqId = Convert.ToDecimal(appPool.EbaTestConnector.ExecuteScalar("select CEVIRILER_SEQ.NEXTVAL from dual", mr));
                    if (mr.ok())
                    {
                        ceviri = new CEVIRILER()
                        {
                            ID          = seqId,
                            LISTEALANID = listeAlanId,
                            DILID       = 0,
                            ALANID      = ownerId,
                        };
                    }
                }

                ceviri.DEGER = dilKarsiligiDeger;

                if (mr.ok())
                {
                    mr = ceviri.Update();
                }
            }

            return(mr);

            /*
             * SELECT
             * CEV.ID
             * FROM
             * (SELECT ID FROM LISTELER WHERE KOD = 'BAKIMDEGISIMKALEMLER') LID
             * LEFT JOIN LISTEALANLAR LAID ON LAID.LISTEID = LID.ID AND LAID.KOD = 'AD'
             * LEFT JOIN CEVIRILER CEV ON CEV.LISTEALANID = LAID.ID AND CEV.DILID = 0 AND CEV.ALANID = 676
             */
        }