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

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

        if (inlineedit == ADD_MODE.ADD_ONTHEFLY)
        {
        }
    }
        public void Update(String KODEJENISKEGIATAN, String DESKRIPSI)
        {
            JENISKEGIATAN item = new JENISKEGIATAN();

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

            item.KODEJENISKEGIATAN = KODEJENISKEGIATAN;
            item.DESKRIPSI         = DESKRIPSI;
            item.Save("");
        }
Exemple #4
0
    private bool Init()
    {
        inlineedit = ((string)Request["editType"] == "inline");
        record_id  = (string)Request["recordID"];
        if (inlineedit)
        {
            templatefile = "JENISKEGIATAN_inline_edit.aspx";
        }
        else
        {
            templatefile = "JENISKEGIATAN_edit.aspx";
        }

        keys["KODEJENISKEGIATAN"] = Request["editid1"];
        if (keys.Count > 1)
        {
            item = controller.FetchByManyID(keys);
        }
        else
        {
            item = Data.JENISKEGIATAN.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=\"JENISKEGIATAN_list.aspx?a=return\">back</a>");
                return(false);
            }
        }
        else
        {
            this.Server.Transfer("~/JENISKEGIATAN_list.aspx?a=return");
        }

        return(true);
    }
Exemple #5
0
    private void SaveData()
    {
        item = new Data.JENISKEGIATAN();
        //	processing KODEJENISKEGIATAN - start
        if (!string.IsNullOrEmpty(Request["value_KODEJENISKEGIATAN"]))
        {
            item.KODEJENISKEGIATAN = Convert.ToString(Request["value_KODEJENISKEGIATAN"]);
        }
        //	processing DESKRIPSI - start
        if (!string.IsNullOrEmpty(Request["value_DESKRIPSI"]))
        {
            item.DESKRIPSI = Convert.ToString(Request["value_DESKRIPSI"]);
        }
        bool abortSaving = false;


        if (!abortSaving)
        {
            item.Save();
            ShowSuccessMessage();
        }
    }
Exemple #6
0
    private void SaveData()
    {
        if (RequestAction != "edited")
        {
            item = new Data.JENISKEGIATAN();
        }

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

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

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

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