Ejemplo n.º 1
0
        public static CC InsertRec(string Email, string Pwd, string newToken, bool isConfirmed = false)
        {
            CC ccNew = null;

            Db.Transact(() =>
            {
                ccNew = new CC
                {
                    Email       = Email,
                    Pwd         = Pwd,
                    Token       = newToken,
                    InsTS       = DateTime.Now,
                    IsConfirmed = isConfirmed,
                };

                int i = Email.IndexOf('@');
                if (i >= 0)
                {
                    ccNew.Ad = Email.Remove(i);
                }
                else
                {
                    ccNew.Ad = Email;
                }
            });
            Db.Transact(() =>
            {
                HH hh = new HH
                {
                    Ad = ccNew.Ad,
                };
                ccNew.HHroot = hh;
            });

            PP ppNew = PP.InsertRec((long)ccNew.GetObjectNo(), "Örnek", null, null);

            Hlp.SablondanEkle(ppNew.GetObjectNo(), "HHSablon1");
            TT.InsertRec((long)ppNew.Id, "Aile", null, null, null);
            TT.InsertRec((long)ppNew.Id, "Baba", null, null, null);
            TT.InsertRec((long)ppNew.Id, "Anne", null, null, null);
            TT.InsertRec((long)ppNew.Id, "Çocuk1", null, null, null);
            TT.InsertRec((long)ppNew.Id, "Çocuk2", null, null, null);
            TT.InsertRec((long)ppNew.Id, "Araç1", null, null, null);
            TT.InsertRec((long)ppNew.Id, "Araç2", null, null, null);

            return(ccNew);
        }
Ejemplo n.º 2
0
        }                               // Iptal CUP Kullan

        public static CU InsertRec(ulong ccId, string Ad, string Pwd, string PPs)
        {
            CU cuNew = null;

            if (Db.FromId(ccId) is CC cc)
            {
                var NOR = Db.SQL <CU>("select r from CU r where r.CC = ?", cc).Count();
                NOR++;
                Db.Transact(() =>
                {
                    cuNew = new CU()
                    {
                        CC    = cc,
                        Ad    = Ad,
                        Pwd   = Pwd,
                        Email = $"{cc.Email}/{NOR}",
                        PPs   = PPs
                    };
                    cuNew.Token = Hlp.EncodeQueryString(cuNew.Email);
                });
                return(cuNew);
            }
            return(null);
        }