protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (Page.IsValid) { if (e.CommandName == "Select") { Users newUser; dbHelper helper = new dbHelper(); newUser = helper.GetUserbyName(TextBoxUser.Text); if (newUser == null) { newUser = new Users(); newUser.UserName = TextBoxUser.Text; newUser.UserType = "local"; newUser.SNUserId = "local" + TextBoxUser.Text; helper.AddToModel(newUser); } Session["user"] = newUser; WebControl wc = e.CommandSource as WebControl; GridViewRow row = wc.NamingContainer as GridViewRow; Session["UseCaseStartTime"] = DateTime.Now; Session["UseCaseNumber"] = row.RowIndex + 1; Session["UseCaseText"] = row.Cells[1].Text; Server.Transfer("Design.aspx"); } } }
protected void Button2_Click(object sender, EventArgs e) { dbHelper helper = new dbHelper(); Users currentUser = new Users(); currentUser = helper.GetTestUser(); Session["user"] = currentUser; Server.Transfer("Design.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (Object.ReferenceEquals(Session["fbApi"], null)) { Server.Transfer("Error.aspx"); } fbApi = (FacebookConnector)Session["fbApi"]; if (Object.ReferenceEquals(Session["user"], null)) { currentUser = (Users)Session["user"]; } if (IsPostBack) { } Label1.Text = fbApi.AccessToken; }
/// <summary> /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUsers(Users users) { base.AddObject("Users", users); }
/// <summary> /// Create a new Users object. /// </summary> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="sNUserId">Initial value of the SNUserId property.</param> /// <param name="userName">Initial value of the UserName property.</param> public static Users CreateUsers(global::System.Int32 userId, global::System.String sNUserId, global::System.String userName) { Users users = new Users(); users.UserId = userId; users.SNUserId = sNUserId; users.UserName = userName; return users; }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { } else { if (Object.ReferenceEquals(Request.QueryString["code"], null)) { if (Object.ReferenceEquals(Session["fbApi"], null)) { InitializeApp(); } } else { FacebookConnector fbApi = (FacebookConnector)Session["fbApi"]; if (Object.ReferenceEquals(Session["token"], null)) { fbApi.connectApp(Request.QueryString["code"], null); Session["token"] = fbApi.AccessToken; } else { fbApi.connectApp(Request.QueryString["code"], Session["token"].ToString()); } FacebookUser fbCurrentUser = fbApi.GetUserInfo(true); Users currentUser = new Users(); currentUser.SNUserId = fbCurrentUser.UserID; currentUser.UserName = fbCurrentUser.UserName; currentUser.UserType = "facebook"; Session["user"] = currentUser; if (Object.ReferenceEquals(Session["nextPage"], null)) { Server.Transfer("Design.aspx"); } else { Server.Transfer(Session["nextPage"].ToString()); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { dt = new DataTable(); MakeDataTable(); String lastNode = null; SetActionGrid(lastNode); dtOptions = new DataTable(); MakeDataTableOptions(); AddToDataTableOptions("Add Options..."); BindGridOptions(); dtImports = new DataTable(); MakeDataTableImports(); _listFlowActOpt = new List<FlowActionOptions>(); _listFlowActInput = new List<FlowActionInputs>(); _listFlowActOutput = new List<FlowActionOutputs>(); _listActOpt = new List<ActionOptions>(); _listFlowMultiOpt = new List<FlowMultiOptions>(); if (!Object.ReferenceEquals(Session["user"], null)) { _user = (Users)Session["user"]; } else { dbHelper helper = new dbHelper(); _user = helper.GetTestUser(); } if (!Object.ReferenceEquals(Session["UseCaseNumber"], null)) { _useCaseNumber = (int)Session["UseCaseNumber"]; } else { _useCaseNumber = 0; } if (!Object.ReferenceEquals(Session["UseCaseStartTime"], null)) { _useCaseStartTime = (DateTime)Session["UseCaseStartTime"]; } else { _useCaseStartTime = DateTime.Now; } if (!Object.ReferenceEquals(Session["UseCaseText"], null)) { LabelUseCaseTooltip.Text = (String)Session["UseCaseText"]; } else { LabelUseCaseTooltip.Text = "Implement a process that meet your needs. Give it a meaningful name when saving."; } //Panel1.Visible = false; } else { dt = (DataTable)ViewState["MainFlow"]; dtOptions = (DataTable)ViewState["TableOptions"]; dtImports = (DataTable)ViewState["DataImports"]; _listFlowActOpt = (List<FlowActionOptions>)ViewState["FlowActionOptions"]; _listFlowActInput = (List<FlowActionInputs>)ViewState["FlowActionInputs"]; _listFlowActOutput = (List<FlowActionOutputs>)ViewState["FlowActionOutputs"]; _listActOpt = (List<ActionOptions>)ViewState["ActionOptions"]; _listFlowMultiOpt = (List<FlowMultiOptions>)ViewState["FlowMultiOptions"]; _user = (Users)Session["user"]; _useCaseNumber = (int)Session["UseCaseNumber"]; _useCaseStartTime = (DateTime)Session["UseCaseStartTime"]; //Panel1.Visible = false; } ViewState["MainFlow"] = dt; ViewState["TableOptions"] = dtOptions; ViewState["DataImports"] = dtImports; ViewState["FlowActionOptions"] = _listFlowActOpt; ViewState["FlowActionInputs"] = _listFlowActInput; ViewState["FlowActionOutputs"] = _listFlowActOutput; ViewState["ActionOptions"] = _listActOpt; ViewState["FlowMultiOptions"] = _listFlowMultiOpt; //String selectedId = GridView1.DataKeys[row.RowIndex].Value.ToString(); Session["user"] = _user; Session["UseCaseNumber"] = _useCaseNumber; Session["UseCaseStartTime"] = _useCaseStartTime; }