CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: afsharm
C#
//without using Object Initializer Syntax
 
                    letter = new Letter();
                    letter.Date = DateTime.Now.Date;
                    letter.RegisterDate = DateTime.Now.Date;
                    letter.LetterType = LetterType.Outgoing;
 
                    letter.LetterInformation = new LetterInformation();
                    letter.LetterInformation.RuntimeState = common.RuntimeState.Added;
                    letter.LetterInformation.Letter = letter;
by afsharm   January 19, 2010 @ 4:17am
295 Views
1 comments
 
C#
public List<PersonInOrganization> ExtractInvalidEmails()
{
  EntityCollection<PersonInOrganization> list =  GetAllItems();
 
  //my first LINQ use!
  var invalids = from l in list where !string.IsNullOrEmpty(l.Email) && !IsValidEmail(l.Email) select l;
 
  return invalids.ToList<PersonInOrganization>();
}
by afsharm   January 12, 2010 @ 12:01am
306 Views
1 comments
 
C#
<system.web>
  <pages>
    <controls>
      <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
      <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>
  </pages>
</system.web>
by afsharm   December 24, 2009 @ 5:00am
388 Views
no comments
 
C#
string res = string.Empty;
 
try
{
    IQuery query = session.CreateQuery("select ao.CostCenterAccount from " +
                                       "AssetObservation as ao where ao.Asset.ID=:KEY " +
                                       "and ao.Date<:DATETIME order by Date asc");
    query.SetInt64("KEY", asset.Id);
    query.SetDateTime("DATETIME", dateTime);
by afsharm   November 01, 2009 @ 2:24am
627 Views
1 comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    public class T3
    {
        public delegate void del1();
by afsharm   September 30, 2009 @ 3:36am
269 Views
no comments
 
C#
--خط زیر را اول تعریف متود مورد نظر قرار دهید
--با تشکر از مسعود
[PrincipalPermission(SecurityAction.Demand, Role = "SomeRole")]
by afsharm   September 22, 2009 @ 8:20am
318 Views
no comments
 
function ltr_override(e)
{
//‫از این تابع در onkeypress هر textBox که استفاده شود باعث می‌شود که 
//کاراکترهای تایپ شده توسط کاربر به طور مطلق از چپ به راست نمایش داده
//شود. حتی اگر کاربر یک متن فارسی را وارد کند. کاربرد فعلی این تابع
//در شماره نامه است که همیشه از چپ به راست خوانده می‌شود
 
//‫دقت شود که رشته تولید شده توسط این تابع پر از کاراکتر یونیکد 0x202d است و 
//قبل از ذخیره در بانک اطلاعاتی یا انجام هر پردازش دیگری باید از رشته مورد نظر پاک شود
by afsharm   September 10, 2009 @ 3:07am
246 Views
no comments
 
C#
System.Threading.Thread.CurrentThread.CurrentCulture = new FarsiLibrary.Utils.PersianCultureInfo();
System.Threading.Thread.CurrentThread.CurrentUICulture = new FarsiLibrary.Utils.PersianCultureInfo();
fXDatePicker1.FlowDirection = FlowDirection.RightToLeft;
 
by afsharm   August 25, 2009 @ 6:16am
575 Views
1 comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate