Esempio n. 1
0
    public void UserRegistrationIntial()
    {
        try
        {
            if (txtFirstName.Text == "")
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter the Frist Name..!')", true);
            }
            else if (txtLastName.Text == "")
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter the Last Name..!')", true);
            }
            else if (txtMobileNumber.Text == "")
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter the Mobile No..!')", true);
            }
            else
            {
                urUserRegBLLObj.usrUserId     = System.Guid.NewGuid().ToString();
                urUserRegBLLObj.usrMobileNo   = Convert.ToString(txtMobileNumber.Text);
                urUserRegBLLObj.usrAddress    = Convert.ToString(txtAddress.Text);
                urUserRegBLLObj.usrFirstName  = Convert.ToString(txtFirstName.Text);
                urUserRegBLLObj.usrLastName   = Convert.ToString(txtLastName.Text);
                urUserRegBLLObj.usrStateId    = Convert.ToInt32(Session["State"]);
                urUserRegBLLObj.usrDistrictId = Convert.ToInt32(Session["District"]);
                urUserRegBLLObj.usrCityId     = Convert.ToInt32(Session["City"]);
                urUserRegBLLObj.usrGender     = Convert.ToString(rdoGender.SelectedValue);
                urUserRegBLLObj.frnrelGroup   = "1";
                cityBLLObj.cityId             = Convert.ToInt32(Session["City"]);
                //For Createing Password & Encrypting it

                Random rnd = new Random();
                urUserRegBLLObj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));
                status = urUserRegBLLObj.BLLIsExistUserRegistrationInitial(urUserRegBLLObj);

                if (status == 0)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User already Exists')", true);
                }
                else
                {
                    status = urUserRegBLLObj.BLLInsertUserRegistrationInitial(urUserRegBLLObj);

                    if (status > 0)
                    {
                        string myMobileNo = urUserRegBLLObj.usrMobileNo;
                        string myPassword = cc.DESDecrypt(urUserRegBLLObj.usrPassword);
                        string myName     = urUserRegBLLObj.usrFirstName;

                        string passwordMessage = "Dear " + myName + ", Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);
                        int    smslength       = passwordMessage.Length;
                        cc.TransactionalSMSCountry("Website", myMobileNo, passwordMessage, smslength, 7);
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Registration is Successful.Your Password will be delivered shortly on your mobile. Use it to Sign In your account.')", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Registration UnSuccessful')", true);
                    }
                }
                ClearAll();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 2
0
    public void ChangeRegisteredMobileNo()
    {
        try
        {
            urUserRegBLLObj.usrUserId   = Convert.ToString(Session["User"]);
            urUserRegBLLObj.usrMobileNo = txtNewMobileNo.Text;
            Random rnd = new Random();
            urUserRegBLLObj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));
            string MobileNo = Convert.ToString(txtNewMobileNo.Text);
            if (MobileNo.Length == 10)
            {
                status = urUserRegBLLObj.BLLIsExistUserRegistrationInitial(urUserRegBLLObj);

                if (status == 0)
                {
                    txtNewMobileNo.Text = "";
                    txtNewMobileNo.Focus();
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Given New Mobile Number already registered in come2mycity.com')", true);

                    // System.Windows.Forms.MessageBox.Show("Given New Mobile Number already registered in come2mycity.com", "Come2MyCity");
                }
                else
                {
                    status = urUserRegBLLObj.BLLUserRegisteredMobileNoUpdate(urUserRegBLLObj);
                    Response.Write("<script>alert('Mobile number Changed.Login Again')</script>");
                    if (status > 0)
                    {
                        string senderId = "COM2MYCT";
                        //string myMobileNo = "91" + urUserRegBLLObj.usrMobileNo;
                        string myMobileNo      = urUserRegBLLObj.usrMobileNo;
                        string myPassword      = cc.DESDecrypt(urUserRegBLLObj.usrPassword);
                        string myName          = Convert.ToString(Session["userName"]);
                        string passwordMessage = "Dear " + myName + ",Password for ur Login with your New Registered Mobile No is:" + myPassword + " " + cc.AddSMS(myMobileNo);

                        cc.SendMessage1(senderId, myMobileNo, passwordMessage);
                        cc.SendMessageImp1(senderId, myMobileNo, passwordMessage);
                        // ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Mobile number Changed.Login Again')", true);
                        Response.Write("<script>alert('Mobile number Changed.Login Again')</script>");
                        // System.Windows.Forms.MessageBox.Show("Mobile number Changed Successfully.Login Again", "Come2MyCity");
                        Response.Redirect("Logout.aspx");
                    }
                    else
                    {
                        // ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Mobile number Not changed.')", true);
                        Response.Write("<script>alert('Mobile number Not changed.')</script>");
                        // System.Windows.Forms.MessageBox.Show("Mobile number Not changed.Please try again", "Come2MyCity");
                        txtNewMobileNo.Text = "";
                    }
                }
            }
            else
            {
                Response.Write("<script>alert('please Enter the 10 Disit mobile No..!')</script>");
            }
        }
        catch (Exception ex)
        {
            // throw ex;
        }
    }
Esempio n. 3
0
    //---------------------------------------------------User Registration---------------------------------------------------------------------------

    #region UserRegistration
    public string UserRegistration(string Username, string MobileNo, string usrEmailId, string usrGender, string Age)
    {
        string userid = "";

        try
        {
            //string[] FullName = Username.Split(' ');
            //string fname = Convert.ToString(FullName[0].Trim());
            //string lname = Convert.ToString(FullName[1].Trim());

            userid = System.Guid.NewGuid().ToString();
            Random rnd = new Random();
            string pwd = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));

            string Sql = "insert into usermaster(usrUserId,usrFirstName,usrMobileNo,usrPassword,usrEmailId,usrGender,Age)" +
                         " values('" + userid + "','" + Username + "','" + MobileNo + "','" + pwd + "','" + usrEmailId + "','" + usrGender + "','" + Age + "')";
            int ID = cc.ExecuteNonQuery(Sql);
            if (ID == 1)
            {
                string myPassword      = cc.DESDecrypt(pwd);
                string passwordMessage = "Dear " + Username + ", Password for ur First Login is " + myPassword + " " + cc.AddSMS(MobileNo);
                int    smslength       = passwordMessage.Length;
                cc.TransactionalSMSCountry("Website", MobileNo, passwordMessage, smslength, 7);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(userid);
    }
