//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);
    }
Beispiel #2
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);
    }
Beispiel #3
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);
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack == true)
            {
                BindDistct();
            }

            string qd = string.Empty;

            try
            {
                qd = Request.QueryString[0];
            }
            catch
            {
                qd = "";
            }

            if (qd != "")
            {
                qd = cc.DESDecrypt(qd);
                string[] d  = qd.Split('$');
                DataSet  DS = new DataSet();
                DS = SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "uspBindDistrict");
                if (DS.Tables[0].Rows.Count > 0)
                {
                    ddlDistirct.DataSource     = DS.Tables[0];
                    ddlDistirct.DataTextField  = "DistrictName";
                    ddlDistirct.DataValueField = "DistrictCode";
                    ddlDistirct.DataBind();
                    ddlDistirct.Items.Insert(0, new ListItem("--Select--", "0"));
                    ddlDistirct.SelectedValue = d[0].ToString();
                }
                else
                {
                }

                DataSet        ds1 = new DataSet();
                SqlParameter[] par = new SqlParameter[2];
                par[0] = new SqlParameter("@CreatedBy", d[0].ToString());
                par[1] = new SqlParameter("@query", "3");
                ds1    = SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "uspBindRepsData", par);

                if (ds1.Tables[0].Rows.Count > 0)
                {
                    ddlLocalBody.DataSource     = ds1.Tables[0];
                    ddlLocalBody.DataTextField  = "ElectionName";
                    ddlLocalBody.DataValueField = "ElectionId";
                    ddlLocalBody.DataBind();
                    ddlLocalBody.Items.Insert(0, new ListItem("--Select--", "0"));
                    ddlLocalBody.SelectedValue = d[1].ToString();
                }
                else
                {
                }
                // txtWardNo.Text = d[2].ToString();
                ddlLocalBodytype.SelectedValue = d[3].ToString();
                bindGridView(d[0].ToString(), d[1].ToString());//, d[2].ToString());
            }
        }
Beispiel #5
0
    private void GetUserValue(string Id)
    {
        string Sql = "SELECT   Login.LoginId, Login.UserName, Login.Password, Login.ContactNo, " +
                     " Login.Address, Login.DOJ, Login.Role, Login.CompanyId, Login.Active, " +
                     " Role.RoleName, CompanyMaster.DisplayName  " +
                     " FROM         Login INNER JOIN  " +
                     " Role ON Login.Role = Role.RoleId INNER JOIN " +
                     " CompanyMaster ON Login.CompanyId = CompanyMaster.CompanyId " +

                     " WHERE     (Login.LoginId = '" + Id + "')";

        try
        {
            CommonCode cc = new CommonCode();
            DataSet    ds = cc.ExecuteDataset(Sql);
            lblUserName.Text  = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]);
            lblPassword.Text  = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["Password"]));
            lblContactNo.Text = Convert.ToString(ds.Tables[0].Rows[0]["ContactNo"]);
            lblAddress.Text   = Convert.ToString(ds.Tables[0].Rows[0]["Address"]);
            lblDOJ.Text       = Convert.ToString(ds.Tables[0].Rows[0]["DOJ"]);
            lblRole.Text      = Convert.ToString(ds.Tables[0].Rows[0]["RoleName"]);
            lblCompany.Text   = Convert.ToString(ds.Tables[0].Rows[0]["DisplayName"]);
            lblId.Text        = Id.ToString();
        }
        catch (Exception ex)
        { }
    }
Beispiel #6
0
 protected void lnkbtnForgotp_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtUserName.Text == "" || txtUserName.Text.Length < 10)
         {
             ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter valid 10 Digits Mobile No. in the UserName field!!!')", true);
         }
         else
         {
             objloginBAL.UserName = txtUserName.Text;
             DataSet    dsPwdDetails = objloginBAL.GetLoginPassword(objloginBAL);
             CommonCode commoncode   = new CommonCode();
             if (dsPwdDetails.Tables[0].Rows.Count > 0)
             {
                 string pwd2 = commoncode.DESDecrypt(dsPwdDetails.Tables[0].Rows[0]["Password"].ToString());
                 string msg  = "Dear " + dsPwdDetails.Tables[0].Rows[0]["NAME"] + " you installed TRUE VOTER. Your password for login is " + pwd2 + "";
                 commoncode.SMS(txtUserName.Text, msg);
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Register First...')", true);
             }
         }
     }
     catch
     {
     }
 }
    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;
        }
    }
