public void FacebookLogin() { fbWebContext = FacebookWebContext.Current; //get facebook session if (FacebookWebContext.Current.Session != null) { var app = new FacebookWebClient(); var me = (IDictionary<string, object>)app.Get("me"); // get own information _FacebookUid = fbWebContext.UserId ; // get own user id try { string fbName = (string)me["first_name"] + " " + (string)me["last_name"]; // get first name and last name if (OnFacebookLogin(fbName)) { SaveSessionInDB(); return; } else { string notice = string.Format("<h2>Welcome, {0}.</h2>" + "<h3>Login here to connect your Facebook login to your account<br/>" + "Or sign-up to create full account, connected with your Facebook credentials</h3>", fbName); } } catch (Exception ex) { } } }
/// <summary> /// Constructor. /// </summary> /// <param name="row">Row index.</param> /// <param name="col">Column index.</param> /// <param name="nDem">DEM list index.</param> public Index(int row, int col, Dem dem) { this.col = col; this.row = row; this.dem = dem; this.alt = null; }
public Doctor_Hospital_Search(Nullable<int> doctorId, string doctorName, Nullable<int> genderId, string gender, Nullable<int> specialistFieldId, string specialistField, Nullable<int> subSpecialistFieldId, string subSpecialistField, Nullable<int> specialPracticeId, Nullable<int> specialPractice, Nullable<int> countryId, string country, Nullable<int> cityId, string city, string countryOfSpecializedDegree, Nullable<int> countryOfSpecializedDegreeId, string specializedExperience, Nullable<int> countryOfPostGraduateExperienceId, string countryOfPostGraduateExperience, Nullable<int> hospitalId, string hospital, Nullable<int> departmentId, string department) { this.DoctorId = doctorId; this.DoctorName = doctorName; this.GenderId = genderId; this.Gender = gender; this.SpecialistFieldId = specialistFieldId; this.SpecialistField = specialistField; this.SubSpecialistFieldId = subSpecialistFieldId; this.SubSpecialistField = subSpecialistField; this.SpecialPracticeId = specialPracticeId; this.SpecialPractice = specialPractice; this.CountryId = countryId; this.Country = country; this.CityId = cityId; this.City = city; this.CountryOfSpecializedDegreeId = countryOfSpecializedDegreeId; this.CountryOfSpecializedDegree = countryOfSpecializedDegree; this.SpecializedExperience = specializedExperience; this.CountryOfPostGraduateExperienceId = countryOfPostGraduateExperienceId; this.CountryOfPostGraduateExperience = countryOfPostGraduateExperience; this.HospitalId = hospitalId; this.Hospital = hospital; this.DepartmentId = departmentId; this.Department = department; }
/// <summary> /// Sets the optional default values. /// </summary> /// <param name="shouldSet">if set to <c>true</c>, optional default values will be set.</param> public void SetDefaultValues(bool shouldSet) { if (shouldSet) { if (!this._isOverride.HasValue) this._isOverride = false; } }
/// <summary> /// Default constructor. /// </summary> public Index() { this.row = -1; this.col = -1; this.dem = null; this.alt = null; }
public ActionResult TweetPublished(Nullable<long> id, string actionPerformed, bool success = true) { ViewBag.TweetId = id; ViewBag.ActionType = actionPerformed; ViewBag.Success = success; return View(); }
public Scrollbar ( string name, Vector2 position, Axis axis, Nullable<int> width, Nullable<int> height, int max, int value )//, Style style) { this.Type = ControlType.Scrollbar; this.name = name; this.position = position; this.axis = axis; //this.style = style; this.min = 0; this.max = max; this.value = value; switch (axis) { case Axis.Horizontal: if (width.HasValue) size.X = width.Value; break; case Axis.Vertical: if (height.HasValue) size.Y = height.Value; break; } Init(); scrollUp.OnMousePress += new EventHandler( On_ScrollUp ); scrollDown.OnMousePress += new EventHandler( On_ScrollDown ); OnValueChange += new EventHandler( onValueChange ); }
// CRUD FUNCTION // ADD NEW ITEM USING AJAX public int AddData(string Name, Nullable<int> UOM, string Remarks, string BarCode, Nullable<bool> WithSerial, Nullable<int> Reorder, string Code, Nullable<int> G230, Nullable<int> G233, Nullable<int> G234, string Model) { var allItem = from m in db.PDs select m; if (allItem.Any(c => c.Name.ToLower().Equals(Name.ToLower()))) { Response.Write("Item with the name '" + Name + "' already exists"); Response.StatusCode = 404; Response.End(); return -1; } var pushPDS = new PD(); pushPDS.Name = Name; pushPDS.UOM = UOM; pushPDS.Remarks = Remarks; pushPDS.BarCode = BarCode; pushPDS.WithSerial = WithSerial; pushPDS.Reorder = Reorder; pushPDS.Code = Code; pushPDS.G230 = G230; pushPDS.G233 = G233; pushPDS.G234 = G234; pushPDS.Model = Model; db.PDs.InsertOnSubmit(pushPDS); db.SubmitChanges(); //Response.End(); return pushPDS.ID; }
/// <summary>Draws a rectangle.</summary> /// <param name="texture">The texture, or a null reference.</param> /// <param name="point">The top-left coordinates in pixels.</param> /// <param name="size">The size in pixels.</param> /// <param name="color">The color, or a null reference.</param> internal static void DrawRectangle(Textures.Texture texture, Point point, Size size, Nullable<Color128> color) { // TODO: Remove Nullable<T> from color once RenderOverlayTexture and RenderOverlaySolid are fully replaced. if (texture == null || !Textures.LoadTexture(texture, Textures.OpenGlTextureWrapMode.ClampClamp)) { Gl.glDisable(Gl.GL_TEXTURE_2D); if (color.HasValue) { Gl.glColor4d(color.Value.R, color.Value.G, color.Value.B, color.Value.A); } Gl.glBegin(Gl.GL_QUADS); Gl.glVertex2d(point.X, point.Y); Gl.glVertex2d(point.X + size.Width, point.Y); Gl.glVertex2d(point.X + size.Width, point.Y + size.Height); Gl.glVertex2d(point.X, point.Y + size.Height); Gl.glEnd(); } else { Gl.glEnable(Gl.GL_TEXTURE_2D); Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture.OpenGlTextures[(int)Textures.OpenGlTextureWrapMode.ClampClamp].Name); if (color.HasValue) { Gl.glColor4d(color.Value.R, color.Value.G, color.Value.B, color.Value.A); } Gl.glBegin(Gl.GL_QUADS); Gl.glTexCoord2f(0.0f, 0.0f); Gl.glVertex2d(point.X, point.Y); Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex2d(point.X + size.Width, point.Y); Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex2d(point.X + size.Width, point.Y + size.Height); Gl.glTexCoord2f(0.0f, 1.0f); Gl.glVertex2d(point.X, point.Y + size.Height); Gl.glEnd(); } }
public string Crear(string p_id, Nullable<DateTime> p_fecha, PalmeralGenNHibernate.Enumerated.Default_.EstadoPedidoEnum p_estado, PalmeralGenNHibernate.Enumerated.Default_.TipoPagoEnum p_tipoPago, System.Collections.Generic.IList<PalmeralGenNHibernate.EN.Default_.LineaPedidoEN> p_lineas, string p_proveedor) { PedidoEN pedidoEN = null; string oid; //Initialized PedidoEN pedidoEN = new PedidoEN (); pedidoEN.Id = p_id; pedidoEN.Fecha = p_fecha; pedidoEN.Estado = p_estado; pedidoEN.TipoPago = p_tipoPago; pedidoEN.Lineas = p_lineas; if (p_proveedor != null) { pedidoEN.Proveedor = new PalmeralGenNHibernate.EN.Default_.ProveedorEN (); pedidoEN.Proveedor.Id = p_proveedor; } //Call to PedidoCAD oid = _IPedidoCAD.Crear (pedidoEN); return oid; }
public static long ConvertDateTimeToTimeSpan(Nullable<DateTime> dt) { if (dt == null) return 0; TimeSpan ts = dt.Value.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, 0); long timeSpan = Convert.ToInt64(ts.TotalMilliseconds); return timeSpan; }
/// <summary> /// Sets the optional default values. /// </summary> /// <param name="shouldSet">if set to <c>true</c>, optional default values will be set.</param> public new void SetDefaultValues(bool shouldSet) { if (shouldSet) { this._treatCodedDataAsNumeric = true; } }
/// <summary> /// Sets the optional default values. /// </summary> /// <param name="shouldSet">if set to <c>true</c>, optional default values will be set.</param> public void SetDefaultValues(bool shouldSet) { if (shouldSet) { if (!this._isNCubeUniverse.HasValue) this._isNCubeUniverse = true; } }
/// <summary> /// Sets the optional default values. /// </summary> /// <param name="shouldSet">if set to <c>true</c>, optional default values will be set.</param> /// <exception cref="System.NotImplementedException"></exception> public void SetDefaultValues(bool shouldSet) { if(shouldSet) { if (!_isPrimary.HasValue) _isPrimary = true; } }
public static Rectangle Normalize(Rectangle rect, Vector2 pos, Vector2 origin, Nullable<Rectangle> sourceRectangle ) { return new Rectangle(rect.X - (int)pos.X + sourceRectangle.Value.X + (int)origin.X, rect.Y - (int)pos.Y + sourceRectangle.Value.Y + (int)origin.Y, rect.Width, rect.Height); }
public bool PosTest1() { bool retVal = true; const string c_TEST_DESC = "PosTest1: Verify the Nullable object's HasValue is true"; const string c_TEST_ID = "P001"; int value = TestLibrary.Generator.GetInt32(-55); int? nullObj = new Nullable<int>(value); TestLibrary.TestFramework.BeginScenario(c_TEST_DESC); try { if (!nullObj.HasValue) { string errorDesc = "value is not true as expected: Actual(false)"; errorDesc += "\n value is " + value; TestLibrary.TestFramework.LogError("001 " + "TestID_" + c_TEST_ID, errorDesc); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("002 " + "TestID_" + c_TEST_ID, "Unexpected exception: " + e + "\n value is " + value); TestLibrary.TestFramework.LogInformation(e.StackTrace); retVal = false; } return retVal; }
public Button(Texture2D texture, Vector2 position, string text, SpriteFont font, Game1 game) : base(position) { base.Text = text; this.texture = texture; this.Font = font; bounds = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height); switch (Text) { case "Create": change = MenuState.Create; break; case "Join": change = MenuState.Join; break; case "Exit to menu": case "Back": change = MenuState.Menu; break; default: change = null; break; } if (Text.Contains("Level")) change = MenuState.Start; WireUpEvents(game); }
public bool PosTest2() { bool retVal = true; const string c_TEST_DESC = "PosTest2: Verify the Nullable object's HasValue is false"; const string c_TEST_ID = "P002"; int? nullObj = new Nullable<int>(); TestLibrary.TestFramework.BeginScenario(c_TEST_DESC); try { if (nullObj.HasValue) { string errorDesc = "value is not false as expected: Actual(true)"; TestLibrary.TestFramework.LogError("003 " + "TestID_" + c_TEST_ID, errorDesc); retVal = false; } } catch (Exception e) { TestLibrary.TestFramework.LogError("004 " + "TestID_" + c_TEST_ID, "Unexpected exception: " + e ); TestLibrary.TestFramework.LogInformation(e.StackTrace); retVal = false; } return retVal; }
public int AddNew(Guid PageGuid, string MetaKeywords, string MetaDesc, string Title, string ContentHtml, string TemplatePath, string ReleasePath, int Hits, Nullable<DateTime> DateCreated) { DbCommand command = DbProviderHelper.CreateCommand("INSERTPage",CommandType.StoredProcedure); command.Parameters.Add(DbProviderHelper.CreateParameter("@PageGuid",DbType.Guid,PageGuid)); if (MetaKeywords!=null) command.Parameters.Add(DbProviderHelper.CreateParameter("@MetaKeywords",DbType.String,MetaKeywords)); else command.Parameters.Add(DbProviderHelper.CreateParameter("@MetaKeywords",DbType.String,DBNull.Value)); if (MetaDesc!=null) command.Parameters.Add(DbProviderHelper.CreateParameter("@MetaDesc",DbType.String,MetaDesc)); else command.Parameters.Add(DbProviderHelper.CreateParameter("@MetaDesc",DbType.String,DBNull.Value)); command.Parameters.Add(DbProviderHelper.CreateParameter("@Title",DbType.String,Title)); if (ContentHtml!=null) command.Parameters.Add(DbProviderHelper.CreateParameter("@ContentHtml",DbType.String,ContentHtml)); else command.Parameters.Add(DbProviderHelper.CreateParameter("@ContentHtml",DbType.String,DBNull.Value)); command.Parameters.Add(DbProviderHelper.CreateParameter("@TemplatePath",DbType.String,TemplatePath)); command.Parameters.Add(DbProviderHelper.CreateParameter("@ReleasePath",DbType.String,ReleasePath)); command.Parameters.Add(DbProviderHelper.CreateParameter("@Hits",DbType.Int32,Hits)); if (DateCreated.HasValue) command.Parameters.Add(DbProviderHelper.CreateParameter("@DateCreated",DbType.DateTime,DateCreated)); else command.Parameters.Add(DbProviderHelper.CreateParameter("@DateCreated",DbType.DateTime,DBNull.Value)); return Convert.ToInt32(DbProviderHelper.ExecuteScalar(command)); }
private void SetDateTime() { if (string.IsNullOrEmpty(this.m_MergedDateString) == false) { DateTime dateIn; bool parseResult = DateTime.TryParse(this.m_MergedDateString.ToString(), out dateIn); if (parseResult == true) { if (this.m_MergedDateString.Length >= 8 && this.m_MergedDateString.Length <= 10) { this.m_Date = DateTime.Parse(dateIn.ToString("MM/dd/yyyy")); this.m_Time = null; } else if (this.m_MergedDateString.Length >= 14 && this.m_MergedDateString.Length <= 16) { this.m_Date = DateTime.Parse(dateIn.ToString("MM/dd/yyyy")); this.m_Time = DateTime.Parse(dateIn.ToString("MM/dd/yyyy HH:mm")); } } else { this.m_HasError = true; } } else { this.m_Date = null; this.m_Time = null; } }
public int CrearSolicitud(string p_solicitante, TravelnookGenNHibernate.Enumerated.Travelnook.EstadoSolicitudEnum p_estado, Nullable<DateTime> p_fecha, string p_solicitado) { SolicitudEN solicitudEN = null; int oid; //Initialized SolicitudEN solicitudEN = new SolicitudEN (); if (p_solicitante != null) { // El argumento p_solicitante -> Property solicitante es oid = false // Lista de oids id solicitudEN.Solicitante = new TravelnookGenNHibernate.EN.Travelnook.UsuarioEN (); solicitudEN.Solicitante.NomUsu = p_solicitante; } solicitudEN.Estado = p_estado; solicitudEN.Fecha = p_fecha; if (p_solicitado != null) { // El argumento p_solicitado -> Property solicitado es oid = false // Lista de oids id solicitudEN.Solicitado = new TravelnookGenNHibernate.EN.Travelnook.UsuarioEN (); solicitudEN.Solicitado.NomUsu = p_solicitado; } //Call to SolicitudCAD oid = _ISolicitudCAD.CrearSolicitud (solicitudEN); return oid; }
public virtual int InsertCourse(Nullable<int> authorID, string title, string description, Nullable<short> price, string levelString, Nullable<byte> level) { var authorIDParameter = authorID.HasValue ? new ObjectParameter("AuthorID", authorID) : new ObjectParameter("AuthorID", typeof(int)); var titleParameter = title != null ? new ObjectParameter("Title", title) : new ObjectParameter("Title", typeof(string)); var descriptionParameter = description != null ? new ObjectParameter("Description", description) : new ObjectParameter("Description", typeof(string)); var priceParameter = price.HasValue ? new ObjectParameter("Price", price) : new ObjectParameter("Price", typeof(short)); var levelStringParameter = levelString != null ? new ObjectParameter("LevelString", levelString) : new ObjectParameter("LevelString", typeof(string)); var levelParameter = level.HasValue ? new ObjectParameter("Level", level) : new ObjectParameter("Level", typeof(byte)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("InsertCourse", authorIDParameter, titleParameter, descriptionParameter, priceParameter, levelStringParameter, levelParameter); }
public SelectGimnasticarUcesnikForm(int takmicenjeId, Nullable<Pol> pol, TakmicarskaKategorija kategorija) { InitializeComponent(); Text = "Izaberi gimnasticara"; this.takmicenjeId = takmicenjeId; this.gimnastika = null; if (pol != null) { if (pol == Pol.Muski) gimnastika = Gimnastika.MSG; else if (pol == Pol.Zenski) gimnastika = Gimnastika.ZSG; } this.kategorija = kategorija; initializeGridColumns(); DataGridViewUserControl.GridColumnHeaderMouseClick += new EventHandler<GridColumnHeaderMouseClickEventArgs>(DataGridViewUserControl_GridColumnHeaderMouseClick); FetchModes.Add(new AssociationFetch( "Takmicenje", AssociationFetchMode.Eager)); FetchModes.Add(new AssociationFetch( "TakmicarskaKategorija", AssociationFetchMode.Eager)); FetchModes.Add(new AssociationFetch( "KlubUcesnik", AssociationFetchMode.Eager)); FetchModes.Add(new AssociationFetch( "DrzavaUcesnik", AssociationFetchMode.Eager)); this.ClientSize = new Size(800, 450); showAll(); }
//Initialize public void Initialize(Texture2D texture, Vector2 position) { //Initialize PlayerTexture = texture; Position = position; Heading = 0.0f; //Sensor Data enemyData = new List<EnemyData>(); walls = new List<BoundingBox>(); //Number of Rays to be cast rayCount = 5; rayDist = new Nullable<float>[rayCount]; rayList = new Vector2[rayCount]; //Number of Quadrants quadrants = new int[4]; //Max Values FirstRay = new Vector2(0, -1); //FirstRay.Normalize(); rayMax = 250; agentMax = 500; pieMax = 150; //ACTIVATE Active = true; }
/// <summary> /// Constructor. /// </summary> /// <param name="row">Row index</param> /// <param name="col">Column index</param> public Index(int row, int col) { this.row = row; this.col = col; this.dem = null; this.alt = null; }
public void Update() { this.UserActionID = UserAction.user_action_id; this.UserID = UserAction.user_id; this.ActionID = UserAction.action_id; this.HasRight = UserAction.hasRight; }
private static void AdjustResultForIntersectionWithSide( ref Nullable<Point> result, ref double distance, Segment intersection, Point point ) { if( !intersection.IsEmpty ) { if( intersection.Contains( point ) ) { distance = 0; result = point; return; } double p1Distance = PointHelper.DistanceBetween( point, intersection.P1 ); double p2Distance = double.PositiveInfinity; if( !intersection.IsPoint ) { p2Distance = PointHelper.DistanceBetween( point, intersection.P2 ); } if( Math.Min( p1Distance, p2Distance ) < distance ) { if( p1Distance < p2Distance ) { distance = p1Distance; result = intersection.P1; } else { distance = p2Distance; result = intersection.P2; } } } }
static void Main(string[] args) { int i = 3; long l = i; i = (int)l; //string s = "manuel"; //i = (int)(object)s; int? n = null; if (n == null) { Console.WriteLine("n is een value type, maar wel degelijk null!?!?!?!"); } Nullable<int> n2 = new Nullable<int>(); if (!n2.HasValue) { Console.WriteLine("Oh, zo werkt dat dus!"); } else { Console.WriteLine(n2.Value); } }
public CDPShape(Nullable<Color> penColor, Nullable<Color> fillColor, double penWidth, Point referencePoint) { this.penColor = penColor; this.fillColor = fillColor; this.penWidth = penWidth; this.referencePoint = referencePoint; }
/// <summary> /// Constructeur /// </summary> /// <param name="InName">Nom de l'appender</param> /// <param name="InLogFile"> Nom du fichier de log (avec chemin)</param> public TextFileAppender(string InName, string InLogFile = "", Nullable<LogLevel> SpecifiLogLevel = null) : base(InName,SpecifiLogLevel) { LogFile = InLogFile; }// end constructeur