Esempio n. 4
0
    //------------------------------------------------------User Registration To MYCT------------------------------------------------------------------

    #region GetRegistration
    public string GetRegisterRecord(string MobileNo, string Fname, string Lname, string address, string pincode, string strDevId)
    {
        int     i, smslength;
        string  id = "";
        DataSet ds = new DataSet();

        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.StrDevId     = strDevId;
            i = balobj.BLLIsExistUserRegistrationInitial(balobj);//check user is exist or not if i = 0 then already exist
            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 + ",for ur First Login Username="******" & Password is " + myPassword + "  " + cc.AddSMS(myMobileNo);
                    smslength = passwordMessage.Length;
                    cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22);

                    //------------------------------ For Dublicate IMEI number....................

                    string sql3 = "select [usrMobileNo] from usermaster where strDevId = '" + strDevId + "'";//takes all mobile number who have same IMEI number
                    ds = cc.ExecuteDataset(sql3);

                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        if (row[0].Equals(MobileNo))
                        {
                        }
                        else
                        {
                            string sql = "update usermaster set StrDevId = '0' where [usrMobileNo] ='" + row[0] + "' ";
                            int    j   = cc.ExecuteNonQuery(sql);
                        }
                    }
                }
            }
            else
            {
                string sqlget = "select usrUserid from usermaster where usrMobileNo='" + MobileNo + "'";//geting userid of user
                id = cc.ExecuteScalar(sqlget);

                string sql2 = "select strDevId from usermaster where usrUserid='" + id + "' ";
                string str  = cc.ExecuteScalar(sql2);

                if (str == "" || str == null || str == "0")                                                            // If IMEI no is null
                {
                    string sql = "Update usermaster set StrDevId = '" + strDevId + "' where usrUserid ='" + id + "' "; //to add/update IMEI no's for old entries
                    int    j   = cc.ExecuteNonQuery(sql);
                }
                string sql3 = "select [usrMobileNo] from usermaster where strDevId = '" + str + "'";//takes all mobile number who have same IMEI number
                ds = cc.ExecuteDataset(sql3);

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (row[0].Equals(MobileNo))
                    {
                    }
                    else
                    {
                        string sql = "update usermaster set StrDevId = '0' where [usrMobileNo] ='" + row[0] + "' ";
                        int    j   = cc.ExecuteNonQuery(sql);
                    }
                }
            }
        }
        catch (Exception ex)
        { }
        return(id);
    }
Esempio n. 5
0
    //------------------------------------------------------User Registration To MYCT------------------------------------------------------------------

    #region RegToUserMaster
    public string RegToUserMaster(string MobileNo, string Fname, string Lname, string address, string pincode, string strDevId)
    {
        string uid = String.Empty;

        string str = "select usrUserId from [Come2myCityDB].[dbo].[UserMaster] where usrMobileNo='" + MobileNo + "'  ";

        uid = cc.ExecuteScalar(str);
        if (uid == "" || uid == null)
        {
            string newUid   = System.Guid.NewGuid().ToString();
            Random rnd      = new Random();
            string Password = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));

            cmd.Parameters.AddWithValue("@usrMobileNo", MobileNo);
            cmd.Parameters.AddWithValue("@usrFirstName", Fname);
            cmd.Parameters.AddWithValue("@usrLastName", Lname);
            cmd.Parameters.AddWithValue("@usrPassword", Password);
            cmd.Parameters.AddWithValue("@usrAddress", address);
            cmd.Parameters.AddWithValue("@usrPIN", pincode);
            cmd.Parameters.AddWithValue("@strDevId", strDevId);
            cmd.Parameters.AddWithValue("@usrUserId", newUid);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "uspUserMasterInsert";
            cmd.Connection  = con;
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }

            int i = cmd.ExecuteNonQuery();
            //----------Send SMS---------------------
            if (i > 0)
            {
                string myMobileNo      = MobileNo;
                string myPassword      = cc.DESDecrypt(Password);
                string myName          = Fname;
                string passwordMessage = "Welcome " + myName + ",for ur First Login for MyCt Password Username="******" & Password is " + myPassword + "  " + cc.AddSMS(myMobileNo);
                int    smslength       = passwordMessage.Length;
                cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22);
            }
            uid = newUid;
        }

        return(uid);
    }
Esempio n. 6
0
    //Change the Password for particular user
    public void ChangePassword()
    {
        bool flag = false;

        try
        {
            urUserRegBLLObj.usrUserId         = Convert.ToString(Session["User"]);
            urUserRegBLLObj.usrPassword       = cc.DESEncrypt(txtOldPasswod.Text);
            urUserRegBLLObj.usrChangePassword = cc.DESEncrypt(txtConfirmNewPassword.Text);

            status = urUserRegBLLObj.BLLUserRegistrationChangePassword(urUserRegBLLObj);
            if (status > 0)
            {
                List <UserRegistrationBLL> usrInfoList = new List <UserRegistrationBLL>();
                DataTable dtUserInfoList   = urUserRegBLLObj.BLLGetUserDetails(urUserRegBLLObj);
                DataRow   dRowUserInfoList = dtUserInfoList.Rows[0];

                //string myMobileNo = "91" + Convert.ToString(dRowUserInfoList["usrMobileNo"]);

                string myMobileNo = Convert.ToString(dRowUserInfoList["usrMobileNo"]);
                string myPassword = cc.DESDecrypt(Convert.ToString(dRowUserInfoList["usrPassword"]));
                string myName     = Convert.ToString(dRowUserInfoList["usrFirstName"]);

                // string mPassword = cc.DESDecrypt(urUserRegBLLObj.usrChangePassword);
                int    result   = onlineexam.UpdatePwd(myMobileNo, Convert.ToString(dRowUserInfoList["usrPassword"]));
                string sendFrom = "COM2MYCT";

                string passwordMessage = "Dear " + myName + ",Your a/c password changed for come2mycity.com.New Password is: " + myPassword + " " + cc.AddSMS(myMobileNo);


                //  ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password  changed')", true);
                //string msg = "Your New Password is: " + cc.DESDecrypt(urUserRegBLLObj.usrChangePassword);
                flag = cc.SendMessageImp1(sendFrom, myMobileNo, passwordMessage);
                flag = cc.SendMessage1(sendFrom, myMobileNo, passwordMessage);

                if (flag == true)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Changed Successfully...Password will be devlivered shortly on your registered Mobile No.')", true);
                    // System.Windows.Forms.MessageBox.Show("Password Changed Successfully...Password will be devlivered shortly on your registered Mobile No.", "Come2MyCity");
                    // Response.Redirect("MyProfile.aspx");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Changed Successfully...Password will be devlivered shortly on your registered Mobile No.')", true);
                    //ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Changed Successfully But Message is not sent')", true);
                    // System.Windows.Forms.MessageBox.Show("Password Changed Successfully But Message is not sent", "Come2MyCity");
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Not changed')", true);
                // System.Windows.Forms.MessageBox.Show("Password Not changed", "Come2MyCity");
            }
        }
        catch (Exception ex)
        {
            //throw ex;
        }
        ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password Not changed')", true);
    }
Esempio n. 7
0
    public string GetRegisterRecordUva(string MobileNo, string Fname, string Lname, string address, string pincode)
    {
        int    status, 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;
        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.uva.myct.in,Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);
                smslength = passwordMessage.Length;
                // cc.SendMessageUvaSMS("Uva Jagar", myMobileNo, passwordMessage, smslength);

                cc.TransactionalSMSCountry("Uva Jagar", 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.uva.myct.in,Password is " + password + " " + cc.AddSMS(MobileNo);
            smslength = passwordMessage.Length;
            //cc.SendMessageUvaSMS("Uva Jagar", MobileNo, passwordMessage, smslength);

            cc.TransactionalSMSCountry("Uva Jagar", MobileNo, passwordMessage, smslength, 20);
        }
        return(id);
    }