Beispiel #8
0
 public string LoginCheck(String Password, string MobileNo)
 {
     //if (!string.IsNullOrEmpty(MobileNo))
     //{
     try
     {
         string  s   = string.Empty;
         DataSet ds  = new DataSet();
         string  str = "select usrPassword,usrUserId from [Come2myCityDB].[dbo].[UserMaster] where usrMobileNo='" + MobileNo + "' ";
         ds = cc.ExecuteDataset(str);
         string str1 = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["usrPassword"]));
         if (str1 == Password)
         {
             string sql = "select usertype FROM [Come2myCityDB].[dbo].[EzeeDrugsAppDetail] where UserId='" + Convert.ToString(ds.Tables[0].Rows[0]["usrUserId"]) + "'";
             ds = cc.ExecuteDataset(sql);
             s  = ds.Tables[0].Rows[0]["usertype"].ToString();
         }
         if (s == "2" && s == "3")
         {
             return(s);
         }
         return("4");
     }
     catch (SqlException ex)
     {
         return(ex.Message);
     }
 }
Beispiel #9
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);
    }
Beispiel #10
0
    public void GetPassword(string MobileNo)
    {
        UserRegistrationBLL balobj = new UserRegistrationBLL();
        DataTable           dtUserInfoList;
        CommonCode          cc = new CommonCode();
        int status, smslength;

        balobj.BLLUserPasswordRecovery(MobileNo, out dtUserInfoList, out status);
        if (status == 0)
        {
        }
        else
        {
            DataTable dtUserSMSInfoList = dtUserInfoList;
            DataRow   dRowUserInfo      = dtUserSMSInfoList.Rows[0];
            string    myPassword        = cc.DESDecrypt(Convert.ToString(dRowUserInfo["usrPassword"]));
            string    myName            = Convert.ToString(dRowUserInfo["usrFullName"]);
            string    Message           = "Dear " + myName + " Password for Login is " + myPassword + " Thanks via www.myct.in";
            smslength = Message.Length;

            //cc.SendMessageMahatetSMS("Mahatet", MobileNo, Message, smslength);

            cc.TransactionalSMSCountry("Mahatet", MobileNo, Message, smslength, 20);
        }
    }
Beispiel #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //string s = cc.DESDecrypt("f+KJn7vqbMk=");// 89226 - 9421904574

        //string ss = cc.DESDecrypt("9Y7Wi+LuePA=");// 88526 - 9422937796

        //string sss = cc.DESDecrypt("axZ+DB4y/Mo=");// 26177 - 9403155083  local hm

        //  string sujata = cc.DESDecrypt("cMR+3CYmVlg="); // server clustere head 53434-9403444421


        //  string gf = cc.DESDecrypt("VeKHpxjP4js=");  // local head master  68562-9545467433   scode- 27180110301

        // string hg = cc.DESDecrypt("vWjytIRtu3E=");   // server head master 72657- 9545467433-   scode-27180110301

        // string j = cc.DESDecrypt("SbSvQFXTvdo=");   // server head master 56592- 9423447406

        string h = cc.DESDecrypt("uNXKL7/JloQ=");   // sever 2nd EO 47971- 8087321575

        // string j = cc.DESDecrypt("oX2dbE3iwRw=");   // local hm 64936= 9766306701

        // string j = cc.DESDecrypt("1HqdrhQgKzM=");// local Hm 8087321888  // 39798

        //  string f = cc.DESDecrypt("oX2dbE3iwRw=");//    9766306701  // 64936 hm local

        //  string f = cc.DESDecrypt("blNg2RxvBHE=");//    9421664923  // 55561 hm server

        if (!IsPostBack)
        {
            txtUserId.Focus();
            Session.Clear();
            Session.Abandon();
            Session.RemoveAll();
        }
    }
