protected void Page_Load(object sender, EventArgs e)
    {
        Int64 id = 0;

        if (!string.IsNullOrEmpty(Request["id"]))
        {
            id = Convert.ToInt64(Request["id"]);
        }
        if (id > 0)
        {
            UO = BO_Main_AdvertisementsType.GetObjectById(id);
        }
        if (UO == null)
        {
            UO = new DO_Main_AdvertisementsType.UO_Main_AdvertisementsType();
        }

        if (Request.Form.Keys.Count > 0)
        {
            GetTogether.Web.WebHelper.SetValues <DO_Main_AdvertisementsType.UO_Main_AdvertisementsType>(UO, "Main_AdvertisementsType_");
            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_Main_AdvertisementsType.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("Main_AdvertisementsType.aspx");
        }
    }