Ejemplo n.º 1
0
    public string GetRegisterToMahatet(string MobileNo, string Fname, string Lname, string address, string pincode, string EmailId)
    {
        int    status, smslength;
        string id = "";

        try
        {
            UserRegistrationBLL balobj = new UserRegistrationBLL();
            CommonCode          cc     = new CommonCode();
            balobj.usrFirstName = Fname;
            balobj.usrLastName  = Lname;
            balobj.usrMobileNo  = MobileNo;
            balobj.usrAddress   = address;
            balobj.usrPIN       = pincode;
            balobj.usrEmailId   = EmailId;
            status = balobj.BLLIsExistUserRegistrationInitial(balobj);
            if (status > 0)
            {
                balobj.usrUserId = System.Guid.NewGuid().ToString();
                Random rnd = new Random();
                balobj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));
                status             = balobj.BLLInsertUserRegistrationInitial(balobj);
                if (status > 0)
                {
                    id = balobj.usrUserId;
                    string myMobileNo      = balobj.usrMobileNo;
                    string myPassword      = cc.DESDecrypt(balobj.usrPassword);
                    string myName          = balobj.usrFirstName;
                    string passwordMessage = "Welcome " + myName + ", to www.mahatet.co.in,Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);
                    smslength = passwordMessage.Length;
                    //cc.SendMessageMahatetSMS("Mahatet", myMobileNo, passwordMessage, smslength);

                    cc.TransactionalSMSCountry("Mahatet", myMobileNo, passwordMessage, smslength, 20);
                }
            }
            else
            {
                DataSet ds = new DataSet();
                ds = balobj.BLLGetUserIdPassword(balobj);
                string name     = Convert.ToString(ds.Tables[0].Rows[0]["FullName"]);
                string password = Convert.ToString(ds.Tables[0].Rows[0]["usrPassword"]);
                password = cc.DESDecrypt(password);
                id       = Convert.ToString(ds.Tables[0].Rows[0]["usrUserid"]);
                string passwordMessage = "Welcome " + name + ", to www.mahatet.co.in,Password is " + password + " " + cc.AddSMS(MobileNo);
                smslength = passwordMessage.Length;
                //cc.SendMessageMahatetSMS("Mahatet", MobileNo, passwordMessage, smslength);

                cc.TransactionalSMSCountry("Mahatet", MobileNo, passwordMessage, smslength, 20);
            }
        }
        catch (Exception ex)
        { }
        // Insert into [Come2MyCityDB].[dbo].[sendercode](ProjectName,Code)values('Mahatet',20)
        return(id);
    }
Ejemplo n.º 2
0
    public string GetRegisterRecord(string MobileNo, string Fname, string Lname, string address, string pincode, string status)
    {
        int    i, smslength;
        string id = "";
        UserRegistrationBLL balobj = new UserRegistrationBLL();
        CommonCode          cc     = new CommonCode();

        balobj.usrFirstName = Fname;
        balobj.usrLastName  = Lname;
        balobj.usrMobileNo  = MobileNo;
        balobj.usrAddress   = address;
        balobj.usrPIN       = pincode;
        i = balobj.BLLIsExistUserRegistrationInitial(balobj);
        if (i > 0)
        {
            balobj.usrUserId = System.Guid.NewGuid().ToString();
            Random rnd = new Random();
            balobj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));
            i = balobj.BLLInsertUserRegistrationInitial(balobj);
            if (i > 0)
            {
                id = balobj.usrUserId;
                string myMobileNo      = balobj.usrMobileNo;
                string myPassword      = cc.DESDecrypt(balobj.usrPassword);
                string myName          = balobj.usrFirstName;
                string passwordMessage = "Welcome " + myName + ", to www.exam.myct.in,for ur First Login Username="******" & Password is " + myPassword + "  " + cc.AddSMS(myMobileNo);
                smslength = passwordMessage.Length;
                cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22);
            }
        }
        else
        {
            if (status == "1")
            {
                DataSet ds = new DataSet();
                ds = balobj.BLLGetUserIdPassword(balobj);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string name     = Convert.ToString(ds.Tables[0].Rows[0]["FullName"]);
                    string password = Convert.ToString(ds.Tables[0].Rows[0]["usrPassword"]);
                    password = cc.DESDecrypt(password);
                    id       = Convert.ToString(ds.Tables[0].Rows[0]["usrUserid"]);
                    string passwordMessage = "Welcome " + name + ", to www.exam.myct.in,Password for ur First Login is " + password + " " + cc.AddSMS(MobileNo);
                    smslength = passwordMessage.Length;
                    cc.TransactionalSMSCountry("OnlineExam", MobileNo, passwordMessage, smslength, 22);
                }
            }
        }
        return(id);
    }