Esempio n. 8
0
    public string SendOTP(string CategoryId, string MobileNo, string IEMINo)
    {
        int    result  = 0;
        string imei    = string.Empty;
        string mobieno = string.Empty;
        string cid     = string.Empty;
        string otpstr  = string.Empty;
        string OTPstr  = string.Empty;
        string str0    = string.Empty;
        string str1    = string.Empty;
        string catName = string.Empty;

        string  st = "select categoryId,MobileNo,IEMINo from [Come2myCityDB].[dbo].[Item] where categoryId='" + CategoryId + "' and MobileNo='" + MobileNo + "'";
        DataSet ds = cc.ExecuteDataset(st);

        string count = ds.Tables[0].Rows.Count.ToString();

        if (ds.Tables[0].Rows.Count > 0)
        {
            imei    = ds.Tables[0].Rows[0]["IEMINo"].ToString();
            mobieno = ds.Tables[0].Rows[0]["IEMINo"].ToString();
            cid     = ds.Tables[0].Rows[0]["IEMINo"].ToString();
        }


        if (count == "" || count == null || count == "0")
        {
            string st1 = "select categoryName from [Come2myCityDB].[dbo].[Category] where categoryId='" + CategoryId + "'";
            ds      = cc.ExecuteDataset(st1);
            catName = ds.Tables[0].Rows[0][0].ToString();
            string o = "select [IEMINo],[MobileNo],[CategoryId],[OTP] FROM [Come2myCityDB].[dbo].[MyCtAppROTP] where IEMINo='" + IEMINo + "' and MobileNo='" + MobileNo + "' and CategoryId='" + CategoryId + "' ";
            ds = cc.ExecuteDataset(o);

            if (ds.Tables[0].Rows.Count > 0)
            {
                otpstr = Convert.ToString(ds.Tables[0].Rows[0]["OTP"]);
            }
            else
            {
                Random rand = new Random();
                otpstr = rand.Next(1001, 9999).ToString();
                str0   = "Insert into [Come2myCityDB].[dbo].[MyCtAppROTP]([IEMINo],[MobileNo],[CategoryId],[OTP]) values('" + IEMINo + "','" + MobileNo + "','" + CategoryId + "','" + otpstr + "')";
                result = cc.ExecuteNonQuery(str0);
            }

            //----------Send SMS---------------------
            if (result > 0)
            {
                string myMobileNo = MobileNo;
                OTPstr = otpstr;
                //string myName = firstname;
                string passwordMessage = "Dear Sir, Your Username is " + myMobileNo + " & OTP is " + OTPstr + " for  " + catName + " registration  " + cc.AddSMS(myMobileNo);
                int    smslength       = passwordMessage.Length;
                cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22);
            }
            return("SUCCESS");
        }
        else if (imei.ToString() == IEMINo.ToString() && mobieno.ToString() == MobileNo.ToString() && cid.ToString() == CategoryId.ToString())
        {
            return("UPDATE");
        }
        else
        {
            string o1 = "select [IEMINo],[MobileNo],[CategoryId],[OTP] FROM [Come2myCityDB].[dbo].[MyCtAppROTP] where IEMINo='" + IEMINo + "' and MobileNo='" + MobileNo + "' and CategoryId='" + CategoryId + "' ";
            ds = cc.ExecuteDataset(o1);

            if (ds.Tables[0].Rows.Count > 0)
            {
                otpstr = Convert.ToString(ds.Tables[0].Rows[0]["OTP"]);
            }
            else
            {
                Random rand = new Random();
                otpstr = rand.Next(1001, 9999).ToString();
                str1   = "Insert into [Come2myCityDB].[dbo].[MyCtAppROTP]([IEMINo],[MobileNo],[CategoryId],[OTP]) values('" + IEMINo + "','" + MobileNo + "','" + CategoryId + "','" + otpstr + "')";
                result = cc.ExecuteNonQuery(str1);
            }

            //----------Send SMS---------------------
            if (result > 0)
            {
                string myMobileNo = MobileNo;
                OTPstr = otpstr;
                //string myName = firstname;
                string passwordMessage = "Welcome , Your OTP Verification for Myct ur Username="******" & OTP is " + OTPstr + "  " + cc.AddSMS(myMobileNo);
                int    smslength       = passwordMessage.Length;
                cc.TransactionalSMSCountry("OnlineExam", myMobileNo, passwordMessage, smslength, 22);
            }
            return("IEMEI");
        }
    }
