Esempio n. 1
0
        public static MethodReturn RepairDepoRaf(SERVISDEPOLAR depo, string strRaf, decimal servisId)
        {
            MethodReturn ret = new MethodReturn();

            if (depo == null)
            {
                return(ret);
            }

            if (strRaf.isNullOrWhiteSpace())
            {
                strRaf = "1.Raf";
            }

            SERVISDEPORAFLAR foundRaf = R.Query <SERVISDEPORAFLAR>(ret).First(t => t.SERVISDEPOID == depo.ID && t.AD == strRaf).createIsNull();

            if (ret.ok() && foundRaf.IsNew())
            {
                decimal seqId = Convert.ToDecimal(SasonBase.SasonBaseApplicationPool.Get.EbaTestConnector.ExecuteScalar("select SERVISDEPORAFLAR_SEQ.NEXTVAL from dual", ret));
                if (ret.ok())
                {
                    foundRaf.ID           = seqId;
                    foundRaf.KOD          = strRaf;
                    foundRaf.AD           = strRaf;
                    foundRaf.SERVISDEPOID = depo.ID;
                    foundRaf.DURUMID      = 1;

                    ret = foundRaf.Update();
                }
            }

            return(ret);
        }
Esempio n. 2
0
        public static SERVISDEPORAFLAR CreateRaf(SERVISDEPOLAR depo, string strRaf, decimal servisId, MethodReturn mr = null)
        {
            SERVISDEPORAFLAR foundRaf = R.Query <SERVISDEPORAFLAR>(mr).First(t => t.SERVISDEPOID == depo.ID && t.AD == strRaf).createIsNull();

            if (mr.ok() && foundRaf.IsNew())
            {
                decimal seqId = Convert.ToDecimal(SasonBase.SasonBaseApplicationPool.Get.EbaTestConnector.ExecuteScalar("select SERVISDEPORAFLAR_SEQ.NEXTVAL from dual", mr));
                if (mr.ok())
                {
                    foundRaf.ID           = seqId;
                    foundRaf.KOD          = strRaf;
                    foundRaf.AD           = strRaf;
                    foundRaf.SERVISDEPOID = depo.ID;
                    foundRaf.DURUMID      = 1;

                    mr = foundRaf.Update();
                }
            }
            return(foundRaf);
        }