Example #1
0
        private string ResultCRC(Client client)
        {
            string crc = client.GetParam("OutSum") + ":" + client.GetParam("InvId") + ":" + "12311974b";

            Console.WriteLine(crc);
            return(BaseFuncs.MD5(crc).ToUpper());
        }
Example #2
0
        public string SetNewCookie(Client client)
        {
            string cookie = BaseFuncs.MD5(new Random().Next() + "CRT" + Environment.TickCount);

            //client.SetCookie.Add("Cart", cookie);
            client.SetCookie("Cart", new Cookie(cookie));
            return(cookie);
        }
Example #3
0
        public bool Authorize(string Login, string Pswd, Client client)
        {
            Partner partner = this.GetByLogin(Login);

            if (partner != null && partner.Password == BaseFuncs.MD5(Pswd))
            {
                partner.UserSession = this.GetRandomUserSession();
                client.SetCookie("PartnerSession", new Cookie(partner.UserSession));
                this.UpdateUserSession(partner.UserSession, partner.ID);
                return(true);
            }
            return(false);
        }
Example #4
0
        public Partner CreatePartner(Partner partner)
        {
            if (partner.Name.Length > 0 && partner.Login != null && partner.Password.Length > 0)
            {
                if (this.GetByLogin(partner.Login) == null)
                {
                    partner.Password = BaseFuncs.MD5(partner.Password);
                    return(this.GetByID(DBConnector.manager.InsertQueryReturn(partner)));
                }
            }

            return(null);
        }
Example #5
0
        public string SignatureValue(Order order)
        {
            string mrh_pass1 = "12311974a";

            return(BaseFuncs.MD5(this.mrh_login + ":" + order.TotalCost.ToString() + ".00:" + order.ID + ":" + mrh_pass1));
        }
Example #6
0
 private string GetRandomUserSession()
 {
     return(BaseFuncs.MD5(new Random().Next() + "prtnr" + Environment.TickCount));
 }