Esempio n. 9
0
    public void AddFriendByLongCodeF(UserRegistrationBLL ur, string userMobileWhoSendFriendReq, int grid)
    {//Mahesh: Use second parameter mobile for only send sms only, because at run time mobile number of sender change.
        try
        {
            string sender  = "";
            string joiner  = "";
            bool   JoinAll = false;
            string flagMob = ur.usrAltMobileNo;
            status = urRegistBll.BLLIsExistUserRegistrationInitial(ur);
            if (status == 0)
            {
                status = urRegistBll.BLLIsExistUserRegistrationInitialByLc(ur);
                if (status == 0)
                {
                    string sqlFlagStr = "select JoinFlag from userMaster where usrMobileNo='" + flagMob.ToString() + "'";
                    int    jof        = Convert.ToInt32(cc.ExecuteScalar(sqlFlagStr));
                    if (jof > 1)
                    {
                        JoinAll         = true;
                        ur.JoinFlagProp = Convert.ToString(jof);
                    }
                    //DataTable dt1 = new DataTable();
                    string  sql = "select usrUserId, usrFirstName,usrCityId from UserMaster where usrMobileNo='" + ur.usrMobileNo + "'";
                    DataSet ds  = new DataSet();
                    ds = cc.ExecuteDataset(sql);
                    //dt1 = ds.Tables[0];
                    string userId;
                    string usrName = "";
                    int    cityId;
                    foreach (DataRow dr1 in ds.Tables[0].Rows)
                    {
                        userId            = Convert.ToString(dr1["usrUserId"]);
                        usrName           = Convert.ToString(dr1["usrFirstName"]);
                        cityId            = Convert.ToInt32(dr1["usrCityId"]);
                        ur.frnrelFriendId = userId;
                        ur.usrCityId      = cityId;
                        joiner            = Convert.ToString(usrName);
                        //ur.frnrelFrnRelName = usrName;
                        //ur.frnrelRelation = "friend";
                        //ur.frnrelGroup = "1";
                    }
                    string  sql1 = "select usrUserId, usrFirstName from UserMaster where usrMobileNo='" + ur.usrAltMobileNo + "'";
                    DataSet ds1  = new DataSet();
                    ds1 = cc.ExecuteDataset(sql1);
                    //dt1 = ds.Tables[0];
                    string FriId;
                    string FriName;
                    foreach (DataRow dr2 in ds1.Tables[0].Rows)
                    {
                        FriId               = Convert.ToString(dr2["usrUserId"]);
                        FriName             = Convert.ToString(dr2["usrFirstName"]);
                        ur.frnrelUserId     = FriId;
                        ur.frnrelFrnRelName = FriName;
                        ur.frnrelRelation   = "friend";
                        sender              = Convert.ToString(FriName);
                        //ur.frnrelGroup = "1";
                        //status = ur.BLLInsertUserFriendRelative(ur);
                        ur.frnrelGroup = Convert.ToString(grid);
                    }

                    status = ur.BLLInsertUserFriendRelative(ur);
                    if (status > 0)
                    {
                        string SendTo   = ur.usrAltMobileNo;
                        string sendFrom = ur.usrMobileNo;
                        string message  = "I " + usrName + "(" + sendFrom.ToString() + ") added u in www.myct.in to send SMS." + cc.AddSMS(SendTo);

                        cc.SendMessage1(sendFrom, SendTo, message);
                        if (JoinAll == true)
                        {
                            string resJoinAll = "Thanks " + joiner.ToString() + ", I " + sender.ToString() + "( " + SendTo.ToString() + " ) also added u on www.myct.in " + cc.AddSMS(sendFrom);
                            cc.SendMessage1(SendTo, sendFrom, resJoinAll);
                        }
                        string changeFlagSql = "update come2mycity.test set FlagStatus = 0 where PK=" + Convert.ToInt32(ur.usrPKval);
                        int    pkchange      = 0;
                        pkchange = cc.ExecuteNonQuery(changeFlagSql);
                        if (pkchange == 0)
                        {
                            pkchange = cc.ExecuteNonQuery(changeFlagSql);
                        }
                    }
                    else
                    {
                        string SendTo   = ur.usrAltMobileNo;
                        string sendFrom = ur.usrMobileNo;
                        string message  = "Dear " + joiner.ToString() + " u already added " + sender.ToString() + " in www.myct.in to send SMS." + cc.AddSMS(sendFrom);

                        cc.SendMessage1(SendTo, sendFrom, message);

                        string changeFlagSql = "update come2mycity.test set FlagStatus = 0 where PK=" + Convert.ToInt32(ur.usrPKval);
                        int    pkchange      = 0;
                        pkchange = cc.ExecuteNonQuery(changeFlagSql);
                        if (pkchange == 0)
                        {
                            pkchange = cc.ExecuteNonQuery(changeFlagSql);
                        }
                    }
                }
                else
                {
                    string  sql3 = "select usrUserId, usrFirstName,usrCityId from UserMaster where usrMobileNo='" + ur.usrMobileNo + "'";
                    DataSet ds   = new DataSet();
                    ds = cc.ExecuteDataset(sql3);
                    //dt1 = ds.Tables[0];
                    string userId;
                    flagMob = ur.usrAltMobileNo;
                    string usrName  = "";
                    int    cityId   = 0;
                    string cityName = "";
                    foreach (DataRow dr1 in ds.Tables[0].Rows)
                    {
                        userId          = Convert.ToString(dr1["usrUserId"]);
                        usrName         = Convert.ToString(dr1["usrFirstName"]);
                        cityId          = Convert.ToInt32(dr1["usrCityId"]);
                        ur.frnrelUserId = userId;
                        ur.usrCityId    = cityId;
                        joiner          = Convert.ToString(usrName);
                        //ur.frnrelFrnRelName = usrName;
                        //ur.frnrelRelation = "friend";
                        //ur.frnrelGroup = "1";
                    }
                    string sqlFlagStr = "select JoinFlag from userMaster where usrMobileNo='" + flagMob.ToString() + "'";
                    int    jof        = Convert.ToInt32(cc.ExecuteScalar(sqlFlagStr));
                    if (jof >= 1)
                    {
                        JoinAll         = true;
                        ur.JoinFlagProp = Convert.ToString(jof);
                    }
                    string sqlquery = "select cityName from CityMaster where cityId='" + Convert.ToString(cityId) + "'";
                    cityName = cc.ExecuteScalar(sqlquery);

                    urRegistBll.usrUserId = System.Guid.NewGuid().ToString();

                    ur.usrMobileNo = ur.usrAltMobileNo;

                    ur.usrFirstName = ur.frnrelFrnRelName;

                    Random rnd = new Random();
                    urRegistBll.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));

                    status = urRegistBll.BLLInsertUserRegistrationInitial(urRegistBll);
                    if (status > 0)
                    {
                        string  sql1 = "select usrUserId, usrFirstName from UserMaster where usrMobileNo='" + ur.usrAltMobileNo + "'";
                        DataSet ds1  = new DataSet();
                        ds1 = cc.ExecuteDataset(sql1);
                        //dt1 = ds.Tables[0];
                        string FriId;
                        string FriName;
                        foreach (DataRow dr2 in ds1.Tables[0].Rows)
                        {
                            FriId               = Convert.ToString(dr2["usrUserId"]);
                            FriName             = Convert.ToString(dr2["usrFirstName"]);
                            ur.frnrelFriendId   = FriId;
                            ur.frnrelFrnRelName = FriName;
                            ur.frnrelRelation   = "friend";
                            ur.frnrelGroup      = Convert.ToString(grid);
                            sender              = Convert.ToString(FriName);
                        }

                        status = ur.BLLInsertUserFriendRelative(ur);
                        if (status > 0)
                        {
                        }
                        string senderId   = userMobileWhoSendFriendReq.ToString();
                        string myMobileNo = urRegistBll.usrMobileNo;
                        string myPassword = cc.DESDecrypt(urRegistBll.usrPassword);
                        string myName     = ur.frnrelFrnRelName;
                        string thisDir    = Server.MapPath("~");

                        if (!System.IO.Directory.Exists(thisDir + "\\User_Resource\\" + ur.usrUserId + "\\Profile_Photo\\"))
                        {
                            System.IO.Directory.CreateDirectory(thisDir + "\\User_Resource\\" + ur.usrUserId + "\\Profile_Photo\\");

                            File.Copy(thisDir + "\\User_Resource\\Profile_Photo\\default_user.jpg", thisDir + "\\User_Resource\\" + ur.usrUserId + "\\Profile_Photo\\default_user.jpg");
                        }

                        //string passwordMessage = "Dear " + myName + ", Password for ur First Login is " + myPassword + " " + cc.AdvMessage();
                        string passwordMessage = "I " + usrName + "(" + senderId.ToString() + ") added u in come2mycity.com. U use it to send SMS.Dear " + myName + ",Password for ur First Login is " + myPassword + " for come2myCity.com";
                        cc.SendMessage1(senderId, myMobileNo, passwordMessage);
                        cc.SendMessageImp1(senderId, myMobileNo, passwordMessage);
                        if (JoinAll == true)
                        {
                            string resJoinAll = "Thanks " + joiner.ToString() + ", I " + sender.ToString() + "( " + myMobileNo.ToString() + " ) also added u on www.myct.in " + cc.AddSMS(senderId);
                            cc.SendMessage1(myMobileNo, senderId, resJoinAll);
                        }
                        string changeFlagSql = "update come2mycity.test set FlagStatus = 0 where PK=" + Convert.ToInt32(ur.usrPKval);
                        int    pkchange      = 0;
                        pkchange = cc.ExecuteNonQuery(changeFlagSql);
                        if (pkchange == 0)
                        {
                            pkchange = cc.ExecuteNonQuery(changeFlagSql);
                        }
                    }
                }
            }
            else
            {
                //NotRegisterMessageForLongCode(urRegistBll);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 10
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);
    }