Beispiel #12
0
 protected void btnGetPassword_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtForgetUsername.Text == "" || txtForgetUsername.Text.Length < 10)
         {
             ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Enter valid 10 Digits Mobile No. in the UserName field!!!')", true);
         }
         else
         {
             objloginBAL.UserName = txtForgetUsername.Text;
             DataSet    dsPwdDetails = objloginBAL.GetLoginPassword(objloginBAL);
             CommonCode commoncode   = new CommonCode();
             if (dsPwdDetails.Tables[0].Rows.Count > 0)
             {
                 //string pd = "Dphw8uRj8m223uy8jL6IROJWchsfAa78LC1+bdPl4TLU0HliZ4mfRlSm0xZ7PTAm";
                 //string pd1 = "xbwwEW+aKy+VhMAwDHJjAktab558b8O1VTqKA9SdCKwwwlbkamdciJJ4i3FjzvMV";
                 //string pwd2 = commoncode.DESDecrypt(pd);
                 //string pwd3 = commoncode.DESDecrypt(pd1);
                 string pwd2 = commoncode.DESDecrypt(dsPwdDetails.Tables[0].Rows[0]["Password"].ToString());
                 string msg  = "Dear " + dsPwdDetails.Tables[0].Rows[0]["NAME"] + " you installed TRUE VOTER. Your password for login is " + pwd2 + "";
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('" + msg + "')", true);
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please Register First...')", true);
             }
         }
     }
     catch
     {
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string MobileNo = Convert.ToString(Session["MobileNo"]);

            if (MobileNo != null)
            {
                mob       = Convert.ToString(Session["MobileNo"]);
                candiMoNo = commoncode.DESDecrypt(Convert.ToString(Request.QueryString["mNo"]));
                if (candiMoNo != null)
                {
                    if (IsPostBack != true)
                    {
                        offRole = Convert.ToString(Session["MainRole"]);
                        BindExpenseHead();
                        BindGridView();
                    }
                }
                else
                {
                    Response.Redirect("../Reports/frmaddExpenseByOfficerOne.aspx");
                }
            }
            else
            {
                Response.Redirect("../Admin/Login.aspx");
            }
        }
        public string myctPassword(string userName) // Change made 24.09.2016
        {
            SqlCommand sqlCommand = new SqlCommand();

            try
            {
                sqlCommand.Connection  = new SqlConnection(ConfigurationManager.ConnectionStrings["TrueVoterConnectionString"].ConnectionString);
                sqlCommand.CommandText = "SELECT [Password] FROM [TrueVoterDB].[dbo].[Logins](NOLOCK) WHERE [UserName]='" + userName + "'";
                SqlDataAdapter adapter = new SqlDataAdapter();
                adapter.SelectCommand = sqlCommand;
                DataSet ds = new DataSet();
                adapter.Fill(ds);

                if (ds.Tables[0].Rows.Count != 0)
                {
                    CommonCode cc          = new CommonCode();
                    string     temppasword = cc.DESDecrypt(ds.Tables[0].Rows[0][0].ToString());
                    string     message     = "Your PASSWORD for True Voter is " + temppasword + "";
                    cc.SMS(userName, message);
                    return(CommonCode.OK.ToString());
                }
                else
                {
                    return(CommonCode.FAIL.ToString());
                }
            }
            catch (SqlException)
            {
                return(CommonCode.SQL_ERROR.ToString());
            }
            catch (Exception)
            {
                return(CommonCode.ERROR.ToString());
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        SchoolCode = Convert.ToString(Request.QueryString["sc"]);
        HmMobile   = Convert.ToString(Request.QueryString["mn"]);

        SchoolCode = cc.DESDecrypt(SchoolCode);
        HmMobile   = cc.DESDecrypt(HmMobile);

        DateFormatStatus();
        if (!IsPostBack)
        {
            LoadItem();
            LoadGrid();
            LoadGrid1();
        }
        lblSchoolCode.Text = "School Code :" + SchoolCode;
    }
Beispiel #16
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);
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            mob = Convert.ToString(Session["MobileNO"]);

            if (mob != null)
            {
                if (IsPostBack == false)
                {
                    string mNo = cc.DESDecrypt(Convert.ToString(Request.QueryString["mNo"]));
                    ShowData(mNo);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Session is Expired..')", true);
                Response.Redirect("../Admin/Login.aspx");
            }
        }
