private void CopyRecord()
    {
        //	copy record
        if (Request["copyid1"] != null || Request["editid1"] != null)
        {
            if (Request["copyid1"] != null)
            {
                item   = Data.TIPEAKTOR.FetchByID(Request["copyid1"]);
                isCopy = true;
            }
            else
            {
                item = Data.TIPEAKTOR.FetchByID(Request["editid1"]);
            }

            //	clear key fields
            defvalues["KODETIPE"] = item.KODETIPE;
        }
        else if (defvalues.Count == 0)
        {
        }

        if (inlineedit == ADD_MODE.ADD_ONTHEFLY)
        {
        }
    }
    private void BuildForm()
    {
        if (key.Count > 1)
        {
            item = controller.FetchByManyID(key);
        }
        else
        {
            item = Data.TIPEAKTOR.FetchByID(Request["editid1"]);
        }
        Control control_key_KODETIPE = new Control("KODETIPE", item.KODETIPE, false, smarty, this.Request, builder, MODE.MODE_VIEW);

        smarty.Add("show_key1", Control.HTMLEncodeSpecialChars(control_key_KODETIPE.GetData()));
        if (item != null)
        {
            string value   = "";
            string keylink = string.Empty;
            keylink += "&key1=" + Control.HTMLEncodeSpecialChars(this.Server.UrlEncode(item.KODETIPE.ToString()));

            //	KODETIPE -
            Control control_KODETIPE = new Control("KODETIPE", item.KODETIPE, false, smarty, this.Request, builder, MODE.MODE_VIEW);
            value = control_KODETIPE.GetData();
            value = control_KODETIPE.ProcessLargeText(value, "field=KODETIPE" + keylink, "", MODE.MODE_VIEW);
            smarty.Add("KODETIPE_value", value);
            smarty.Add("KODETIPE_fieldblock", true);

            //	DESKRIPSI -
            Control control_DESKRIPSI = new Control("DESKRIPSI", item.DESKRIPSI, false, smarty, this.Request, builder, MODE.MODE_VIEW);
            value = control_DESKRIPSI.GetData();
            value = control_DESKRIPSI.ProcessLargeText(value, "field=DESKRIPSI" + keylink, "", MODE.MODE_VIEW);
            smarty.Add("DESKRIPSI_value", value);
            smarty.Add("DESKRIPSI_fieldblock", true);
        }
    }
        public void Update(String KODETIPE, String DESKRIPSI)
        {
            TIPEAKTOR item = new TIPEAKTOR();

            item.KODETIPE  = KODETIPE;
            item.DESKRIPSI = DESKRIPSI;
            item.MarkOld();
            item.Save("");
        }
        public void Insert(
            String
            KODETIPE
            ,
            String
            DESKRIPSI
            )
        {
            TIPEAKTOR item = new TIPEAKTOR();

            item.KODETIPE  = KODETIPE;
            item.DESKRIPSI = DESKRIPSI;
            item.Save("");
        }
    private void SaveData()
    {
        item = new Data.TIPEAKTOR();
        //	processing KODETIPE - start
        if (!string.IsNullOrEmpty(Request["value_KODETIPE"]))
        {
            item.KODETIPE = Convert.ToString(Request["value_KODETIPE"]);
        }
        //	processing DESKRIPSI - start
        if (!string.IsNullOrEmpty(Request["value_DESKRIPSI"]))
        {
            item.DESKRIPSI = Convert.ToString(Request["value_DESKRIPSI"]);
        }
        bool abortSaving = false;


        if (!abortSaving)
        {
            item.Save();
            ShowSuccessMessage();
        }
    }
    private bool Init()
    {
        inlineedit = ((string)Request["editType"] == "inline");
        record_id  = (string)Request["recordID"];
        if (inlineedit)
        {
            templatefile = "TIPEAKTOR_inline_edit.aspx";
        }
        else
        {
            templatefile = "TIPEAKTOR_edit.aspx";
        }

        keys["KODETIPE"] = Request["editid1"];
        if (keys.Count > 1)
        {
            item = controller.FetchByManyID(keys);
        }
        else
        {
            item = Data.TIPEAKTOR.FetchByID(Request["editid1"]);
        }

        if (item != null)
        {
            bool editable = true;
            if (!editable)
            {
                output.Append("<p>" + "You don't have permissions to access this table" + " <a href=\"TIPEAKTOR_list.aspx?a=return\">back</a>");
                return(false);
            }
        }
        else
        {
            this.Server.Transfer("~/TIPEAKTOR_list.aspx?a=return");
        }

        return(true);
    }
    private void SaveData()
    {
        if (RequestAction != "edited")
        {
            item = new Data.TIPEAKTOR();
        }

        Data.TIPEAKTOR emptyItem = new Data.TIPEAKTOR();

        //	processing DESKRIPSI - start
        if (!string.IsNullOrEmpty(Request["value_DESKRIPSI"]))
        {
            item.DESKRIPSI = Convert.ToString(Request["value_DESKRIPSI"]);
        }
        else
        {
            item.DESKRIPSI = emptyItem.DESKRIPSI;
        }
        //
        //item.KODETIPE =  Convert.ToString(Request["editid1"]);
        //
        string idx = string.Empty;

        idx           = "1";
        item.KODETIPE = Convert.ToString(Request["editid" + idx]);
        bool abortSaving = false;

        if (!abortSaving)
        {
            item.MarkOld();
            item.Save();
            idx           = "1";
            item.KODETIPE = Convert.ToString(Request["editid" + idx]);
            ShowSuccessMessage();
        }
    }