Esempio n. 11
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        DateTime date = System.DateTime.Now;

        if (myFile.HasFile)
        {
            try
            {
                string path = "";

                filename = myFile.FileName;
                // Session["filename"]=filename ;

                string mobileno = Convert.ToString(Session["MobileNumber"]);

                string  sql = "select usrAutoId, usruserid,JoinGroup from usermaster where usrMobileNo='" + mobileno + "'";
                DataSet ds  = cc.ExecuteDataset(sql);
                userid    = Convert.ToString(ds.Tables[0].Rows[0]["usruserid"]);
                usrAutoId = Convert.ToString(ds.Tables[0].Rows[0]["usrAutoId"]);
                string JoinGroup = Convert.ToString(ds.Tables[0].Rows[0]["JoinGroup"]);

                string checkq        = "select actual_filename from uploaddetails where actual_filename='" + filename + "' and folderuserid='" + userid + "'";
                string checkfilename = cc.ExecuteScalar(Convert.ToString(checkq));
                if (checkfilename == filename)
                {
                    Response.Write("<script>alert('File is already exist')</script>");
                }

                else
                {
                    if (userid != "")
                    {
                        string thisDir = Server.MapPath("~/User_Resource/");



                        System.IO.Directory.CreateDirectory(thisDir + userid + "");


                        string newpa = "" + thisDir + userid + "";

                        string newpath = Server.MapPath("~/User_Resource/" + userid + "");

                        path = newpath + "\\" + myFile.FileName;


                        if (System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".wav" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".mp4" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".txt" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".doc" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".xlsx" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".mp3" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".flv" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".avi" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".xls" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".pdf" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".jpg" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".png" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".gif" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".jpeg" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".csv")
                        {
                            lblError.Text = "The file must have an extension of .MP3,.FLV,.AVI,.XLS,.xlsx.PDF,.JPG,.JPEG,.png,.gif,.csv,.doc,.txt,.mp4,.wav";
                            return;
                        }

                        else
                        {
                            string   ePath     = newpa;
                            string[] filename1 = Directory.GetFiles(ePath, "*");



                            myFile.SaveAs(path);
                            string type = System.IO.Path.GetExtension(myFile.FileName);

                            fakefileName = Guid.NewGuid().ToString();
                            string fname    = filename.Replace(filename, fakefileName);
                            string newfname = fakefileName.Remove(5);
                            Response.Write("<script>alert('File Uploaded Successfully')</script>");
                            //string ur = "User_Resource/";
                            string aa = "http://www.myct.in/NCP/down.aspx?";
                            newstring = aa.Replace("NCP", JoinGroup);
                            url       = "" + newstring + usrAutoId + newfname + "";
                            if (userid != "")
                            {
                                string sql11 = "update usermaster set FilePath= '" + url + "' where usrUserid='" + userid + "'";
                                int    a     = cc.ExecuteNonQuery(sql11);
                            }

                            string senderid = "myctin";
                            string Message  = "Dear user Download Url " + url + "" + cc.AddSMS(mobileno);
                            cc.SendMessageTra(senderid, mobileno, Message);

                            string sqlinsert = "insert into uploaddetails(autouserid,url,upload_filename,upload_filetype,upload_date,folderuserid,actual_filename,url_link)" +
                                               "values('" + usrAutoId + "','" + url + "','" + newfname + "','" + type + "','" + date + "','" + userid + "','" + filename + "','" + url + "')";
                            int ss = cc.ExecuteNonQuery(sqlinsert);
                        }
                    }
                }
            }
            catch (Exception ex)
            { }
        }
        GridUploadshow();
    }
Esempio n. 12
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        string filename = "";

        //if (FileUpload1.HasFile)
        //{
        //   string a= FileUpload1.FileName.ToString();
        //    string uploadFolder = Request.PhysicalApplicationPath + "UploadHere\\";
        //    FileUpload1.SaveAs(uploadFolder + FileUpload1.FileName);
        //}

        if (myFile.HasFile)
        {
            try
            {
                string path = "";

                filename = myFile.FileName;
                //}
                string mobileno = Convert.ToString(Session["MobileNo"]);

                string  sql    = "select usruserid from usermaster where usrMobileNo='" + mobileno + "'";
                DataSet ds     = cc.ExecuteDataset(sql);
                string  userid = Convert.ToString(ds.Tables[0].Rows[0]["usruserid"]);


                if (userid != "")
                {
                    string thisDir = Server.MapPath("~/User_Resource/");



                    System.IO.Directory.CreateDirectory(thisDir + userid + "");


                    string newpa = "" + thisDir + userid + "";

                    string newpath = Server.MapPath("~/User_Resource/" + userid + "");

                    path = newpath + "\\" + myFile.FileName;

                    if (System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".wav" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".mp4" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".txt" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".doc" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".xlsx" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".mp3" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".flv" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".avi" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".xls" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".pdf" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".jpg" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".png" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".gif" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".jpeg" && System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".csv")
                    {
                        lblError.Text = "The file must have an extension of .MP3,.FLV,.AVI,.XLS,.xlsx.PDF,.JPG,.JPEG,.png,.gif,.csv,.doc,.txt,.mp4,.wav";
                        return;
                    }

                    else
                    {
                        string   ePath     = newpa;
                        string[] filename1 = Directory.GetFiles(ePath, "*");



                        foreach (string str in filename1)
                        {
                            File.Delete(str);
                        }



                        myFile.SaveAs(path);
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('File Uploaded Successfully')", true);
                        string aa  = "http://www.myct.in/NCP/down.aspx?User_Resource/";
                        string url = "" + aa + userid + "";
                        if (userid != "")
                        {
                            string sql11 = "update usermaster set FilePath= '" + url + "' where usrUserid='" + userid + "'";
                            int    a     = cc.ExecuteNonQuery(sql11);
                        }

                        string senderid = "myctin";
                        string Message  = "Dear user Downloading Url is " + url + "" + cc.AddSMS(mobileno);
                        cc.SendMessageTra(senderid, mobileno, Message);
                    }
                }
            }
            catch (Exception ex)
            { }
        }
    }
