本文整理汇总了C#中ProcCore.HandleResult.ResultInfo类的典型用法代码示例。如果您正苦于以下问题:C# ResultInfo类的具体用法?C# ResultInfo怎么用?C# ResultInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResultInfo类属于ProcCore.HandleResult命名空间,在下文中一共展示了ResultInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: aj_MasterUpdate
//[ValidateInput(false)]
public string aj_MasterUpdate(parm md)
{
ResultInfo rAjaxResult = new ResultInfo();
try
{
var open = openLogic();
using (db0 = getDB0())
{
if (System.Globalization.CultureInfo.CurrentCulture.Name == "zh-CN")
{
open.setParmValue(ParmDefine.receiveMails_cn, md.receiveMails);
}
else
{
open.setParmValue(ParmDefine.receiveMails, md.receiveMails);
}
}
rAjaxResult.result = true;
}
catch (Exception ex)
{
rAjaxResult.result = false;
rAjaxResult.message = ex.Message;
}
return defJSON(rAjaxResult);
}
示例2: axFDelete
public string axFDelete(int id, string filekind, string filename)
{
ResultInfo r = new ResultInfo();
DeleteSysFile(id, filekind, filename, ImageFileUpParm.NewsBasicSingle, "News", "News");
r.result = true;
return defJSON(r);
}
示例3: aj_FDelete
public string aj_FDelete(string id, string filekind, string filename)
{
ResultInfo r = new ResultInfo();
DeleteSysFile(id, filekind, filename, ImageFileUpParm.NewsBasicSingle, "Active", "AboutUsData");
r.result = true;
return defJSON(r);
}
示例4: aj_MasterInsert
public async Task<string> aj_MasterInsert(AspNetRoles md)
{
ResultInfo rAjaxResult = new ResultInfo();
try
{
if (!await roleManager.RoleExistsAsync(md.Name))
{
var result = await roleManager.CreateAsync(new IdentityRole(md.Name));
if (result.Succeeded)
{
var item = await roleManager.FindByNameAsync(md.Name);
rAjaxResult.result = true;
rAjaxResult.aspnetid = item.Id;
}
else
{
rAjaxResult.result = false;
rAjaxResult.message = String.Join(":", result.Errors.ToArray());
}
}
else
{
rAjaxResult.result = false;
rAjaxResult.message = "the role " + md.Name + " has exist!";
}
}
catch (Exception ex)
{
rAjaxResult.result = false;
rAjaxResult.message = ex.Message;
}
return defJSON(rAjaxResult);
}
示例5: axFDelete
public string axFDelete(int id, string filekind, string filename)
{
ResultInfo r = new ResultInfo();
DeleteSysFile(id, filekind, filename, ImageFileUpParm.ProductIndex, "NewsData", "Photo");
r.result = true;
return defJSON(r);
}
示例6: Put
public async Task<IHttpActionResult> Put([FromBody]IdentityRole md)
{
ResultInfo r = new ResultInfo();
try
{
//var item = await roleManager.FindByIdAsync(md.Id);
//item.Name = md.Name;
var result = await roleManager.UpdateAsync(md);
if (result.Succeeded)
{
r.result = true;
}
else
{
r.message = String.Join(":", result.Errors);
r.result = false;
}
}
catch (Exception ex)
{
r.result = false;
r.message = ex.ToString();
}
return Ok(r);
}
示例7: aj_MasterUpdate
public string aj_MasterUpdate(parm md)
{
ResultInfo rAjaxResult = new ResultInfo();
try
{
var open = openLogic();
using (db0 = open.getDB0)
{
open.setParmValue(ParmDefine.bufferNorth_Max,md.bufferNorth_Max);
open.setParmValue(ParmDefine.bufferSouth_Max, md.bufferSouth_Max);
open.setParmValue(ParmDefine.N_Max_joinnum, md.N_Max_joinnum);
open.setParmValue(ParmDefine.S_Max_joinnum, md.S_Max_joinnum);
open.setParmValue(ParmDefine.receiveMails, md.receiveMails);
open.setParmValue(ParmDefine.BccMails, md.BccMails);
}
rAjaxResult.result = true;
}
catch (Exception ex)
{
rAjaxResult.result = false;
rAjaxResult.message = ex.Message;
}
return defJSON(rAjaxResult);
}
示例8: Put
public async Task<IHttpActionResult> Put([FromBody]ApplicationUser md)
{
ResultInfo r = new ResultInfo();
try
{
ApplicationUser item = await UserManager.FindByIdAsync(md.Id);
item.UserName = md.UserName;
item.Email = md.Email;
item.user_name_c = md.user_name_c;
var result = await UserManager.UpdateAsync(item);
if (result.Succeeded)
{
r.result = true;
}
else
{
r.message = String.Join(":", result.Errors);
r.result = false;
}
}
catch (Exception ex)
{
r.result = false;
r.message = ex.ToString();
}
return Ok(r);
}
示例9: DeleteEvapDetailExcelData
public IHttpActionResult DeleteEvapDetailExcelData()
{
#region 連接BusinessLogicLibary資料庫並取得資料
ResultInfo r = new ResultInfo();
db0 = getDB0();
try
{
var getFuelItem = db0.Apply_Detail_Evaporate.Where(x => x.userid == this.UserId && x.y == allowApplyYear);
db0.Apply_Detail_Evaporate.RemoveRange(getFuelItem);
db0.SaveChanges();
r.result = true;
return Ok(r);
}
catch (Exception ex)
{
r.message = ex.Message;
r.result = false;
return Ok(r);
}
finally
{
db0.Dispose();
}
#endregion
}
示例10: Post
public async Task<IHttpActionResult> Post([FromBody]AspNetRoles md)
{
ResultInfo r = new ResultInfo();
try
{
if (!await roleManager.RoleExistsAsync(md.Name))
{
var result = await roleManager.CreateAsync(new IdentityRole(md.Name));
if (result.Succeeded)
{
var item = await roleManager.FindByNameAsync(md.Name);
r.result = true;
r.aspnetid = item.Id;
}
else
{
r.result = false;
r.message = string.Join(":", result.Errors.ToArray());
}
}
else
{
r.result = false;
r.message = "The role " + md.Name + " has exist!";
}
return Ok(r);
}
catch (Exception ex)
{
r.result = false;
r.message = ex.Message;
return Ok(r);
}
}
示例11: aj_MasterUpdate
//[ValidateInput(false)]
public string aj_MasterUpdate(parm md)
{
ResultInfo rAjaxResult = new ResultInfo();
try
{
var open = openLogic();
using (db0 = getDB0())
{
////產品規格
//open.setParmValue(ParmDefine.surfacehandle, md.surfacehandle);
//open.setParmValue(ParmDefine.layer, md.layer);
//信件
open.setParmValue(ParmDefine.receiveMails, md.receiveMails);
//open.setParmValue(ParmDefine.BccMails, md.BccMails);
}
rAjaxResult.result = true;
}
catch (Exception ex)
{
rAjaxResult.result = false;
rAjaxResult.message = ex.Message;
}
return defJSON(rAjaxResult);
}
示例12: Get
public async Task<IHttpActionResult> Get(string id)
{
using (db0 = getDB0())
{
ApplicationUser item = await UserManager.FindByIdAsync(id);
var get_user_roles = item.Roles;
var system_roles = await roleManager.Roles.Where(x => x.Name != "Admins").ToListAsync();
item.role_array = new List<RoleArray>();
foreach (var role in system_roles)
{
var role_object = get_user_roles.Where(x => x.RoleId == role.Id).FirstOrDefault();
if (role_object != null)
{
item.role_array.Add(new RoleArray() { role_id = role.Id, role_use = true, role_name = role.Name });
}
else
{
item.role_array.Add(new RoleArray() { role_id = role.Id, role_use = false, role_name = role.Name });
}
}
var r = new ResultInfo<ApplicationUser>() { data = item };
return Ok(r);
}
}
示例13: DeleteMonthExcelData
public IHttpActionResult DeleteMonthExcelData()
{
#region 連接BusinessLogicLibary資料庫並取得資料
ResultInfo r = new ResultInfo();
db0 = getDB0();
try
{
var getMonthItem = db0.Apply_MonthAverage.Where(x => x.USERID == this.UserId && x.Y == allowApplyYear);
db0.Apply_MonthAverage.RemoveRange(getMonthItem);
db0.SaveChanges();
r.result = true;
return Ok(r);
}
catch (Exception ex)
{
r.message = ex.Message;
r.result = false;
return Ok(r);
}
finally
{
db0.Dispose();
}
#endregion
}
示例14: Get
public async Task<IHttpActionResult> Get(string id)
{
using (db0 = getDB0())
{
var item = await roleManager.FindByIdAsync(id);
var r = new ResultInfo<IdentityRole>() { data = item };
return Ok(r);
}
}
示例15: axFSort
public string axFSort(int id, string filekind, IList<JsonFileInfo> file_object)
{
ResultInfo r = new ResultInfo();
if (filekind == "Banner")
rewriteJsonFile(id, filekind, "Banner", "Banner", file_object);
r.result = true;
return defJSON(r);
}