| |
| 1 |
#region Header |
| 2 |
//Module Name : Default.aspx |
| 3 |
//Creator Name : Ganesh Sonar |
| 4 |
//Created Date : 05/18/2009 |
| 5 |
//Last Modified : |
| 6 |
#endregion Header |
| 7 |
|
| 8 |
using System; |
| 9 |
using System.Collections.Generic; |
| 10 |
using System.Linq; |
| 11 |
using System.Web; |
| 12 |
using System.Web.UI; |
| 13 |
using System.Web.UI.WebControls; |
| 14 |
using MTCM.Bo; |
| 15 |
using System.Data; |
| 16 |
using System.Configuration; |
| 17 |
using System.Windows.Forms; |
| 18 |
|
| 19 |
namespace MTCM.Web |
| 20 |
{ |
| 21 |
public partial class _Default : System.Web.UI.Page |
| 22 |
{ |
| 23 |
protected void Page_Load(object sender, EventArgs e) |
| 24 |
{ |
| 25 |
btnOK.Attributes.Add("OnClick", "javascript:return emailCheck('txtEmail');"); |
| 26 |
btnScreeNameOK.Attributes.Add("OnClick", "javascript:return ScreenName_Submit('txtScreenName',50,true);"); |
| 27 |
} |
| 28 |
|
| 29 |
protected void btnOk_Click(object sender, EventArgs e) |
| 30 |
{ |
| 31 |
MTCM.Bo.User objUser = new User(); |
| 32 |
|
| 33 |
//Get the User Details |
| 34 |
DataTable userDetail = objUser.CheckLoginDetails(txtEmail.Text); |
| 35 |
|
| 36 |
if (userDetail.Rows.Count == 0) |
| 37 |
{ |
| 38 |
DialogResult diagResult= MessageBox.Show("No such user Exists", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Stop); |
| 39 |
if (diagResult == DialogResult.OK) |
| 40 |
{ |
| 41 |
txtEmail.Focus(); |
| 42 |
return; |
| 43 |
} |
| 44 |
} |
| 45 |
else |
| 46 |
{ |
| 47 |
if ((int)userDetail.Rows[0]["isExist"] == 0) |
| 48 |
{ |
| 49 |
Session["UserId"] = userDetail.Rows[0]["userid"]; |
| 50 |
lblEmail.Visible = false; |
| 51 |
txtEmail.Visible = false; |
| 52 |
lblScreenName.Visible = true; |
| 53 |
txtScreenName.Visible = true; |
| 54 |
btnOK.Visible = false; |
| 55 |
btnScreeNameOK.Visible = true; |
| 56 |
} |
| 57 |
else if ((int)userDetail.Rows[0]["isExist"] == 1) |
| 58 |
{ |
| 59 |
Session["UserId"] = userDetail.Rows[0]["userid"]; |
| 60 |
Response.Redirect("Home.aspx"); |
| 61 |
} |
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
protected void btnCnl_Click1(object sender, EventArgs e) |
| 66 |
{ |
| 67 |
txtEmail.Text = ""; |
| 68 |
if (txtScreenName.Visible == true) |
| 69 |
{ |
| 70 |
txtScreenName.Text = ""; |
| 71 |
} |
| 72 |
} |
| 73 |
protected void btnScreeNameOK_Click(object sender, EventArgs e) |
| 74 |
{ |
| 75 |
|
| 76 |
MTCM.Bo.User objUser = new User(); |
| 77 |
|
| 78 |
objUser.InsertScreenName((int)Session["UserId"], txtScreenName.Text); |
| 79 |
Response.Redirect("Home.aspx"); |
| 80 |
} |
| 81 |
} |
| 82 |
} |
| |