Esempio n. 13
0
    public bool RegisterNewExcel1(string mno, string fnm, string lnm, string pin, string gr, string ct, string prefix, string defltgrp)
    {
        bool a = true;

        try
        {
            string usrmoNo = Convert.ToString(Session["MobileNumber"]);
            cqc.usrMobileNo = usrmoNo.ToString();
            status          = BLLIsExistUserRegistrationInitial(usrmoNo);
            if (status == 0)
            {
                status = BLLIsExistUserRegistrationInitial(mno);
                if (status == 0)
                {
                    string  sql = "select * from usermaster where usrMobileNo='" + mno + "'";
                    DataSet ds1 = cc.ExecuteDataset(sql);
                    objMiscalreg.Userid = Session["MarketingUser"].ToString();
                    string friendid = Convert.ToString(ds1.Tables[0].Rows[0]["usrUserid"]);
                    objMiscalreg.Friendid = friendid;
                    string fname = Convert.ToString(ds1.Tables[0].Rows[0]["usrFirstName"]);
                    string lname = Convert.ToString(ds1.Tables[0].Rows[0]["usrLastName"]);
                    status = objMiscalreg.BALFriendIsExist(objMiscalreg);
                    if (status == 1)
                    {
                        objMiscalreg.Friendid   = friendid;
                        objMiscalreg.FriendName = fname + "" + lname;
                        objMiscalreg.Groupno    = gr;
                        objMiscalreg.Userid     = Session["MarketingUser"].ToString();
                        objMiscalreg.BALInsertMiscalRegistration(objMiscalreg);
                    }
                    else
                    {
                        objMiscalreg.Friendid   = friendid;
                        objMiscalreg.FriendName = fname + "" + lname;
                        objMiscalreg.Groupno    = gr;
                        objMiscalreg.Userid     = Session["MarketingUser"].ToString();
                        objMiscalreg.BALUpdateMiscalRegistration(objMiscalreg);
                    }
                }
                else
                {
                    urUserRegBLLObj.usrFirstName = fnm;
                    urUserRegBLLObj.usrLastName  = lnm;
                    urUserRegBLLObj.usrPIN       = pin;
                    urUserRegBLLObj.usrCityName  = ct;
                    urUserRegBLLObj.usrMobileNo  = mno;
                    urUserRegBLLObj.usrUserId    = System.Guid.NewGuid().ToString();
                    Random rnd = new Random();
                    urUserRegBLLObj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));
                    status = urUserRegBLLObj.BLLInsertUserRegistrationInitial(urUserRegBLLObj);
                    if (status > 0)
                    {
                        string senderId        = "COM2MYCT";
                        string myMobileNo      = urUserRegBLLObj.usrMobileNo;
                        string myPassword      = cc.DESDecrypt(urUserRegBLLObj.usrPassword);
                        string myName          = urUserRegBLLObj.usrFirstName;
                        string passwordMessage = "Dear " + myName + ", Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);
                        int    length          = passwordMessage.Length;
                        //cc.SendMessageTra(senderId, myMobileNo, passwordMessage);
                        cc.SendMessageRegistrationSMS("Website", myMobileNo, passwordMessage, length);
                    }
                    string  sql1 = "select * from usermaster where usrMobileNo='" + mno + "'";
                    DataSet ds   = cc.ExecuteDataset(sql1);

                    string friendid = Convert.ToString(ds.Tables[0].Rows[0]["usrUserid"]);
                    string fname    = Convert.ToString(ds.Tables[0].Rows[0]["usrFirstName"]);
                    string lname    = Convert.ToString(ds.Tables[0].Rows[0]["usrLastName"]);

                    cqc.frnrelFriendId = friendid;
                    cqc.frnrelUserId   = Session["MarketingUser"].ToString();
                    //cqc.FR1 = "1";   //Not to add in personal group
                    //cqc.BLLInsertUserFriendRelative(cqc);
                    objMiscalreg.Friendid   = friendid;
                    objMiscalreg.FriendName = fname + "" + lname;
                    objMiscalreg.Groupno    = gr;
                    objMiscalreg.Userid     = Session["MarketingUser"].ToString();
                    objMiscalreg.BALInsertMiscalRegistration(objMiscalreg);
                }
            }
        }
        catch (Exception ex)
        {
        }
        return(a);
    }
