protected void Page_Load(object sender, EventArgs e) { if (Session["chamadoValue"].ToString() == "") { ObjectDataSource1.SelectMethod = "SelectOnly"; } else if (Session["chamadoValue"].ToString() == "noCount") { ObjectDataSource1.SelectMethod = "SelectNo"; } else if (Session["chamadoValue"].ToString() == "myCount") { ObjectDataSource1.SelectMethod = "SelectMy"; SessionParameter empid = new SessionParameter(); empid.Name = "id"; empid.Type = TypeCode.String; empid.SessionField = "idusuario"; ObjectDataSource1.SelectParameters.Add(empid); ObjectDataSource1.DataBind(); } Session["chamadoValue"] = ""; }
protected void Page_Load(object sender, EventArgs e) { if (Session["tutorialValue"].ToString() == "search") { ObjectDataSource1.SelectMethod = "selectSearch"; string a = Session["tutorialb"].ToString(); string b = Session["filtro"].ToString(); //Passar chamadoValue como parâmetro SessionParameter empid = new SessionParameter(); empid.Name = "titulo"; empid.Type = TypeCode.String; empid.SessionField = "tutorialb"; ObjectDataSource1.SelectParameters.Add(empid); empid = new SessionParameter(); empid.Name = "idAssunto"; empid.Type = TypeCode.String; empid.SessionField = "filtro"; ObjectDataSource1.SelectParameters.Add(empid); ObjectDataSource1.DataBind(); } Session["tutorialValue"] = ""; }
protected void Page_Load(object sender, EventArgs e) { if ((Session["chamadoValue"].ToString() == "")) { ObjectDataSource1.SelectMethod = "SelectClose"; } else if (Session["chamadoValue"].ToString() == "search") { ObjectDataSource1.SelectMethod = "selectSearchFechados"; string a = Session["chamadob"].ToString(); //Passar chamadoValue como parâmetro SessionParameter empid = new SessionParameter(); empid.Name = "resumo"; empid.Type = TypeCode.String; empid.SessionField = "chamadob"; ObjectDataSource1.SelectParameters.Add(empid); ObjectDataSource1.DataBind(); } //Session["chamadobusca"] = ""; Session["chamadoValue"] = ""; }
protected void Page_Load(object sender, EventArgs e) { if ((Session["equipValue"].ToString() == "")) { ObjectDataSource3.SelectMethod = "SelectAll"; } else if (Session["equipValue"].ToString() == "search") { ObjectDataSource3.SelectMethod = "selectSearch"; //Passar chamadoValue como parâmetro SessionParameter empid = new SessionParameter(); empid.Name = "modelo"; empid.Type = TypeCode.String; empid.SessionField = "equipb"; ObjectDataSource3.SelectParameters.Add(empid); ObjectDataSource3.DataBind(); } Session["equipValue"] = ""; }
public void SessionParameter_Clone() { SessionParameterPoker sessionParam = new SessionParameterPoker("EmployeeName", TypeCode.String, "Name"); SessionParameter clonedParam = (SessionParameter)sessionParam.DoClone(); Assert.AreEqual("EmployeeName", clonedParam.Name, "SessionParameterCloneName"); Assert.AreEqual(TypeCode.String, clonedParam.Type, "SessionParameterCloneType"); }
public static bool TryParse(string cryptoLine, out SDPSecurityDescription securityDescription) { securityDescription = null; if (string.IsNullOrWhiteSpace(cryptoLine)) { return(false); } if (!cryptoLine.StartsWith(CRYPTO_ATTRIBUE_PREFIX)) { throw new FormatException($"cryptoLine '{cryptoLine}' is not recognized as a valid SDP Security Description "); } string sCryptoValue = cryptoLine.Substring(cryptoLine.IndexOf(COLON) + 1); securityDescription = new SDPSecurityDescription(); string[] sCryptoParts = sCryptoValue.Split(securityDescription.WHITE_SPACES, StringSplitOptions.RemoveEmptyEntries); if (sCryptoValue.Length < 2) { throw new FormatException($"cryptoLine '{cryptoLine}' is not recognized as a valid SDP Security Description "); } try { securityDescription.Tag = uint.Parse(sCryptoParts[0]); securityDescription.CryptoSuite = (from e in Enum.GetNames(typeof(CryptoSuites)) where e.CompareTo(sCryptoParts[1]) == 0 select(CryptoSuites) Enum.Parse(typeof(CryptoSuites), e)).FirstOrDefault(); if (securityDescription.CryptoSuite == CryptoSuites.unknown) { //this may not be a reason to return FALSE //there might be a new crypto key used } string[] sKeyParams = sCryptoParts[2].Split(SEMI_COLON); if (sKeyParams.Length < 1) { securityDescription = null; return(false); } foreach (string kp in sKeyParams) { KeyParameter keyParam = KeyParameter.Parse(kp, securityDescription.CryptoSuite); securityDescription.KeyParams.Add(keyParam); } if (sCryptoParts.Length > 3) { securityDescription.SessionParam = SessionParameter.Parse(sCryptoParts[3], securityDescription.CryptoSuite); } return(true); } catch { //catch all errors and throw own FormatException } return(false); }
private void Page_Load(object sender, EventArgs e) { // <Snippet1> // In this example, the session parameter "empid" is set // after the employee successfully logs in. SessionParameter empid = new SessionParameter(); empid.Name = "empid"; empid.Type = TypeCode.Int32; empid.SessionField = "empid"; // </Snippet1> }
protected void Page_Load(object sender, EventArgs e) { /*if(Session["tipocomentario"] == "") * { * PanelEx.visible = * }*/ if ((Session["chamadoValue"].ToString() == "")) { ObjectDataSource1.SelectMethod = "SelectOnly"; } else if (Session["chamadoValue"].ToString() == "noCount") { ObjectDataSource1.SelectMethod = "SelectNo"; } else if (Session["chamadoValue"].ToString() == "myCount") { ObjectDataSource1.SelectMethod = "SelectMy"; SessionParameter empid = new SessionParameter(); empid.Name = "id"; empid.Type = TypeCode.String; empid.SessionField = "idusuario"; ObjectDataSource1.SelectParameters.Add(empid); ObjectDataSource1.DataBind(); } else if (Session["chamadoValue"].ToString() == "search") { ObjectDataSource1.SelectMethod = "selectSearch"; string a = Session["chamadob"].ToString(); //Passar chamadoValue como parâmetro SessionParameter empid = new SessionParameter(); empid.Name = "resumo"; empid.Type = TypeCode.String; empid.SessionField = "chamadob"; ObjectDataSource1.SelectParameters.Add(empid); ObjectDataSource1.DataBind(); } //Session["chamadobusca"] = ""; Session["chamadoValue"] = ""; }
public ActionResult MakeOrderForEnteredUser(int?Id, HomeSet homeSet, HttpPostedFileBase file) { try { GetOrderNo(); SessionParameter sessionParameter = new SessionParameter(); sessionParameter.Name = Session["Id"].ToString(); //CheckUser(sessionParameter); CreateProcedureForLogined(Id, homeSet, file, sessionParameter); return(RedirectToAction("All_Services")); } catch { return(View()); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["salaValue"].ToString() == "search") { ObjectDataSource1.SelectMethod = "selectSearch"; //Passar chamadoValue como parâmetro SessionParameter empid = new SessionParameter(); empid.Name = "nome"; empid.Type = TypeCode.String; empid.SessionField = "sala"; ObjectDataSource1.SelectParameters.Add(empid); ObjectDataSource1.DataBind(); } Session["salaValue"] = ""; }
public SessionParameterPoker(SessionParameter param) : base(param) { }
public HomeSet CreateProcedureForLogined(int?id, HomeSet homeSet, HttpPostedFileBase file, SessionParameter sessionParameter) { int orderNumber = Convert.ToInt32(homeset.OrderNo); sessionParameter.Name = (Session["id"]).ToString(); if (orderNumber == 0) { using (SqlConnection sqlConnection = new SqlConnection(mainconn)) { sqlConnection.Open(); string command = "INSERT INTO [dbo].[Orders](UserId,TotalPrice) VALUES(@UserId, ((SELECT Price FROM [dbo].[Seveces] WHERE serviceId = @Id)*@Copies));" + "INSERT INTO [dbo].[Order_Services](serviceID, orderID, Photo,NumbCopies ) VALUES (@Id,(SELECT OrderId FROM [dbo].[Orders] WHERE UserId = @UserId AND StatusId = 1), @Image, @Copies);"; SqlCommand sqlCommand = new SqlCommand(command, sqlConnection); sqlCommand.Parameters.AddWithValue("@UserId", int.Parse(sessionParameter.Name)); sqlCommand.Parameters.AddWithValue("@Id", id); //sqlCommand.Parameters.AddWithValue("@TotalPrice", homeSet.Price); sqlCommand.Parameters.AddWithValue("@Copies", homeSet.copies); if (file != null && file.ContentLength > 0) { string filename = Path.GetFileName(file.FileName); string imgpath = Path.Combine(Server.MapPath("~/User-Images/"), filename); file.SaveAs(imgpath); } sqlCommand.Parameters.AddWithValue("@Image", "~/User-Images/" + file.FileName); sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); } return(homeset); } else { using (SqlConnection sqlConnection = new SqlConnection(mainconn)) { //int orderNumber = Convert.ToInt32(homeset.OrderNo); sqlConnection.Open(); string command = "INSERT INTO [dbo].[Order_Services](serviceID, orderID, Photo,NumbCopies ) VALUES (@Id,@OrderId, @Image, @Copies);" + "UPDATE [dbo].[Orders] SET TotalPrice = TotalPrice + ((SELECT Price From [dbo].[Seveces] WHERE serviceId = @Id)*@Copies);"; SqlCommand sqlCommand = new SqlCommand(command, sqlConnection); sqlCommand.Parameters.AddWithValue("@UserId", int.Parse(sessionParameter.Name)); sqlCommand.Parameters.AddWithValue("@Id", id); sqlCommand.Parameters.AddWithValue("@OrderId", orderNumber); sqlCommand.Parameters.AddWithValue("@Copies", homeSet.copies); if (file != null && file.ContentLength > 0) { string filename = Path.GetFileName(file.FileName); string imgpath = Path.Combine(Server.MapPath("~/User-Images/"), filename); file.SaveAs(imgpath); } sqlCommand.Parameters.AddWithValue("@Image", "~/User-Images/" + file.FileName); sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); } return(homeset); } }