本文整理汇总了C#中Data.IsOwnerUpForGrabs方法的典型用法代码示例。如果您正苦于以下问题:C# Data.IsOwnerUpForGrabs方法的具体用法?C# Data.IsOwnerUpForGrabs怎么用?C# Data.IsOwnerUpForGrabs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.IsOwnerUpForGrabs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCategoriesFromNode
protected void GetCategoriesFromNode(bool isUpdate, bool isOwner,
Telerik.Web.UI.RadTreeNode TreeNode, DataView dvCat, string ID, string revisionID)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
string ownerID = "";
bool isOwnerUpForGrabs = dat.IsOwnerUpForGrabs(ID, ref ownerID, ref isOwner, true);
if (TreeNode.Checked && TreeNode.Enabled)
{
dvCat.RowFilter = "CATEGORY_ID=" + TreeNode.Value;
//distinctHash.Add(CategoriesCheckBoxes.Items[i], 21);
//tagHash.Add(CategoriesCheckBoxes.Items[i], "22");
if (isUpdate)
{
if (isOwner || isOwnerUpForGrabs)
{
if (dvCat.Count == 0)
{
dat.Execute("INSERT INTO Venue_Category (VENUE_ID, CATEGORY_ID, tagSize) VALUES("
+ ID + ", " + TreeNode.Value + ", 22)");
}
}
else
{
if (dvCat.Count == 0)
{
dat.Execute("INSERT INTO VenueCategoryRevisions (AddOrRemove, VenueID, CatID, modifierID, RevisionID, DATE) " +
"VALUES(1, " + ID + ", " + TreeNode.Value + ", " + Session["User"].ToString() + ", " + revisionID + ", '" + DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")) + "')");
}
else
{
//dat.Execute("INSERT INTO VenueCategoryRevisions (AddOrRemove, VenueID, CatID, modifierID, RevisionID) " +
// "VALUES(0, " + ID + ", " + CategoryTree.Nodes[i].Value + ", " + Session["User"].ToString() + ", " + revisionID + ")");
}
}
}
else
{
dat.Execute("INSERT INTO Venue_Category (VENUE_ID, CATEGORY_ID, tagSize) VALUES("
+ ID + ", " + TreeNode.Value + ", 22)");
}
}
else if (!TreeNode.Checked)
{
dvCat.RowFilter = "CATEGORY_ID=" + TreeNode.Value;
if (isUpdate)
{
if (isOwner || isOwnerUpForGrabs)
{
if (dvCat.Count == 0)
{
}
else
{
dat.Execute("DELETE FROM Venue_Category WHERE VENUE_ID=" + ID +
" AND CATEGORY_ID = " + TreeNode.Value);
}
}
else
{
if (dvCat.Count == 0)
{
}
else
{
if (isOwnerUpForGrabs)
{
dat.Execute("DELETE FROM Venue_Category WHERE VENUE_ID=" + ID +
" AND CATEGORY_ID = " + TreeNode.Value);
}
else
{
dat.Execute("INSERT INTO VenueCategoryRevisions (AddOrRemove, VenueID, CatID, modifierID, RevisionID, DATE) " +
"VALUES(0, " + ID + ", " + TreeNode.Value + ", " + Session["User"].ToString() + ", " + revisionID + ", '" + DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")) + "')");
}
}
}
}
else
{
}
}
if (TreeNode.Nodes.Count > 0)
{
for (int j = 0; j < TreeNode.Nodes.Count; j++)
{
GetCategoriesFromNode(isUpdate, isOwner, TreeNode.Nodes[j], dvCat, ID, revisionID);
}
}
}
示例2: PostIt
protected void PostIt(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (AgreeCheckBox.Checked)
{
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
conn.Open();
bool mediaChanged = false;
bool contentChanged = false;
string mediaCat = "0";
if (PictureCheckList.Items.Count > 0)
mediaCat = "1";
bool isUpdate = false;
bool isOwner = false;
string ownerID = "";
DataSet dsVenue = new DataSet();
bool ownerUpForGrabs = false;
if (Request.QueryString["ID"] != null)
{
dsVenue = dat.GetData("SELECT * FROM Venues WHERE ID=" + Request.QueryString["ID"].ToString());
isUpdate = true;
ownerUpForGrabs = dat.IsOwnerUpForGrabs(Request.QueryString["ID"].ToString(), ref ownerID, ref isOwner, true);
}
string state = "";
if (StateDropDownPanel.Visible)
state = StateDropDown.SelectedItem.Text;
else
state = StateTextBox.THE_TEXT;
//We already do this in 'Onwards' method
//SqlCommand cmd = new SqlCommand("SELECT * FROM Venues WHERE [email protected] AND [email protected] AND [email protected] ", conn);
//cmd.Parameters.Add("@name", SqlDbType.NVarChar).Value = VenueNameTextBox.THE_TEXT;
//cmd.Parameters.Add("@city", SqlDbType.NVarChar).Value = CityTextBox.Text;
//cmd.Parameters.Add("@state", SqlDbType.NVarChar).Value = state;
//DataSet ds = new DataSet();
//SqlDataAdapter da = new SqlDataAdapter(cmd);
//da.Fill(ds);
//bool cont = false;
//if (ds.Tables.Count > 0)
// if (ds.Tables[0].Rows.Count > 0 && !isUpdate)
// {
// MessagePanel.Visible = true;
// YourMessagesLabel.Text += "<br/><br/>A venue under this name already exists in this City and State. To edit the details of this particular venue please contact Hippo Happenings " + "<a class=\"AddGreenLink\" href=\"ContactUs.aspx\">here</a>. Otherwise, please modify the name slightly.";
// }
// else
// cont = true;
//else
// cont = true;
bool cont = true;
if (cont)
{
string command = "";
if (isUpdate)
{
if (isOwner || ownerUpForGrabs)
command = "UPDATE Venues SET [email protected], [email protected], [email protected], Edit='False', [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], "
+ " [email protected], [email protected], [email protected], mediaCategory=" + mediaCat + ", [email protected] WHERE ID=" + Request.QueryString["ID"].ToString();
else
{
command = "INSERT INTO VenueRevisions (Web, modifierID, VenueID, [Content], " +
"City, State, Country, Zip, Name, Email, Phone, Address, DATE)"
+ " VALUES(@web, "+Session["User"].ToString()+"," + Request.QueryString["ID"].ToString() +
", @content, @city, @state, @country, @zip, "+
"@name, @email, @phone, @address, '"+DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"))+"')";
}
}
else
command = "INSERT INTO Venues (Web, Owner, City, State, Country, Zip, Edit, Name, Email, Phone, Address, CreatedByUser,Content, mediaCategory, Rating, PostedOn) "
+ "VALUES(@web, @owner, @city, @state, @country, @zip, 'False', @name, @email, @phone, @address, @user, @content, " + mediaCat + ", 0, @dateE)";
string locationStr = "";
string apt = "";
if (AptNumberTextBox.Text.Trim() != "")
apt = AptDropDown.SelectedItem.Text + " " + AptNumberTextBox.Text.Trim().ToLower();
if (CountryDropDown.SelectedValue == "223")
{
locationStr = StreetNumberTextBox.Text.Trim().ToLower() + ";" + StreetNameTextBox.Text.Trim().ToLower()
+ ";" + StreetDropDown.SelectedItem.Text + ";" + apt;
}
else
{
locationStr = LocationTextBox.Text.Trim().ToLower() + ";" + apt;
}
SqlCommand cmd = new SqlCommand(command, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add("@dateE", SqlDbType.DateTime).Value = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));
if (isUpdate && !isOwner)
//.........这里部分代码省略.........
示例3: GetCategoriesFromNode
protected string GetCategoriesFromNode(bool isUpdate, bool isOwner,
Telerik.Web.UI.RadTreeNode TreeNode, DataView dvCat, string ID, string revisionID)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
DateTime isn = DateTime.Now;
if (!DateTime.TryParse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"), out isn))
isn = DateTime.Now;
DateTime isNow = isn;
Data dat = new Data(isn); string ownerID = "";
string categories = "";
bool isOwnerUpForGrabs = dat.IsOwnerUpForGrabs(ID, ref ownerID, ref isOwner, false);
if (TreeNode.Checked && TreeNode.Enabled)
{
dvCat.RowFilter = "CategoryID=" + TreeNode.Value;
//distinctHash.Add(CategoriesCheckBoxes.Items[i], 21);
//tagHash.Add(CategoriesCheckBoxes.Items[i], "22");
if (isUpdate)
{
if (isOwner || isOwnerUpForGrabs)
{
if (dvCat.Count == 0)
{
dat.Execute("INSERT INTO Event_Category_Mapping (CategoryID, EventID, tagSize) VALUES("
+ TreeNode.Value + "," + ID + ", 22)");
if (categories != "")
categories += " OR ";
categories += " UC.CategoryID=" + TreeNode.Value;
}
}
else
{
if (dvCat.Count == 0)
{
string command22 = "INSERT INTO EventCategoryRevisions (AddOrRemove, EventID, CatID, modifierID, RevisionID, DATE) " +
"VALUES(1, " + ID + ", " + TreeNode.Value + ", " + Session["User"].ToString() + ", " + revisionID + ", '" + isn + "')";
Session["command"] = command22;
dat.Execute(command22);
}
else
{
//This case is unnecessary since if the Node is checked and it exists for this event, we don't need to do anything
//dat.Execute("INSERT INTO VenueCategoryRevisions (AddOrRemove, VenueID, CatID, modifierID, RevisionID) " +
// "VALUES(0, " + ID + ", " + CategoryTree.Nodes[i].Value + ", " + Session["User"].ToString() + ", " + revisionID + ")");
}
}
}
else
{
dat.Execute("INSERT INTO Event_Category_Mapping (CategoryID, EventID, tagSize) VALUES("
+ TreeNode.Value + "," + ID + ", 22)");
if (categories != "")
categories += " OR ";
categories += " UC.CategoryID=" + TreeNode.Value;
}
}
else if (!TreeNode.Checked)
{
dvCat.RowFilter = "CategoryID=" + TreeNode.Value;
if (isUpdate)
{
if (isOwner || isOwnerUpForGrabs)
{
if (dvCat.Count == 0)
{
}
else
{
dat.Execute("DELETE FROM Event_Category_Mapping WHERE EventID=" + ID +
" AND CategoryID = " + TreeNode.Value);
}
}
else
{
if (dvCat.Count == 0)
{
}
else
{
if (isOwnerUpForGrabs)
{
dat.Execute("DELETE FROM Event_Category_Mapping WHERE EventID=" + ID +
" AND CategoryID = " + TreeNode.Value);
}
else
{
dat.Execute("INSERT INTO EventCategoryRevisions (AddOrRemove, EventID, CatID, modifierID, RevisionID, DATE) " +
"VALUES(0, " + ID + ", " + TreeNode.Value + ", " + Session["User"].ToString() + ", " + revisionID + ", '" + isn.ToString() + "')");
}
}
}
}
//.........这里部分代码省略.........
示例4: PostIt
//.........这里部分代码省略.........
}
else
{
goOn = true;
Session["Featured"] = false;
}
}
else
{
goOn = true;
Session["Featured"] = false;
}
if (goOn)
{
string textEmail = "";
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
conn.Open();
string mediaCat = "0";
if (PictureCheckList.Items.Count > 0)
mediaCat = "1";
bool isOwner = false;
string ownerID = "";
bool ownerUpForGrabs = false;
bool wasFeatured = false;
bool isEditing = false;
if (isEdit.Text != "")
{
isEditing = bool.Parse(isEdit.Text);
ownerUpForGrabs = dat.IsOwnerUpForGrabs(Request.QueryString["ID"].ToString(),
ref ownerID, ref isOwner, false);
}
bool hadSongs = false;
DataSet dsEvent = new DataSet();
DataView dvEvent = new DataView();
string theCat = "NULL";
if (isEditing)
{
dsEvent = dat.GetData("SELECT * FROM Events WHERE ID=" + eventID.Text);
dvEvent = dat.GetDataDV("SELECT * FROM Events WHERE ID=" + eventID.Text);
wasFeatured = bool.Parse(dsEvent.Tables[0].Rows[0]["Featured"].ToString());
hadSongs = bool.Parse(dsEvent.Tables[0].Rows[0]["hasSongs"].ToString());
if (dsEvent.Tables[0].Rows[0]["MediaCategory"].ToString() != mediaCat)
{
theCat = mediaCat;
hasEditChanged = true;
}
}
string addAdressBeg = "";
string addAddressEnd = "";
string addAddressUpdate = "";
string privInsertBeg = ", Private ";
string privInsertEnd = ", 'False' ";
string privUpdate = ", Private = 'False' ";
if (LocaleRadioButtonList.SelectedValue == "1")
{