Beispiel #18
0
    public string RegisterUser(string FirstName, string lastName, string MobileNo)
    {
        int ID;

        try
        {
            string sql     = "select usrPassword from usermaster where usrMobileNo= '" + MobileNo + "' ";
            string already = cc.ExecuteScalar(sql);// check this user already register
            if (already == "" || already == null)
            {
                string userid = System.Guid.NewGuid().ToString();
                Random rnd    = new Random();

                pwd = cc.DESEncrypt(Convert.ToString(rnd.Next(10001, 99999)));

                string Sql = "insert into usermaster(usrUserId,usrFirstName,usrLastName,usrMobileNo,usrPassword)" +
                             " values('" + userid + "','" + FirstName + "','" + lastName + "','" + MobileNo + "','" + pwd + "')";
                ID = cc.ExecuteNonQuery(Sql);
                if (ID == 1)
                {
                    pwd = cc.DESDecrypt(pwd);
                    return(pwd);
                }
                else
                {
                    string error = "error";
                    return(error);
                }
            }
            else
            {
                //string sql1 = "select usrPassword from usermaster where usrMobileNo= '" + mobileno + "' ";
                //pwd = cc.ExecuteScalarCt1(sql1);// check this user already register

                pwd = cc.DESDecrypt(already);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(pwd);
    }
        public string trueVoterPassword(string userName)
        {
            SqlCommand sqlCommand = new SqlCommand();

            try
            {
                sqlCommand.Connection  = new SqlConnection(ConfigurationManager.ConnectionStrings["TrueVoterConnectionString"].ConnectionString);
                sqlCommand.CommandText = "[TrueVoterDB].[dbo].[uspGetPassword]";
                sqlCommand.CommandType = CommandType.StoredProcedure;

                SqlParameter registrationSqlParameter = new SqlParameter("@password", "");
                registrationSqlParameter.Direction = ParameterDirection.Output;
                registrationSqlParameter.SqlDbType = SqlDbType.NVarChar;
                registrationSqlParameter.Size      = 50;

                SqlParameter mobileSqlParameter = new SqlParameter("@mobile", "");
                mobileSqlParameter.Direction = ParameterDirection.Output;
                mobileSqlParameter.SqlDbType = SqlDbType.NVarChar;
                mobileSqlParameter.Size      = 20;

                CommonCode commoncode = new CommonCode();

                SqlParameter[] sqlParameter = new SqlParameter[] { new SqlParameter("@userName", userName), registrationSqlParameter, mobileSqlParameter };
                sqlCommand.Parameters.AddRange(sqlParameter);

                if (sqlCommand.Connection.State == ConnectionState.Closed)
                {
                    sqlCommand.Connection.Open();
                }

                sqlCommand.ExecuteNonQuery();
                string password = sqlCommand.Parameters["@password"].Value.ToString();
                string mobile   = sqlCommand.Parameters["@mobile"].Value.ToString();
                if (password != null)
                {
                    string message = "Your PASSWORD for True Voter is " + commoncode.DESDecrypt(password) + "";
                    commoncode.SMS(mobile, message);
                    return(CommonCode.OK.ToString());
                }
                else
                {
                    return(CommonCode.WRONG_INPUT.ToString());
                }
            }
            catch (SqlException)
            {
                return(CommonCode.SQL_ERROR.ToString());
            }
            catch (Exception)
            {
                return(CommonCode.ERROR.ToString());
            }
            finally { sqlCommand.Connection.Close(); sqlCommand.Dispose(); }
        }
Beispiel #20
0
    private void getDetails()
    {
        UserBLL user = new UserBLL();

        user.LoginId = Convert.ToString(Session["LoginId"]);
        DataSet ds = user.GetUserDetails(user);

        try
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                CommonCode cc = new CommonCode();
                txtLoginId.Text    = Convert.ToString(ds.Tables[0].Rows[0]["LoginId"]);
                txtUserName.Text   = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]);
                txtPassword.Text   = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["Password"]));
                txtRePassword.Text = cc.DESDecrypt(Convert.ToString(ds.Tables[0].Rows[0]["Password"]));
                txtContactNo.Text  = Convert.ToString(ds.Tables[0].Rows[0]["ContactNo"]);
                txtAddress.Text    = Convert.ToString(ds.Tables[0].Rows[0]["Address"]);
            }
        }
        catch (Exception ex)
        {
        }
    }
