本文整理汇总了C#中Repository.GetMunicipality方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.GetMunicipality方法的具体用法?C# Repository.GetMunicipality怎么用?C# Repository.GetMunicipality使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository.GetMunicipality方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsBlockedAsync
public static async Task<bool> IsBlockedAsync(this form f)
{
using (var repo = new Repository())
{
var formIsBlocked = false;
switch ((FormType) f.form_type_id)
{
case FormType.Edu:
case FormType.OtherEdu:
{
var edu = await repo.GetEdu(Authentication.Credentials.EduId);
var form = await repo.GetForm(f.form_id);
if (await form.TimeRemainingAsync() == TimeSpan.Zero)
{
formIsBlocked = form.blocked_edus.Contains(edu);
}
break;
}
case FormType.Municipality:
case FormType.OtherMunicipality:
{
var munit = await repo.GetMunicipality(Authentication.Credentials.MunitId);
var form = await repo.GetForm(f.form_id);
if (await form.TimeRemainingAsync() == TimeSpan.Zero)
{
formIsBlocked = form.blocked_municipalities.Contains(munit);
}
break;
}
}
return formIsBlocked;
}
}
示例2: InitializeMunicipality
async private Task InitializeMunicipality(Repository repo, form summaryForm, int year)
{
var munit = await repo.GetMunicipality(Authentication.Credentials.MunitId);
_formula = await repo.GetFormulasBySummaryForm(summaryForm.form_id);
this.IsAvailable = (_formula != null);
if (this.IsAvailable)
{
_municipality = munit;
_summaryForm = summaryForm;
_regularForm = _formula.regular_form;
_year = year;
var eduList = await repo.GetEdus(munit.municipality_id);
var eduHasFormIdList = (await repo.GetEdusHaveFormData(_regularForm.form_id, _year))
.Select(t => t.edu_id);
foreach (var edu in eduList)
{
var hasForm = eduHasFormIdList.Contains(edu.edu_id);
edu.SetAttachedProperty("bHasForm", hasForm);
}
this.eduBindingSource.DataSource = eduList;
}
}
示例3: windowsUIViewMain_QueryControl
//.........这里部分代码省略.........
var repo = new Repository();
var fd = await repo.GetRegionFormDataById(dataId.Value);
var sheetControl = new XtraSpreadsheet(windowsUIViewMain, repo)
{
FormDataSource = await repo.GetRegionForms(),
FormData = fd,
FormStatus = (Status)fd.status,
Source = XtraSpreadsheet.FormSource.File,
Mode = XtraSpreadsheet.ControlMode.Edit,
ActiveForm = fd.form
};
sheetControl.LoadDocument();
e.Control = sheetControl;
}
else
{
e.Control = new Control();
}
break;
}
case "ArchiveFormData4":
case "FormData4": //допформа
case "ArchiveFormData3":
case "FormData3": //форма муниципалитета
{
var dataId = TagHelper.GetFormDataId(e.Document.Tag.ToString());
if (dataId.HasValue)
{
var repo = new Repository();
var fd = await repo.GetMunitFormDataById(dataId.Value);
var sheetControl = new XtraSpreadsheet(windowsUIViewMain, repo)
{
FormDataSource = await repo.GetMunicipalityForms(),
FormData = fd,
FormStatus = (Status)fd.status,
Source = XtraSpreadsheet.FormSource.File,
Mode = await fd.form.IsBlockedAsync() ? XtraSpreadsheet.ControlMode.Disabled : XtraSpreadsheet.ControlMode.Edit,
ActiveForm = fd.form
};
sheetControl.LoadDocument();
e.Control = sheetControl;
}
else
{
e.Control = new Control();
}
break;
}
case "ArchiveFormData1":
case "ArchiveFormData2":
case "FormData2": //допформа
case "FormData1": //форма организации
{
var dataId = TagHelper.GetFormDataId(e.Document.Tag.ToString());
if (dataId.HasValue)
{
var repo = new Repository();
var fd = await repo.GetEduFormDataById(dataId.Value);
var sheetControl = new XtraSpreadsheet(windowsUIViewMain, repo)
{
FormData = fd,
FormStatus = (Status)fd.status,
Source = XtraSpreadsheet.FormSource.File,
Mode = await fd.form.IsBlockedAsync() ? XtraSpreadsheet.ControlMode.Disabled : XtraSpreadsheet.ControlMode.Edit
示例4: TriggerControlsWithPrivilegies
private async void TriggerControlsWithPrivilegies(Credentials user)
{
using (var repo = new Repository())
{
tilePassport.Tag = user.IsEdu ? user.EduId : (user.IsMunicipality ? user.MunitId : 0);
var syncCtx = SynchronizationContext.Current;
var view = windowsUIViewMain;
if (user.IsRegion || user.IsMinistry)
{
tileForms.Click += (sender, args) =>
Actions.LoadMunicipalityLayerAction.Invoke(sender, args, view, false, FormType.Edu, syncCtx);
tileArchiveForms.Click += (sender, args) =>
Actions.LoadMunicipalityLayerAction.Invoke(sender, args, view, true, FormType.Edu, syncCtx);
tileAdditionalForms.Click += (sender, args) =>
Actions.LoadMunicipalityLayerAction.Invoke(sender, args, view, false, FormType.OtherEdu, syncCtx);
tileArchiveAdditionalForms.Click += (sender, args) =>
Actions.LoadMunicipalityLayerAction.Invoke(sender, args, view, true, FormType.OtherEdu, syncCtx);
tileMunicipalityForms.Click += (sender, args) =>
Actions.LoadMunicipalityMunicipalityLayerAction.Invoke(sender, args, view, false, FormType.Municipality, syncCtx);
tileMunicipalityArchiveForms.Click += (sender, args) =>
Actions.LoadMunicipalityMunicipalityLayerAction.Invoke(sender, args, view, true, FormType.Municipality, syncCtx);
tileMunicipalityAdditionalForms.Click += (sender, args) =>
Actions.LoadMunicipalityMunicipalityLayerAction.Invoke(sender, args, view, false, FormType.OtherMunicipality, syncCtx);
tileMunicipalityArchiveAdditionalForms.Click += (sender, args) =>
Actions.LoadMunicipalityMunicipalityLayerAction.Invoke(sender, args, view, true, FormType.OtherMunicipality, syncCtx);
var regionAction = Actions.LoadRegionsLayerAction;
if (user.IsRegion)
{
regionAction = Actions.LoadRegionFormsLayerAction;
}
tileRegionForms.Click += (sender, args) =>
regionAction.Invoke(sender, args, view, false, FormType.Region, syncCtx);
tileRegionAdditionalForms.Click += (sender, args) =>
regionAction.Invoke(sender, args, view, false, FormType.OtherRegion, syncCtx);
tileRegionArchiveForms.Click += (sender, args) =>
regionAction.Invoke(sender, args, view, true, FormType.Region, syncCtx);
tileRegionArchiveAdditionalForms.Click += (sender, args) =>
regionAction.Invoke(sender, args, view, true, FormType.OtherRegion, syncCtx);
}
else if (user.IsMunicipality)
{
var munit = await repo.GetMunicipality(user.MunitId);
tileMunicipalityForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit);
tileMunicipalityForms.Click +=
(sender, args) =>
Actions.LoadMunicipalityFormsLayerAction.Invoke(sender, args, view, false,
FormType.Municipality, syncCtx);
tileMunicipalityArchiveForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit, "archive");
tileMunicipalityArchiveForms.Click +=
(sender, args) =>
Actions.LoadMunicipalityFormsLayerAction.Invoke(sender, args, view, true,
FormType.Municipality, syncCtx);
tileMunicipalityAdditionalForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit);
tileMunicipalityAdditionalForms.Click +=
(sender, args) =>
Actions.LoadMunicipalityFormsLayerAction.Invoke(sender, args, view, false,
FormType.OtherMunicipality, syncCtx);
tileMunicipalityArchiveAdditionalForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit, "archive");
tileMunicipalityArchiveAdditionalForms.Click +=
(sender, args) =>
Actions.LoadMunicipalityFormsLayerAction.Invoke(sender, args, view, true,
FormType.OtherMunicipality, syncCtx);
tileForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit);
tileForms.Click +=
(sender, args) =>
Actions.LoadEduKindLayerAction.Invoke(sender, args, view, false, FormType.Edu,
syncCtx);
tileArchiveForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit, "archive");
tileArchiveForms.Click +=
(sender, args) =>
Actions.LoadEduKindLayerAction.Invoke(sender, args, view, true, FormType.Edu,
syncCtx);
tileAdditionalForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit);
tileAdditionalForms.Click +=
(sender, args) =>
Actions.LoadEduKindLayerAction.Invoke(sender, args, view, false, FormType.OtherEdu,
syncCtx);
tileArchiveAdditionalForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, munit,
"archive");
tileArchiveAdditionalForms.Click +=
(sender, args) =>
Actions.LoadEduKindLayerAction.Invoke(sender, args, view, true, FormType.OtherEdu,
syncCtx);
pageGroupQueries.Items.Clear();
pageGroupQueries.Items.Add(documentQueriesEdu);
tabbedGroupStatistics.Items.Remove(documentMunicipalityFormStatistics);
tabbedGroupStatistics.Items.Remove(documentMunicipalityFormDetailedStatistics);
}
else if (user.IsEdu)
{
var edu = await repo.GetEdu(user.EduId);
tileForms.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, edu);
tileForms.Click +=
//.........这里部分代码省略.........