Skip to content

Instantly share code, notes, and snippets.

View afsharm's full-sized avatar

Ryan (Afshar) afsharm

  • World
View GitHub Profile
@afsharm
afsharm / gist:0cb6d4d97ca357c02e58
Created January 21, 2015 11:46
TFS 2010 Troubleshooting: Work Item can not be created or updated
TFS 2010 Troubleshooting: Work Item can not be created or updated
[http://www.persiabme.ir/tfs2010troubleshooting.aspx]
[References]
http://stackoverflow.com/questions/3422653/managing-users-in-the-tfs-work-items-assigned-to-field
https://msdn.microsoft.com/en-us/library/ms404871%28v=vs.90%29.aspx
http://geekswithblogs.net/jehan/archive/2010/07/07/importexport-work-item-types-in-tfs-2010.aspx
[Commands]
@afsharm
afsharm / BaseFixture
Created January 28, 2014 14:38
Unit Testing with SQLite in Memory wih NHibernate
using NUnit.Framework;
namespace Paysa
{
public abstract class BaseFixture
{
protected virtual void OnFixtureSetup() { }
protected virtual void OnFixtureTeardown() { }
@afsharm
afsharm / gist:5660844
Last active December 8, 2021 17:22
How to add a simple file upload functionality to CKEditor in ASP.NET MVC. Use CKEditor as CKEDITOR.replace('Description', { filebrowserImageUploadUrl: '/ControllerName/UploadImage' }); It is an updated version of http://arturito.net/2010/11/03/file-and-image-upload-with-asp-net-mvc2-with-ckeditor-wysiwyg-rich-text-editor/ For more information see
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UploadImage(HttpPostedFileBase upload, string CKEditorFuncNum, string CKEditor, string langCode)
{
//http://stackoverflow.com/a/4088194/167670
//http://arturito.net/2010/11/03/file-and-image-upload-with-asp-net-mvc2-with-ckeditor-wysiwyg-rich-text-editor/
//http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
if (upload.ContentLength <= 0)
return null;
@afsharm
afsharm / sand.aspx.cs
Created September 20, 2011 10:11
A sample that show how DataGrid, an ASP.NET control, can do effiecient paging through codebehind (codebehind)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Test.Core;
namespace Test.Web
{
@afsharm
afsharm / sand.aspx
Created September 20, 2011 10:09
A sample that show how DataGrid, an ASP.NET control, can do effiecient paging through codebehind
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sand.aspx.cs" Inherits="Test.Web.sand" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
@afsharm
afsharm / test_git_gist.cs
Created July 3, 2011 09:00
This is my first test sample git gist...
using System.Collections.Generic;
using MyApp.Common;
namespace MyApp.Server.Core
{
public interface IUserRepository : IRepository<User>
{
IList<User> GetAllUsers();
User GetUserByUserName(string userName);
int AddNewUser(string userName, string password, bool isLocked);