Beispiel #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string d = Request.QueryString[0];
                if (d != "")
                {
                    try
                    {
                        d = cc.DESDecrypt(d);
                        string[] d1 = d.Split('$');
                        hfCanMob.Value = d1[0].ToString();
                        hfDistId.Value = d1[1].ToString();
                        hfLbId.Value   = d1[2].ToString();
                        hfLbTyp.Value  = d1[3].ToString();

                        SqlParameter[] par = new SqlParameter[5];
                        par[0] = new SqlParameter("@DistId", 0);
                        par[1] = new SqlParameter("@lbId", 0);
                        par[2] = new SqlParameter("@CanMoNo", d1[0].ToString());
                        par[3] = new SqlParameter("@qry", "2");
                        DataSet ds = new DataSet();
                        ds = SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "uspNoticeLocalBodyWise", par);

                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            if (ds.Tables[0].Rows[0]["Status"].ToString() == "CLOSED")
                            {
                                remarkInsert.Visible = false;
                                btnstatus.Visible    = false;
                            }
                            else
                            {
                                remarkInsert.Visible = true;
                            }

                            FvNoticeAndDis.DataSource = ds.Tables[0];
                            FvNoticeAndDis.DataBind();
                        }
                        BindGridRemark();
                    }
                    catch (Exception) { }
                }
            }
        }
Beispiel #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string d = Request.QueryString[0];

            if (d != "")
            {
                d = cc.DESDecrypt(d);
                string[] d1 = d.Split('$');
                mob     = d1[0].ToString();
                groupId = d1[1].ToString();
                bindBasicGroupData(mob, groupId);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Session is Expired..')", true);
                Response.Redirect("../Admin/Login.aspx");
            }
        }
Beispiel #23
0
    private void usrFrndRelSms(string mobileNo)
    {
        DataTable dtUserInfoList = urUserRegBLLObj.BLLGetUserRegistrationSMSInfo(mobileNo);
        DataRow   drUserinfo     = dtUserInfoList.Rows[0];
        string    sendTo         = Convert.ToString(drUserinfo["usrMobileNo"]);
        string    password       = cc.DESDecrypt(Convert.ToString(drUserinfo["usrPassword"]));
        string    myName         = Convert.ToString(drUserinfo["usrFirstName"]);
        string    firstName      = Convert.ToString(Session["UserFirstNameN"]);
        string    lastName       = Convert.ToString(Session["UserLastNameN"]);

        string sendFrom   = Convert.ToString(Session["Mobile"]);
        string senderName = firstName + " " + lastName;

        string passwordMessage = "I " + senderName + " added u as a Friend/Relative in come2mycity.com. U use it to send free SMS. Dear " + myName + ",Password for ur First Login is " + password;

        cc.SendMessage1(sendFrom, sendTo, passwordMessage);
        cc.SendMessageImp1(sendFrom, sendTo, passwordMessage);
    }
Beispiel #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack)
     {
         string d = Request.QueryString[0];
         if (d != "")
         {
             try
             {
                 d = cc.DESDecrypt(d);
                 string[] d1 = d.Split('$');
                 hfCanMob.Value = d1[0].ToString();
                 hfLbId.Value   = d1[1].ToString();
                 hfWard.Value   = d1[2].ToString();
                 hfLbTyp.Value  = d1[3].ToString();
                 hfDistId.Value = d1[4].ToString();
             }
             catch (Exception) { }
         }
     }
 }
