本文整理汇总了C#中Province类的典型用法代码示例。如果您正苦于以下问题:C# Province类的具体用法?C# Province怎么用?C# Province使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Province类属于命名空间,在下文中一共展示了Province类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ApplyHistory
private void ApplyHistory( Province prov )
{
prov.History.Sort( m_dateComparer );
foreach( EventOption ev in prov.History )
{
if ( ev.Date.Year > m_options.StartDate )
break;
foreach( Option op in ev.SubOptions )
{
if( op.GetIDString == "culture" )
{
if ( !prov.CustomFlags.ContainsKey( "old_cul" ) )
prov.CustomFlags["old_cul"] = prov.Culture;
prov.Culture = ( (StringOption)op ).GetValue;
} else if( op.GetIDString == "religion" )
{
if( !prov.CustomFlags.ContainsKey( "old_rel" ) )
prov.CustomFlags["old_rel"] = prov.Religion;
prov.Religion = ( (StringOption)op ).GetValue;
}
}
}
}
开发者ID:Measter,项目名称:TitleGenerator,代码行数:26,代码来源:ApplyProvinceHistory.cs
示例2: addProvince
public static bool addProvince(Province province, string connString)
{
#region code
bool rs = false;
using (SqlConnection conn = new SqlConnection(connString))
{
try
{
conn.Open();
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sony_sp_add_province";
cmd.Parameters.AddWithValue("@province", province.SProvince);
cmd.Parameters.AddWithValue("@provinceOrder", province.ProvinceOrder);
SqlParameter returnVal = new SqlParameter("@returnVal", SqlDbType.Int);
returnVal.Direction = ParameterDirection.Output;
cmd.Parameters.Add(returnVal);
cmd.ExecuteNonQuery();
rs = ((int)cmd.Parameters["@returnVal"].Value != 0);
}
}
catch (Exception ex)
{
WriteLog("", "Add Province Error: " + ex.Message, connString);
return false;
}
}
return rs;
#endregion
}
开发者ID:ndl0986,项目名称:rebuild-site,代码行数:32,代码来源:ProvinceServices.cs
示例3: InitDataBase
public void InitDataBase(string connectionString)
{
using (var ctx = new Context(connectionString))
{
if (ctx.Database.Exists())
ctx.Database.Delete();
ctx.Database.Initialize(true);
List<Province> entityProwinces = new List<Province>();
foreach (var province in ProvinceData.GetProvinces())
{
var prow = new Province { Code = province.Code, Name = province.Name };
ctx.Provinces.Add(prow);
ctx.SaveChanges();
entityProwinces.Add(prow);
}
BulkUploadToSql bulk =
BulkUploadToSql.Load(
HomeData.GetHomes()
.Select(
i =>
new Bulk.Home
{
AddTime = DateTime.Now,
BuildYear = i.BuildYear,
City = i.City,
Description = i.Description,
Price = i.Price,
Surface = i.Surface,
ProvinceId = entityProwinces.Single(j => j.Code == i.HomeProvince.Code).Id
}), "Home", 10000, connectionString);
bulk.Flush();
}
}
开发者ID:refrom,项目名称:ORMPerformanceTest,代码行数:35,代码来源:TestEF.cs
示例4: GetProvinces
public static List<Province> GetProvinces()
{
List<Province> provinces = new List<Province>();
SqlConnection connection = TravelExpertsDB.GetConnection();
string query = "SELECT ProvId, ProvName, ProvCode " +
" FROM Provinces";
SqlCommand command = new SqlCommand( query, connection);
try
{
connection.Open();
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
Province province = new Province();
province.ProvId = Convert.ToInt32(reader["ProvId"]);
province.ProvName = reader["ProvName"].ToString();
province.ProvCode = reader["ProvCode"].ToString();
provinces.Add(province);
}
}
catch (SqlException ex)
{
throw ex;
}
finally
{
connection.Close();
}
return provinces;
}
开发者ID:marpoff,项目名称:TravelExpertsASPWebForms,代码行数:33,代码来源:ProvinceDB.cs
示例5: GetUrlCategorie
/// <summary>
/// Restituisce l'url della categoria
/// </summary>
public static string GetUrlCategorie(Categorie categorie, Regioni regioni = null, Province province = null)
{
string link = string.Empty;
while (categorie != null)
{
link = categorie.Url + "/" + link;
categorie = categorie.Prec;
}
if (province != null)
{
//Se finisce con lo slash /
if (link.EndsWith("/")) link = link.Remove(link.Length - 1);
if (!string.IsNullOrEmpty(link)) link += ".";
return "/annunci/" + link.ToLower() + province.Regioni.Url.ToLower() + "." + province.Url.ToLower();
}
if (regioni != null)
{
//Se finisce con lo slash /
if (link.EndsWith("/")) link = link.Remove(link.Length - 1);
if (!string.IsNullOrEmpty(link)) link += ".";
return "/annunci/" + link.ToLower() + regioni.Url.ToLower();
}
return "/annunci/" + link.ToLower();
}
开发者ID:bertasoft,项目名称:Network-Annunci,代码行数:30,代码来源:LinkGenerator.cs
示例6: ButtonSalvaClick
protected void ButtonSalvaClick(object sender, EventArgs e)
{
if (__ListBox_Regioni.SelectedIndex != -1)
{
if (!string.IsNullOrEmpty(__ListBox_Regioni.SelectedValue) && !string.IsNullOrEmpty(__TextBox_Provincia.Text))
{
var regione = Regioni.GetItem(Regioni.KeyColumnsEnum.Id, int.Parse(__ListBox_Regioni.SelectedValue));
if (regione == null)
{
MessageBox("Selezionare una regione");
return;
}
var provincia = Province.GetItem(Province.KeyColumnsEnum.Id, __ListBox_Province.SelectedValue);
if (provincia == null) provincia = new Province();
provincia.Provincia = __TextBox_Provincia.Text;
provincia.Url = __TextBox_Url.Text;
provincia.Regioni = regione;
if (!Province.Save(out Avviso, ref provincia))
{
MessageBox(Avviso);
return;
}
__TextBox_Provincia.Text = string.Empty;
__TextBox_Url.Text = string.Empty;
CaricaProvince();
}
}
else MessageBox("Seleziona una voce dall'elenco di sinistra");
}
开发者ID:bertasoft,项目名称:Network-Annunci,代码行数:34,代码来源:Province.aspx.cs
示例7: StartScout
//public Noble(Color nC, string n) : this(nC, n, 4, 3, 0, 10, 10, 10, 10) { }
public IEnumerator StartScout(Province p, int aP, int mP, int pP)
{
int adminPointsUsed = aP, militaryPointsUsed = mP, politicalPointsUsed = pP;
if (adminPointsUsed > administrativePointsLeft) adminPointsUsed = administrativePointsLeft;
else if (adminPointsUsed < 0) adminPointsUsed = 0;
if (militaryPointsUsed > militaryPointsLeft) militaryPointsUsed = militaryPointsLeft;
else if (militaryPointsUsed < 0) militaryPointsUsed = 0;
if (politicalPointsUsed > politicalPointsLeft) politicalPointsUsed = politicalPointsLeft;
else if (politicalPointsUsed < 0) politicalPointsUsed = 0;
if (scouting.IndexOf(p.provinceName) < 0 && politicalPointsUsed >= 1)
{
administrativePointsLeft -= adminPointsUsed;
militaryPointsLeft -= militaryPointsUsed;
politicalPointsLeft -= politicalPointsUsed;
scouting.Add(p.provinceName);
yield return new WaitForSeconds(scoutTime / (adminPointsUsed + militaryPointsUsed + politicalPointsUsed));
ScoutLand(p);
scouting.Remove(p.provinceName);
administrativePointsLeft += adminPointsUsed;
militaryPointsLeft += militaryPointsUsed;
politicalPointsLeft += politicalPointsUsed;
}
}
开发者ID:oxters168,项目名称:ProjectCastles,代码行数:28,代码来源:Noble.cs
示例8: alignAgentsIntoRows
/// <summary>
/// Agent is parented to agents aka. the province he is in.
/// His position is at province pivot.
/// We adjust his local coordinate, because we take into account he is in Britain.
/// No sense to adjust his world space coord.
/// </summary>
private void alignAgentsIntoRows(int agentCount, Agent agent, Province province)
{
//TODO test purpose
agent.transform.localPosition = Vector3.zero;
Vector3 positionRelativeToBritainProvincePivot = new Vector3(2f, 1f, 0f);//for Britain only
agent.transform.localPosition = agent.transform.localPosition + positionRelativeToBritainProvincePivot + (0.4f) * (agentCount % 4) * Vector3.right + (0.4f) * (agentCount / 4) * Vector3.down;
}
开发者ID:kunalegendo,项目名称:game,代码行数:13,代码来源:SpySchoolHudLogic.cs
示例9: DeleteProvince
public void DeleteProvince(Province province)
{
if (province == null)
throw new ArgumentNullException("province");
using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings[this.ConnectionStringName].ConnectionString))
{
connection.Open();
var command = new SqlCommand("usp_DeleteProvince", connection)
{
CommandType = System.Data.CommandType.StoredProcedure
};
command.Parameters.Add(new SqlParameter
{
Direction = ParameterDirection.Input,
IsNullable = true,
ParameterName = "@ID",
SqlDbType = SqlDbType.UniqueIdentifier,
SqlValue = province.ID
});
command.ExecuteNonQuery();
}
}
开发者ID:kohku,项目名称:Bebeclick,代码行数:26,代码来源:SqlPortalRepository.cs
示例10: District
public District(decimal latitude, decimal longitude)
{
Latitude = latitude;
Longitude = longitude;
Id = string.Empty;
DistrictName = string.Empty;
Province = new Province();
}
开发者ID:portgas-d-ace,项目名称:Recruitment-website,代码行数:8,代码来源:District.cs
示例11: isLocationInProvince
public bool isLocationInProvince(Province province)
{
if(province == null) {
return false;
}
return this.province.descriptor.provinceName.Equals(province.descriptor.provinceName);
}
开发者ID:kunalegendo,项目名称:game,代码行数:8,代码来源:LocationDescriptor.cs
示例12: CreateProvince
public Province CreateProvince(ProvinceInitData initData)
{
var province = new Province();
province.DisplayName = initData.DisplayName;
Provinces.Add(province);
province.Init(this);
return province;
}
开发者ID:alyph,项目名称:Noesis,代码行数:8,代码来源:World.cs
示例13: GetAccounts
public static List<Account> GetAccounts(
string name,
int gender,
string bloodType,
int birthYear,
int birthMonth,
int birthDate,
City hometownCity,
Province homwtownProvince,
City resideCity,
Province resideProvince,
ClassInfo classInfo,
Grade grade,
Major major,
College college,
University university,
string code,
bool? hasAvatar,
string nickName,
bool? isProtected,
int minViewCount,
int maxViewCount,
bool? isPublic,
int minYear,
int maxYear,
string interest,
PagingInfo pagingInfo)
{
return provider.GetAccounts(
name,
gender,
bloodType,
birthYear,
birthMonth,
birthDate,
hometownCity,
homwtownProvince,
resideCity,
resideProvince,
classInfo,
grade,
major,
college,
university,
code,
hasAvatar,
nickName,
isProtected,
minViewCount,
maxViewCount,
isPublic,
minYear,
maxYear,
interest,
pagingInfo);
}
开发者ID:dalinhuang,项目名称:ume-v3,代码行数:56,代码来源:AccountService.cs
示例14: SupportMoveOrder
/// <summary>Creates a new <see cref="SupportMoveOrder"/> instance.
/// </summary>
/// <param name="unit">The <see cref="Unit"/> that this order concerns.</param>
/// <param name="supportedUnit">Supported <see cref="Unit"/>.</param>
/// <param name="targetProvince">Target <see cref="Province"/>.</param>
public SupportMoveOrder(Unit unit, Unit supportedUnit, Province targetProvince)
: base(OrderType.SupportMove, unit)
{
if( supportedUnit == null )
{
throw new ArgumentNullException("supportedUnit");
}
this.supportedUnit = supportedUnit;
this.targetProvince = targetProvince;
}
开发者ID:evandrix,项目名称:DAIDE10,代码行数:15,代码来源:SupportMoveOrder.cs
示例15: createAgent
private Agent createAgent(Province province)
{
Mover agentMover = GetMover();
Agent createdAgent = AgentFactory.Instance.Build(StringGenerator.getRandomName(), StringGenerator.getRandomSurname(), StringGenerator.getRandomPortraitName());
agentMover.AddAgentToProvince(createdAgent, province);
Notifier.Instance.notify(EventFactory.Build("Agent created", createdAgent.descriptor.name.ToUpper()));
return createdAgent;
}
开发者ID:kunalegendo,项目名称:game,代码行数:10,代码来源:SpySchoolHudLogic.cs
示例16: Start
//public bool commodityKnown { get; private set; }
// Use this for initialization
void Start ()
{
province = new Province(gameObject.name.Replace("_", " "), this);
//RandomizeCommodity();
Camera.main.GetComponent<Game>().provinces.Add(province.provinceName, province);
material = new Material(Shader.Find("Legacy Shaders/Diffuse"));
RandomizeColor();
GetComponent<Renderer>().material = material;
}
开发者ID:oxters168,项目名称:ProjectCastles,代码行数:14,代码来源:ProvinceScript.cs
示例17: ProvinceModel
public ProvinceModel(Province Province)
{
this.ProvinceCode = Province.ProvinceCode;
this.ProvinceName = Province.ProvinceName;
this.Description = Province.Description;
this.RegionCode = Province.RegionCode;
this.ProvinceListCode = Province.ProvinceListCode;
this.Districts = Province.Districts;
this.Region = Province.Region;
this.DMDiemIns = Province.DMDiemIns;
}
开发者ID:123445666,项目名称:PHNC,代码行数:11,代码来源:ProvinceModel.cs
示例18: TaxOfficeInfo
/// <summary>
/// Initialisiert eine neue Instanz der <see cref="TaxOfficeInfo" /> Klasse.
/// </summary>
/// <param name="bufaNr">Die BUFA-Nummer (Bundesfinanzamt-Nummer)</param>
/// <param name="name">Name des Finanzamtes</param>
/// <param name="supportsLsta">Dürfen Lohnsteuer-Anmeldungen hierher versandt werden?</param>
/// <param name="province">Zu welchem Bundesland gehört das Finanzamt?</param>
/// <param name="isTest">Ist das FA ein Test-Finanzamt?</param>
/// <param name="validSince">Gültig seit?</param>
/// <param name="validUntil">Gültig bis?</param>
/// <param name="redirectTo">Neue FA-Nummer</param>
public TaxOfficeInfo(int bufaNr, [NotNull] string name, bool supportsLsta, Province province, bool isTest = false, DateTime? validSince = null, DateTime? validUntil = null, IReadOnlyList<int> redirectTo = null)
{
BufaNr = bufaNr;
Name = name.Trim();
SupportsElsterAnmeldung = supportsLsta;
Province = province;
IsTest = isTest;
ValidSince = validSince;
ValidUntil = validUntil;
RedirectTo = redirectTo;
}
开发者ID:dataline-gmbh,项目名称:Elster,代码行数:22,代码来源:TaxOfficeInfo.cs
示例19: btnSearchPhanPhoi_Click
protected void btnSearchPhanPhoi_Click(object sender, EventArgs e)
{
if (dropListThanhPho.SelectedValue != null && dropListQuan.SelectedValue != null)
{
var oProvince = new Province();
var oDistrict = new District();
var dv = oProvince.ProvinceSelectOne(dropListThanhPho.SelectedValue).DefaultView;
var dv2 = oDistrict.DistrictSelectOne(dropListQuan.SelectedValue).DefaultView;
Response.Redirect(progressTitle(dv2[0]["DistrictName"].ToString()) + "-pvi-" + dv[0]["ProvinceID"] + "-dsi-" + dv2[0]["DistrictID"] + ".aspx");
}
}
开发者ID:hungtien408,项目名称:web-bezut,代码行数:12,代码来源:site-phanphoi.master.cs
示例20: SelectProv
private void SelectProv(object sender, EventArgs e)
{
var prov = _provInfoControl.SelectedInfo.Province;
var myProv = _rManager.ActingProv;
// 自分との同盟は行わない || 延長できるのは6ターン未満
if (prov == myProv || _rManager.League[prov.No, myProv.No] >= 6)
return;
this.SelectedProvince = prov;
this.DialogResult = DialogResult.OK;
this.Close();
}
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:12,代码来源:LeagueWindow.cs
注:本文中的Province类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论