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_AirfareLastView.GetObjectById(id);
        }
        if (UO == null)
        {
            UO = new DO_AirfareLastView.UO_AirfareLastView();
        }

        if (Request.Form.Keys.Count > 0)
        {
            GetTogether.Web.WebHelper.SetValues <DO_AirfareLastView.UO_AirfareLastView>(UO, "AirfareLastView_");
            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_AirfareLastView.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("AirfareLastView.aspx");
        }
    }
Ejemplo n.º 2
0
    private void GetList()
    {
        Database_Output_AirfareLastView_Result c = (Database_Output_AirfareLastView_Result)Page.LoadControl("AirfareLastView_Result.ascx");

        DO_AirfareLastView.UO_AirfareLastView l = new DO_AirfareLastView.UO_AirfareLastView();
        GetTogether.Web.WebHelper.SetValues <DO_AirfareLastView.UO_AirfareLastView>(l, "AirfareLastView_");
        if (string.IsNullOrEmpty(Sort))
        {
            Sort = DO_AirfareLastView.Columns.Id.ToString();
        }
        PagingResult <DO_AirfareLastView.UO_AirfareLastView, DO_AirfareLastView.UOList_AirfareLastView> resultPaging = BO_AirfareLastView.GetPagingList(l, PageIndex, PageSize, Sort, IsAsc);

        c.JsFunction = "AirfareLastView_Search";
        c.SetData <DO_AirfareLastView.UO_AirfareLastView, DO_AirfareLastView.UOList_AirfareLastView>(resultPaging.Result);
        c.Total     = resultPaging.Total;
        c.Sort      = Sort;
        c.PageIndex = PageIndex;
        c.PageSize  = PageSize;
        c.IsAsc     = IsAsc;
        this.Controls.Add(c);
    }