Beispiel #25
0
    public int InsertDataToEvidyalaya(string UserMobileNo, string RefmobileNo, string password, string strDevId, string strSimSerialNo, string firstName, string lastName, string address, string eMailId, int Role_Id, string pincode, string latitude, string longitude, int state, int district, int Taluka, string getUserID)
    {
        try
        {
            cmd.CommandText = "uspInsertRegDetails";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = con;

            cmd.Parameters.AddWithValue("@firstName", firstName);
            cmd.Parameters.AddWithValue("@lastName", lastName);
            cmd.Parameters.AddWithValue("@mobileNumber", UserMobileNo);
            cmd.Parameters.AddWithValue("@emailId", eMailId);
            cmd.Parameters.AddWithValue("@usrPassword", cc.DESDecrypt(password.Trim()));
            cmd.Parameters.AddWithValue("@roleId", Role_Id);
            cmd.Parameters.AddWithValue("@refMobileNumber", RefmobileNo);
            cmd.Parameters.AddWithValue("@address", address);
            cmd.Parameters.AddWithValue("@pincode", pincode);
            cmd.Parameters.AddWithValue("@stateId", state);
            cmd.Parameters.AddWithValue("@districtId", district);
            cmd.Parameters.AddWithValue("@talukaId", Taluka);
            cmd.Parameters.AddWithValue("@imeiNumber", strDevId);
            cmd.Parameters.AddWithValue("@simSerialNumber", strSimSerialNo);
            cmd.Parameters.AddWithValue("@longitude", longitude);
            cmd.Parameters.AddWithValue("@lattitude", latitude);
            cmd.Parameters.AddWithValue("@myctUserId", getUserID);
            cmd.Parameters.AddWithValue("@insertBy", UserMobileNo);
            if (cmd.Connection.State == ConnectionState.Closed)
            {
                con.Open();
            }
            cmd.ExecuteNonQuery();
            con.Close();
            cmd.Parameters.Clear();
            return(1);
        }
        catch
        {
            return(0);
        }
    }
    public bool RecoverMyPassword()
    {
        bool flag = false;

        try
        {
            DataTable dtUserInfoList;
            string    mobileNo = txtFPMobileNo.Text;
            urUserRegBLLObj.BLLUserPasswordRecovery(mobileNo, out dtUserInfoList, out status);

            if (status == 0)
            {
                flag = false;
            }
            else
            {
                DataTable dtUserSMSInfoList = dtUserInfoList;
                DataRow   dRowUserInfo      = dtUserSMSInfoList.Rows[0];
                string    myMobileNo        = Convert.ToString(dRowUserInfo["usrMobileNo"]);
                string    myPassword        = cc.DESDecrypt(Convert.ToString(dRowUserInfo["usrPassword"]));
                string    myName            = Convert.ToString(dRowUserInfo["usrFullName"]);

                string sendFrom        = "Recovery SMS";
                string passwordMessage = "Dear " + myName + ", Your Password For Login is :: " + myPassword + " Thanks Via www.myct.in ";
                int    smslength       = passwordMessage.Length;
                bool   flagmessage1    = cc.TransactionalSMSCountry(sendFrom, myMobileNo, passwordMessage, smslength, 18);

                if (flagmessage1 == true)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Password sent Successfully...Password will be devlivered shortly on your registered Mobile No.')", true);
                }
                flag = true;
                txtFPMobileNo.Text = "";
            }
        }
        catch (Exception ex)
        {
        }
        return(flag);
    }
        public string myct(string username, string password)
        {
            SqlCommand sqlCommand = new SqlCommand();

            try
            {
                sqlCommand.Connection  = new SqlConnection(ConfigurationManager.ConnectionStrings["myctConnectionString"].ConnectionString);
                sqlCommand.CommandText = "select usrPassword,(select top 1  usertype FROM [Come2myCityDB].[dbo].[EzeeDrugsAppDetail](NOLOCK) where UserId=usrUserId and [keyword]='TRUEVOTER' ORDER BY usertype DESC ) as usertype from [Come2myCityDB].[dbo].[UserMaster] where usrMobileNo='" + username + "'";
                SqlDataAdapter adapter = new SqlDataAdapter();
                adapter.SelectCommand = sqlCommand;
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    CommonCode cc          = new CommonCode();
                    string     temppasword = cc.DESDecrypt(ds.Tables[0].Rows[0][0].ToString());
                    if (temppasword == password)
                    {
                        return(ds.Tables[0].Rows[0][1].ToString());
                    }
                    else
                    {
                        return(CommonCode.FAIL.ToString());
                    }
                }
                else
                {
                    return(CommonCode.FAIL.ToString());
                }
            }
            catch (SqlException)
            {
                return(CommonCode.SQL_ERROR.ToString());
            }
            catch (Exception)
            {
                return(CommonCode.ERROR.ToString());
            }
        }
Beispiel #28
0
    public void InsertRegDetails(string firstName, string lastName, string mobileNumber, string emailId, string password, int roleId, string refMobileNumber, string myctUserId, string pincode, int stateId, int districtId, int talukaId, string villageName, string imeiNumber, string simSerialNumber, string longitude, string latitude)
    {
        try
        {
            cmd.Connection  = con;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "uspInsertRegFromApp";

            cmd.Parameters.AddWithValue("@firstName", firstName.Trim());
            cmd.Parameters.AddWithValue("@lastName", lastName.Trim());
            cmd.Parameters.AddWithValue("@mobileNumber", mobileNumber.Trim());
            cmd.Parameters.AddWithValue("@emailId", emailId.Trim());
            cmd.Parameters.AddWithValue("@password", cc.DESDecrypt(password.Trim()));
            cmd.Parameters.AddWithValue("@roleId", roleId);
            cmd.Parameters.AddWithValue("@refMobNumber", refMobileNumber.Trim());
            cmd.Parameters.AddWithValue("@myctUserId", myctUserId.Trim());
            cmd.Parameters.AddWithValue("@pincode", pincode);
            cmd.Parameters.AddWithValue("@stateId", stateId);
            cmd.Parameters.AddWithValue("@districtId", districtId);
            cmd.Parameters.AddWithValue("@talukaId", talukaId);
            cmd.Parameters.AddWithValue("@villageName", villageName);
            cmd.Parameters.AddWithValue("@imeiNumber", imeiNumber.Trim());
            cmd.Parameters.AddWithValue("@simSerialNumber", simSerialNumber.Trim());
            cmd.Parameters.AddWithValue("@longitude", longitude);
            cmd.Parameters.AddWithValue("@latitude", latitude);

            if (cmd.Connection.State == ConnectionState.Closed)
            {
                cmd.Connection.Open();
            }
            cmd.ExecuteNonQuery();
            cmd.Connection.Close();
        }
        catch (Exception ex)
        {
        }
    }
    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;
        }
    }
