Ashx 基本知识

InventoryEntity entity = new InventoryEntity();



// 新增保存

string d = Text.Post("da", Text.CheckGetEnum.Json);

entity.SetValueByJson(Text.ClearBR(d));

entity.AcceptChanges();

entity.State = EAD.ORM.Core.Entity.State.New;

entity.Save();



// 修改保存

entity.ID = id.Trim();    // 另一种写法:    entity.WhereSql = " ID = '" + id + "'";

entity.AcceptChanges();

entity.GetDetail(0);

entity.State = EAD.ORM.Core.Entity.State.Edit;

entity.Save();



// 删除保存

entity.ID = id.Trim();

entity.AcceptChanges();

entity.GetDetail(0);

entity.State = EAD.ORM.Core.Entity.State.Delete;

entity.Save();



context.Response.ContentType = "text/plain";

base.CheckUser(context);
bool isHasAuthority = IsAuthority("save");
if (isHasAuthority == true) // 权限验证
{
var action = Text.Post("action");

if (string.IsNullOrEmpty(action)) // 更改参数传递方式
{
action = Text.Get("action");
}

 
   

switch (action)
{
case "Audit":
AuditOrder(context);
break;
case "ReturnAudit":
ReturnAuditOrder(context);
break;
case "Invalid":
InvalidOrder(context);
break;
}
}


private void AuditOrder(HttpContext context) { }


private void ReturnAuditOrder(HttpContext context) { }


private void InvalidOrder(HttpContext context) { }

 

你可能感兴趣的:(sh)