Esempio n. 14
0
    public void AddSubUser(string mobile, string fname, string lname, string schoolcode, string usrclass, string section, string Hm_usrID)
    {
        try
        {
            DateTime dt         = DateTime.Now; // get current date
            double   d          = 5;            //add hours in time
            double   m          = 48;           //add min in time
            DateTime SystemDate = Convert.ToDateTime(dt).AddHours(d);
            SystemDate   = SystemDate.AddMinutes(m);
            CurrenctDate = SystemDate.ToString("yyyy'-'MM'-'dd HH':'mm':'ss tt''");
            urUserRegBLLObj.Customermobileno = mobile;
            Leader_UserID = Hm_usrID;
            SchoolCode    = schoolcode;
            Fname         = fname;
            Lname         = lname;
            status        = urUserRegBLLObj.BLLSearchUserExist(urUserRegBLLObj);
            if (status > 0)
            {
                if (mobile != "" && mobile.Length == 10)
                {
                    sql   = "select usrUserid from usermaster where usrMobileNo='" + Convert.ToString(mobile) + "'";
                    Jr_ID = cc.ExecuteScalar(sql);

                    sql = "select id from AdminSubMarketingSubUser where   friendid='" + Convert.ToString(Jr_ID) + "' and roleid=76 and userid= '" + Convert.ToString(Hm_usrID) + "'";
                    string Check_HMavailable = cc.ExecuteScalar(sql); // check hm assign or not.
                    if (Check_HMavailable != "" || Check_HMavailable != null)
                    {
                        sql = "select SchoolCode from UDISE_TeacherMaster where junior_id='" + Jr_ID + "' and Active=1";
                        string checkschoolCode = cc.ExecuteScalar(sql); // check hm assign or not.
                        if (checkschoolCode != schoolcode && checkschoolCode != "")
                        {
                            sql = "select id from UDISE_TeacherMaster where junior_id='" + Jr_ID + "' and Class='' and Section='' and Active=1  and  SchoolCode= '" + checkschoolCode + "'";
                            string HM = cc.ExecuteScalar(sql); //  Get Hm
                            if (HM != "" || HM != null)
                            {
                            }
                            else
                            {
                                sql = "Update UDISE_TeacherMaster set Active=0 ,EntryDate='" + CurrenctDate + "'  where SchoolCode= '" + checkschoolCode + "' and junior_id='" + Jr_ID + "'";
                                int Teach = cc.ExecuteNonQuery(sql);// update tecaher status
                                if (Teach == 1)
                                {
                                }
                            }
                        }
                        else
                        {
                            sql = "select id from UDISE_TeacherMaster where junior_id='" + Jr_ID + "' and SchoolCode= '" + schoolcode + "' and Active=1";
                            string Check_TecaherAlredyAssign = cc.ExecuteScalar(sql);// check  current teacher or HM assign or not perticular school code
                            if (Check_TecaherAlredyAssign != "" || Check_TecaherAlredyAssign != null)
                            {
                                sql = "select id from UDISE_TeacherMaster where SchoolCode= '" + schoolcode + "' and Class='" + usrclass + "' and Section='" + section + "' and Active=1 ";
                                string checl_ClassAssign = cc.ExecuteScalar(sql);// check this school code ,class & section already assign or not
                                if (checl_ClassAssign == "" || checl_ClassAssign == null)
                                {
                                    sql = "insert into UDISE_TeacherMaster(leader_id,junior_id,SchoolCode,Class,Section,EntryDate,Active)" +
                                          "values('" + Leader_UserID + "','" + Jr_ID + "','" + schoolcode + "','" + usrclass + "','" + section + "','" + CurrenctDate + "',1)";
                                    int a = cc.ExecuteNonQuery(sql); // add tecaher or Hm in Tecaher Master

                                    if (a == 1)
                                    {
                                        string SQL = "select * from usermaster where usrUserid='" + Jr_ID + "'";
                                        SQL = SQL + "select usrMobileNo  from usermaster where usrUserid='" + Leader_UserID + "'";
                                        DataSet ds = cc.ExecuteDataset(SQL);
                                        if (ds.Tables[0].Rows.Count > 0)
                                        {
                                            // string sqll = "select usrMobileNo  from usermaster where usrUserid='" + Leader_UserID + "'";
                                            // string leaderMobileNo = cc.ExecuteScalar(sqll);
                                            string myMobileNo = Convert.ToString(ds.Tables[0].Rows[0]["usrMobileNo"]);
                                            string myPassword = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["usrPassword"]));
                                            string passwordMessage;
                                            Leader_MobileNo = Convert.ToString(ds.Tables[1].Rows[0]["usrMobileNo"]);
                                            // string passwordMessage = "Dear " + myName + ", Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);
                                            if (section == "" && usrclass == "")
                                            {
                                                passwordMessage = "U R Registered as HM for school " + schoolcode + " by " + Leader_MobileNo + " ur login pwd for www.myct.in & www.udisecce.myct.in is " + myPassword + " " + cc.AddSMS(myMobileNo);
                                            }
                                            else
                                            {
                                                passwordMessage = "U R Registered as Teacher for class " + usrclass + "(" + section + ")of school " + schoolcode + " by " + Leader_MobileNo + " send every day DAR sms on 8378977897. Ur password is " + myPassword + " for " + cc.AddSMS(myMobileNo);
                                            }
                                            int smslength = passwordMessage.Length;
                                            cc.SendMessageLongCodeSMS("UDISE", myMobileNo, passwordMessage, smslength);
                                        }
                                    }
                                    else
                                    {
                                    }
                                    // AddNewUser(Hm_usrID, Jr_ID);
                                    AddSubUser_EO1(mobile, Fname, Lname, Leader_MobileNo);
                                }
                                else
                                {
                                    string chkUserId = "select junior_id from UDISE_TeacherMaster where SchoolCode= '" + schoolcode + "' and Class='" + usrclass + "' and Section='" + section + "'";
                                    string TRUserId  = cc.ExecuteScalar(chkUserId); // check this school code ,class & section already assign or not
                                    if (TRUserId == "" || TRUserId == null)
                                    {
                                    }
                                    else
                                    {
                                        sql = "Update UDISE_TeacherMaster set junior_id='" + Jr_ID + "' , EntryDate='" + CurrenctDate + "', Active=1  where SchoolCode= '" + schoolcode + "' and Class='" + usrclass + "' and Section='" + section + "' ";
                                        string UpTeach = Convert.ToString(cc.ExecuteNonQuery(sql)); // update class ,section & school code
                                        if (UpTeach == "" || UpTeach == null)
                                        {
                                            string SQL = "select * from usermaster where usrUserid='" + Jr_ID + "'";
                                            SQL = SQL + "select usrMobileNo  from usermaster where usrUserid='" + Leader_UserID + "'";
                                            DataSet ds = cc.ExecuteDataset(SQL);
                                            if (ds.Tables[0].Rows.Count > 0)
                                            {
                                                // string sqll = "select usrMobileNo  from usermaster where usrUserid='" + Leader_UserID + "'";
                                                // string leaderMobileNo = cc.ExecuteScalar(sqll);
                                                string myMobileNo = Convert.ToString(ds.Tables[0].Rows[0]["usrMobileNo"]);
                                                string myPassword = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["usrPassword"]));
                                                string passwordMessage;
                                                Leader_MobileNo = Convert.ToString(ds.Tables[1].Rows[0]["usrMobileNo"]);
                                                // string passwordMessage = "Dear " + myName + ", Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);
                                                if (section == "" && usrclass == "")
                                                {
                                                    passwordMessage = "U R Registered as HM for school " + schoolcode + " by " + Leader_MobileNo + " ur login pwd for www.myct.in & www.udisecce.myct.in is " + myPassword + " " + cc.AddSMS(myMobileNo);
                                                }
                                                else
                                                {
                                                    passwordMessage = "U R Registered as Teacher for class " + usrclass + "(" + section + ")of school " + schoolcode + " by " + Leader_MobileNo + " send every day DAR sms on 8378977897. Ur password is " + myPassword + " for " + cc.AddSMS(myMobileNo);
                                                }
                                                int smslength = passwordMessage.Length;
                                                cc.SendMessageLongCodeSMS("UDISE", myMobileNo, passwordMessage, smslength);
                                            }
                                        }
                                        else
                                        {
                                            //string UDAdmin = "update AdminSubMarketingSubUser set friendid='" + Jr_ID + "' where roleid=41 and friendid='" + TRUserId + "' and reference_id10='"+Leader_UserID+"'";
                                            //int a = cc.ExecuteNonQuery(UDAdmin);
                                        }
                                    }
                                }
                            }
                            else
                            {
                            }
                        }
                    }
                    //else
                    //{
                    //    //string Checkschoolcode = "select SchoolCode from UDISE_TeacherMaster where junior_id='" + frndid + "' and SchoolCode= '" + schoolcode + "'";
                    //    //string Scode = cc.ExecuteScalar(Checkschoolcode);
                    //    //if (Scode == "" || Scode == null)
                    //    //{

                    //    //}
                    //    //else
                    //    //{

                    //    sql = "select SchoolCode from UDISE_TeacherMaster where junior_id='" + Jr_ID + "'";
                    //    string schoolcode1 = cc.ExecuteScalar(sql);
                    //    if (schoolcode1 == "" || schoolcode1 == null)
                    //    {
                    //        sql = "select id from UDISE_TeacherMaster where junior_id='" + Jr_ID + "' and SchoolCode= '" + schoolcode + "'";
                    //        string id = cc.ExecuteScalar(sql);
                    //        if (id == "" || id == null)
                    //        {
                    //            sql = "insert into UDISE_TeacherMaster(leader_id,junior_id,SchoolCode,Class,Section)" +
                    //                                    "values('" + Leader_UserID + "','" + Jr_ID + "','" + schoolcode + "','" + usrclass + "','" + section + "')";
                    //            int a = cc.ExecuteNonQuery(sql);
                    //        }
                    //        else
                    //        {
                    //        }
                    //    }
                    //    else
                    //    {
                    //        string chkUserId = "select junior_id from UDISE_TeacherMaster where SchoolCode= '" + schoolcode + "' and Class='" + usrclass + "' and Section='" + section + "'";
                    //        string TRUserId = cc.ExecuteScalar(chkUserId);
                    //        if (TRUserId == "" || TRUserId == null)
                    //        {

                    //        }
                    //        else
                    //        {
                    //            sql = "Update UDISE_TeacherMaster set junior_id='" + Jr_ID + "' where SchoolCode= '" + schoolcode + "' and Class='" + usrclass + "' and Section='" + section + "'";
                    //            string UpTeach = Convert.ToString(cc.ExecuteNonQuery(sql));
                    //            if (UpTeach == "" || UpTeach == null)
                    //            {

                    //            }
                    //            else
                    //            {
                    //                string UDAdmin = "update AdminSubMarketingSubUser set friendid='" + Jr_ID + "' where roleid=77 and friendid='" + TRUserId + "'";
                    //                int a = cc.ExecuteNonQuery(UDAdmin);
                    //            }
                    //        }
                    //    }
                    //}
                    // }
                }
                else
                {
                    //int Status = Addnew(fname, lname, mobile);
                    //if (Status == 1)
                    //{
                    //    AddSubUser(mobile, fname, lname, schoolcode, usrclass, section, Hm_usrID);
                    //}
                }
            }
            else
            {
                int Status = Addnew(fname, lname, mobile);
                if (Status == 1)
                {
                    AddSubUser(mobile, fname, lname, schoolcode, usrclass, section, Hm_usrID);
                }
            }
        }
        catch (Exception ez)
        {
        }
    }
