本文整理汇总了C#中Artnman.Core.Service.OperationResult类的典型用法代码示例。如果您正苦于以下问题:C# OperationResult类的具体用法?C# OperationResult怎么用?C# OperationResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperationResult类属于Artnman.Core.Service命名空间,在下文中一共展示了OperationResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllOrderByName
public List<object> GetAllOrderByName(string languageId, out OperationResult operationResult)
{
return Common.Instance.SelectList<NewsStatus>
(null, out operationResult)
.OrderBy(obj => obj.Name)
.ToList<object>();
}
示例2: GetAll
public List<object> GetAll(string languageId, out OperationResult operationResult)
{
return Common.Instance.SelectList<RssSource>
(obj => obj.LanguageId == languageId, out operationResult)
.OrderBy(obj => obj.CreateDate)
.ToList<object>();
}
示例3: GetAllOrderByName
public List<object> GetAllOrderByName(string languageId, out OperationResult operationResult)
{
return Common.Instance.SelectList<RssProvider>
(obj => obj.LanguageId == languageId, out operationResult)
.OrderBy(obj => obj.Name)
.ToList<object>();
}
示例4: Delete
public void Delete(Guid id, out OperationResult operationResult)
{
lock (Lock)
{
Common.Instance.Delete<EmailReceiver>
(obj => obj.EmailReceiverId == id, out operationResult);
}
}
示例5: Delete
public void Delete(Guid id, out OperationResult operationResult)
{
lock (Lock)
{
Common.Instance.Delete<Registration>
(obj => obj.RegistrationId == id, out operationResult);
}
}
示例6: Delete
public void Delete(string languageId, Guid id, out OperationResult operationResult)
{
lock (Lock)
{
Common.Instance.Delete<SpecialImageType>
(obj => obj.SpecialImageTypeId == id && obj.LanguageId == languageId, out operationResult);
}
}
示例7: Delete
public void Delete(string languageId, Guid id, out OperationResult operationResult)
{
lock (Lock)
{
Common.Instance.Delete<VideoAlbum>
(obj => obj.VideoAlbumId == id && obj.LanguageId == languageId, out operationResult);
}
}
示例8: Delete
public void Delete(string languageId, Guid id, out OperationResult operationResult)
{
lock (Lock)
{
Common.Instance.Delete<RssProvider>
(obj => obj.RssProviderId == id && obj.LanguageId == languageId, out operationResult);
}
}
示例9: Delete
public void Delete(string languageId, Guid id, out OperationResult operationResult)
{
lock (Lock)
{
Common.Instance.Delete<NewsComment>
(obj => obj.NewsCommentId == id && obj.LanguageId == languageId, out operationResult);
}
}
示例10: GetAll
public List<object> GetAll(out OperationResult operationResult)
{
var list = new List<object>
{
new LanguageEntity {LanguageId = "vi-VN", Name = "Tiếng Việt"},
new LanguageEntity {LanguageId = "en-US", Name = "English"}
};
operationResult = new OperationResult { Type = OperationResult.ResultType.Success };
return list;
}
示例11: GetIntValue
public static int GetIntValue(string key, out OperationResult operationResult)
{
int outValue;
if (!int.TryParse(ConfigurationManager.AppSettings[key], out outValue))
{
operationResult = new OperationResult { Type = OperationResult.ResultType.Failure };
return -1;
}
operationResult = new OperationResult { Type = OperationResult.ResultType.Success };
return outValue;
}
示例12: GetBoolValue
public static bool GetBoolValue(string key, out OperationResult operationResult)
{
bool outValue;
if (!bool.TryParse(ConfigurationManager.AppSettings[key], out outValue))
{
operationResult = new OperationResult { Type = OperationResult.ResultType.Failure };
return false;
}
operationResult = new OperationResult { Type = OperationResult.ResultType.Success };
return outValue;
}
示例13: GetAll
public List<object> GetAll(string languageId, out OperationResult operationResult)
{
try
{
return Common.Instance.SelectList<Support>
(obj => obj.LanguageId == languageId, out operationResult)
.ToList<object>();
}
catch (Exception ex)
{
operationResult = new OperationResult { Type = OperationResult.ResultType.Warning, Message = ex.Message + ex.StackTrace };
return null;
}
}
示例14: ValidateOperation
/// <summary>
/// For the simplicity of the development process, just use a simple function and
/// error display method.
/// Config a special message type for Success case in the Page. (ADD/EDIT/DELETE ...)
/// </summary>
/// <param name="opResult"></param>
/// <returns></returns>
/// TODO: For method with special error return, use the switch case structure instead
public bool ValidateOperation(OperationResult opResult)
{
switch (opResult.Type)
{
case OperationResult.ResultType.Success:
return true;
case OperationResult.ResultType.Failure:
ShowAlert(AlertType.Error, MessageConstant.Error, MessageConstant.InternalError + "<br />" + opResult.Message);
return false;
default:
ShowAlert(AlertType.Error, MessageConstant.Error, MessageConstant.InvalidCredential + "<br />" + opResult.Message);
return false;
}
}
示例15: CountAll
public int CountAll(out OperationResult operationResult)
{
try
{
var entities = DBMapManager.CreateInstance();
operationResult = new OperationResult { Type = OperationResult.ResultType.Success };
return (from obj in entities.Registration
select obj).Count();
}
catch (Exception ex)
{
operationResult = new OperationResult { Type = OperationResult.ResultType.Failure, Message = ex.StackTrace };
return 0;
}
}