Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Int32 id = 0;

        if (!string.IsNullOrEmpty(Request["id"]))
        {
            id = Convert.ToInt32(Request["id"]);
        }
        if (id > 0)
        {
            UO = BO_APIS_Info.GetObjectById(id);
        }
        if (UO == null)
        {
            UO = new DO_APIS_Info.UO_APIS_Info();
        }

        if (Request.Form.Keys.Count > 0)
        {
            GetTogether.Web.WebHelper.SetValues <DO_APIS_Info.UO_APIS_Info>(UO, "APIS_Info_");
            if (id > 0)
            {
                //Pending
                UO["UpdateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd");
                UO["UpdateBy"] = string.Concat("WS-", Request.UserHostAddress);
                UO.Update(BO_APIS_Info.GetConditionsById(id));
            }
            else
            {
                //Pending
                UO["CreateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd");
                UO["CreateBy"] = string.Concat("WS-", Request.UserHostAddress);
                UO.Insert();
            }
            Response.Redirect("APIS_Info.aspx");
        }
    }
Пример #2
0
    private void GetList()
    {
        Database_Output_APIS_Info_Result c = (Database_Output_APIS_Info_Result)Page.LoadControl("APIS_Info_Result.ascx");

        DO_APIS_Info.UO_APIS_Info l = new DO_APIS_Info.UO_APIS_Info();
        GetTogether.Web.WebHelper.SetValues <DO_APIS_Info.UO_APIS_Info>(l, "APIS_Info_");
        if (string.IsNullOrEmpty(Sort))
        {
            Sort = DO_APIS_Info.Columns.Id.ToString();
        }
        PagingResult <DO_APIS_Info.UO_APIS_Info, DO_APIS_Info.UOList_APIS_Info> resultPaging = BO_APIS_Info.GetPagingList(l, PageIndex, PageSize, Sort, IsAsc);

        c.JsFunction = "APIS_Info_Search";
        c.SetData <DO_APIS_Info.UO_APIS_Info, DO_APIS_Info.UOList_APIS_Info>(resultPaging.Result);
        c.Total     = resultPaging.Total;
        c.Sort      = Sort;
        c.PageIndex = PageIndex;
        c.PageSize  = PageSize;
        c.IsAsc     = IsAsc;
        this.Controls.Add(c);
    }