Esempio n. 15
0
    private void FriendRelativeAdd()
    {
        try
        {
            string senderId = "myctin";
            urUserRegBLLObj.usrUserId = System.Guid.NewGuid().ToString();
            string friendid = urUserRegBLLObj.usrUserId;

            urUserRegBLLObj.usrMobileNo = Convert.ToString(txtMobileNumber.Text);
            string mymobile = urUserRegBLLObj.usrMobileNo;
            urUserRegBLLObj.usrAddress   = Convert.ToString(txtAddress.Text);
            urUserRegBLLObj.usrFirstName = Convert.ToString(txtFirstName.Text);
            urUserRegBLLObj.usrLastName  = Convert.ToString(txtLastName.Text);

            if (rdoCityLocation.SelectedItem.Value == "SC")
            {
                urUserRegBLLObj.usrCityId = Convert.ToInt32(Session["City"]);
            }
            else if (rdoCityLocation.SelectedItem.Value == "DC")
            {
                pnlSelectLocation.Visible = true;
                if (cmbCity.SelectedValue != null)
                {
                    urUserRegBLLObj.usrCityId = Convert.ToInt32(Convert.ToString(cmbCity.SelectedValue));
                }
                else
                {
                    urUserRegBLLObj.usrCityId = Convert.ToInt32(Session["City"]);
                }
            }


            string gr = cmbFriendGroup.SelectedItem.Text;


            Random rnd = new Random();
            urUserRegBLLObj.usrPassword = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));
            string pass = cc.DESDecrypt(urUserRegBLLObj.usrPassword);

            status = urUserRegBLLObj.BLLIsExistUserRegistrationInitial(urUserRegBLLObj);

            if (status == 0)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User already Exists...')", true);
            }
            else
            {
                status = urUserRegBLLObj.BLLInsertUserRegistrationInitial(urUserRegBLLObj);

                if (status > 0)
                {
                    string passwordMessage = "Dear " + txtFirstName.Text + ", Password for ur First Login is " + pass + " " + cc.AddSMS(txtMobileNumber.Text);
                    cc.SendMessageTra(senderId, mymobile, passwordMessage);

                    cqc.frnrelFriendId = friendid;
                    cqc.frnrelUserId   = Session["MarketingUser"].ToString();
                    //cqc.FR1 = "1";    //Not to add in personal group
                    //cqc.BLLInsertUserFriendRelative(cqc);
                    objMiscalreg.Friendid   = friendid;
                    objMiscalreg.FriendName = txtFirstName.Text + "" + txtLastName.Text;
                    objMiscalreg.Groupno    = gr;
                    objMiscalreg.Userid     = Session["MarketingUser"].ToString();
                    objMiscalreg.BALInsertMiscalRegistration(objMiscalreg);
                    Response.Redirect("../MarketingAdmin/ReportMiscal.aspx");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Friend Not added')", true);
                }
            }

            clearAddFriend();
        }
        catch (Exception ex)
        {
            //throw ex;
        }
    }
Esempio n. 16
0
    public void sendmessage(string leader_userId, string JuniourMno, string RegBoys, string PresentBoys, string RegGirls, string presentGirls, string checkschoolCode)
    {
        try
        {
            string SQL = "select usrLastName,usrMobileNo,usrPassword from usermaster where usrMobileNo='" + JuniourMno + "'";
            SQL = SQL + "select usrMobileNo  from usermaster where usrUserid='" + leader_userId + "'";
            DataSet ds = cc.ExecuteDataset(SQL);
            if (ds.Tables[0].Rows.Count > 0)
            {
                // string sqll = "select usrMobileNo  from usermaster where usrUserid='" + Leader_UserID + "'";
                // string leaderMobileNo = cc.ExecuteScalar(sqll);
                string usrLastName = Convert.ToString(ds.Tables[0].Rows[0]["usrLastName"]);
                string myMobileNo  = Convert.ToString(ds.Tables[0].Rows[0]["usrMobileNo"]);
                // string myPassword = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["usrPassword"]));
                string passwordMessage;
                string leader_Mobileno = Convert.ToString(ds.Tables[1].Rows[0]["usrMobileNo"]);
                // string passwordMessage = "Dear " + myName + ", Password for ur First Login is " + myPassword + " " + cc.AddSMS(myMobileNo);

                passwordMessage = "Dear " + usrLastName + " in ur school '" + checkschoolCode + "' total RB*" + RegBoys + "*RG*" + RegGirls + "*  PB*" + PresentBoys + "* PG*" + presentGirls + " Stds r Recorded pl update changes up 7PM." + cc.AddSMS(myMobileNo);
                int smslength = passwordMessage.Length;
                cc.SendMessageLongCodeSMS("UDISE", myMobileNo, passwordMessage, smslength);
                string  SQl = "select usrMobileNo ,usrLastName from  UserMaster where  usrUserId in (select friendid from  UserMaster inner join AdminSubMarketingSubOrdinate on AdminSubMarketingSubOrdinate.userid=UserMaster.usruserid where usrmobileno='" + JuniourMno + "')";
                DataSet ds1 = cc.ExecuteDataset(SQl);
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    usrLastName     = Convert.ToString(ds1.Tables[0].Rows[i]["usrLastName"]);
                    myMobileNo      = Convert.ToString(ds1.Tables[0].Rows[i]["usrMobileNo"]);
                    passwordMessage = "Dear " + usrLastName + " in ur school '" + checkschoolCode + "' total RB*" + RegBoys + "*RG*" + RegGirls + "*  PB*" + PresentBoys + "* PG*" + presentGirls + " Stds r Recorded pl update changes up 7PM." + cc.AddSMS(myMobileNo);
                    smslength       = passwordMessage.Length;
                    cc.SendMessageLongCodeSMS("UDISE", myMobileNo, passwordMessage, smslength);
                }
            }
        }
        catch (Exception ex)
        {
        }
    }