Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SET NOCOUNT ON;
IF EXISTS
(
SELECT 1
FROM dbo.People
WHERE UserName = @UserName
AND SiteID = @SiteID
)
BEGIN
RAISERROR (N'UserName %s already exists. Please choose another username.',
16, -- Severity,
1, -- State,
@UserName)
RETURN -1
END
protected void Form_ItemInserted(object sender, FormViewInsertedEventArgs e)
{
string Text;
bool CloseWindow = false;
if (e.Exception == null)
{
if (Request.QueryString["pid"] != null && Request.QueryString["pid"].Length > 0)
{
Text = string.Format("You just inserted {0} {1}", e.Values["FirstName"], e.Values["LastName"]);
this.UPDATE_OPENER.Text = "<script language=\"JavaScript\">changeParent('" + Request.QueryString["pid"] + "','" + e.Values["LastName"] + ", " + e.Values["FirstName"] + " " + (e.Values["MiddleName"] ?? "") + "'," +
this.NewPersonID + ",'" + Text.Replace("'","\\'") + "');</script>";
CloseWindow = true;
this.UPDATE_OPENER.Visible = true;
}
else
{
Text = string.Format("You just inserted {0} {1} <a href='peopleV.aspx?perid={2}'>" +
"Edit Here</a>", e.Values["FirstName"], e.Values["LastName"], this.NewPersonID);
this.DisplayMessage(Text, CloseWindow);
this.MltvwViewForms.Visible = false;
}
}
else // Exception case
{
Text = "The data was entered in an incorrect format, please check it over." +
" " + e.Exception.Message.Replace(Environment.NewLine, "\\n").Replace("\"", "\\\"");
this.DisplayMessage(Text, CloseWindow);
e.ExceptionHandled = true;
e.KeepInInsertMode = true;
}
}