Beispiel #30
0
    public bool RegisterNew(string mno, string fnm, string lnm, string pin, string gr, string Add)
    {
        int  status = 1;
        bool Check  = false;

        //cqc.usrAltMobileNo=mno ;
        try
        {
            string usrmoNo = Convert.ToString(Session["Mobile"]); //textBox2.Text.ToString();
            cqc.usrMobileNo = usrmoNo.ToString();
            status          = BLLIsExistUserRegistrationInitial(usrmoNo);
            if (status == 0)
            {
                status = BLLIsExistUserRegistrationInitial(mno);
                if (status == 0)
                {
                    //DataTable dt1 = new DataTable();
                    string  sql = "select usrUserId, usrFirstName,usrCityId from UserMaster where usrMobileNo='" + usrmoNo.ToString() + "'";
                    DataSet ds  = new DataSet();
                    ds = 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"]);
                        cqc.frnrelUserId = userId;
                        cqc.usrCityId    = cityId;
                        //ur.frnrelFrnRelName = usrName;
                        //ur.frnrelRelation = "friend";
                        //ur.frnrelGroup = "1";
                    }
                    string  sql1 = "select usrUserId, usrFirstName from UserMaster where usrMobileNo='" + mno.ToString() + "'";
                    DataSet ds1  = new DataSet();
                    ds1 = ExecuteDataset(sql1);
                    string   FriId;
                    string   FriName;
                    string[] RgArr = gr.Split('&');
                    if (RgArr.Length > 0)
                    {
                        for (int s = 0; s < RgArr.Length; s++)
                        {
                            foreach (DataRow dr2 in ds1.Tables[0].Rows)
                            {
                                FriId                = Convert.ToString(dr2["usrUserId"]);
                                FriName              = Convert.ToString(dr2["usrFirstName"]);
                                cqc.frnrelFriendId   = FriId;
                                cqc.frnrelFrnRelName = FriName;
                                cqc.frnrelRelation   = "friend";
                                cqc.frnrelGroup      = RgArr[s].ToString();
                            }

                            status = cqc.BLLInsertUserFriendRelative(cqc);
                        }
                    }
                    else
                    {
                        foreach (DataRow dr2 in ds1.Tables[0].Rows)
                        {
                            FriId                = Convert.ToString(dr2["usrUserId"]);
                            FriName              = Convert.ToString(dr2["usrFirstName"]);
                            cqc.frnrelFriendId   = FriId;
                            cqc.frnrelFrnRelName = FriName;
                            cqc.frnrelRelation   = "friend";
                            cqc.frnrelGroup      = "1";
                        }

                        status = cqc.BLLInsertUserFriendRelative(cqc);
                    }
                    //if (status > 0)
                    //{
                    //    string SendTo = mno.ToString();
                    //    string sendFrom = usrmoNo.ToString();
                    //    string message = "I " + usrName + "(" + sendFrom.ToString() + ") added u in come2myCity.com to send free SMS." + cc.AdvMessage();
                    //    //string passwordMessage = "I " + usrName + "(" + sendFrom.ToString() + ") of Abhinav B.Ed college Chikhli,Dist-Buldhana,added u as a Frnd 2 send free SMS frm come2mycity.com. For B.Ed admission help pl call me";
                    //    cc.SendMessage1(sendFrom, SendTo, message);

                    //}
                    Check = true;
                }
                else
                {
                    string  sql3 = "select usrUserId, usrFirstName,usrCityId from UserMaster where usrMobileNo='" + cqc.usrMobileNo + "'";
                    DataSet ds   = new DataSet();
                    ds = ExecuteDataset(sql3);
                    //dt1 = ds.Tables[0];
                    string userId;
                    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"]);
                        cqc.frnrelUserId = userId;
                        cqc.usrCityId    = cityId;
                        //ur.frnrelFrnRelName = usrName;
                        //ur.frnrelRelation = "friend";
                        //ur.frnrelGroup = "1";
                    }
                    string sqlquery = "select cityName from CityMaster where cityId='" + Convert.ToString(cityId) + "'";
                    cityName = ExecuteScalar(sqlquery);

                    cqc.usrUserId   = System.Guid.NewGuid().ToString();
                    cqc.usrAddress  = Convert.ToString(Add);
                    cqc.usrMobileNo = mno.ToString();

                    cqc.usrFirstName = fnm.ToString();
                    cqc.usrLastName  = lnm.ToString();
                    cqc.usrPIN       = pin.ToString();

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

                    status = cqc.DALInsertUserRegistrationInitial(cqc);
                    if (status > 0)
                    {
                        string  sql1 = "select usrUserId, usrFirstName from UserMaster where usrMobileNo='" + cqc.usrMobileNo + "'";
                        DataSet ds1  = new DataSet();
                        ds1 = ExecuteDataset(sql1);
                        //dt1 = ds.Tables[0];
                        string   FriId;
                        string   FriName;
                        string[] RgArr = gr.Split('&');
                        if (RgArr.Length > 0)
                        {
                            for (int s = 0; s < RgArr.Length; s++)
                            {
                                foreach (DataRow dr2 in ds1.Tables[0].Rows)
                                {
                                    FriId                = Convert.ToString(dr2["usrUserId"]);
                                    FriName              = Convert.ToString(dr2["usrFirstName"]);
                                    cqc.frnrelFriendId   = FriId;
                                    cqc.frnrelFrnRelName = FriName;
                                    cqc.frnrelRelation   = "friend";
                                    cqc.frnrelGroup      = RgArr[s].ToString();
                                }

                                status = cqc.BLLInsertUserFriendRelative(cqc);
                            }
                        }
                        else
                        {
                            foreach (DataRow dr2 in ds1.Tables[0].Rows)
                            {
                                FriId                = Convert.ToString(dr2["usrUserId"]);
                                FriName              = Convert.ToString(dr2["usrFirstName"]);
                                cqc.frnrelFriendId   = FriId;
                                cqc.frnrelFrnRelName = FriName;
                                cqc.frnrelRelation   = "friend";
                                cqc.frnrelGroup      = "1";
                            }
                        }

                        //string FriId;
                        //string FriName;
                        //foreach (DataRow dr2 in ds1.Tables[0].Rows)
                        //{
                        //    FriId = Convert.ToString(dr2["usrUserId"]);
                        //    FriName = Convert.ToString(dr2["usrFirstName"]);
                        //    cqc.frnrelFriendId = FriId;
                        //    cqc.frnrelFrnRelName = FriName;
                        //    cqc.frnrelRelation = "friend";
                        //    cqc.frnrelGroup = "1";

                        //}

                        status = cqc.BLLInsertUserFriendRelative(cqc);
                        if (status > 0)
                        {
                        }
                        string senderId        = Convert.ToString(Session["Mobile"]); //textBox2.Text.ToString();
                        string sendThrugh      = "myctin";
                        string myMobileNo      = mno.ToString();
                        string myPassword      = cc.DESDecrypt(cqc.usrPasssword);
                        string myName          = cqc.frnrelFrnRelName;
                        string passwordMessage = "I " + usrName + "(" + senderId.ToString() + ") added u in city " + cityName + " on myct.in.U use it to send free SMS.Password for ur First Login is " + myPassword + " for www.muct.in";
                        string NewTraResp      = "Dear " + fnm.ToString() + " I " + usrName.ToString() + "(" + senderId.ToString() + ") added  u on www.myct.in as a friend to send imp messages. Ur login password is " + myPassword.ToString() + " thanks.Via www.myct.in";
                        cc.SendMessage1(sendThrugh, myMobileNo, NewTraResp);
                        Check = true;
                    }
                }
            }
            else
            {
                //NotRegisterMessageForLongCode(urRegistBll);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(Check);
    }