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

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

        if (inlineedit == ADD_MODE.ADD_ONTHEFLY)
        {
        }
    }
    private void SaveData()
    {
        item = new Data.STATUSPBJ();
        //	processing KODESTATUS - start
        if (!string.IsNullOrEmpty(Request["value_KODESTATUS"]))
        {
            item.KODESTATUS = Convert.ToString(Request["value_KODESTATUS"]);
        }
        //	processing DESKRIPSI - start
        if (!string.IsNullOrEmpty(Request["value_DESKRIPSI"]))
        {
            item.DESKRIPSI = Convert.ToString(Request["value_DESKRIPSI"]);
        }
        //	processing URUTAN - start
        if (!string.IsNullOrEmpty(Request["value_URUTAN"]))
        {
            item.URUTAN = Convert.ToInt32(Request["value_URUTAN"]);
        }
        bool abortSaving = false;


        if (!abortSaving)
        {
            item.Save();
            ShowSuccessMessage();
        }
    }
        public void Update(String KODESTATUS, String DESKRIPSI, Int32 URUTAN)
        {
            STATUSPBJ item = new STATUSPBJ();

            item.KODESTATUS = KODESTATUS;
            item.DESKRIPSI  = DESKRIPSI;
            item.URUTAN     = URUTAN;
            item.MarkOld();
            item.Save("");
        }
Exemple #4
0
    private void SaveData()
    {
        if (RequestAction != "edited")
        {
            item = new Data.STATUSPBJ();
        }

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

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

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

        if (!abortSaving)
        {
            item.MarkOld();
            item.Save();
            idx             = "1";
            item.KODESTATUS = Convert.ToString(Request["editid" + idx]);
            ShowSuccessMessage();
        }
    }
Exemple #5
0
    private void BuildForm()
    {
        if (key.Count > 1)
        {
            item = controller.FetchByManyID(key);
        }
        else
        {
            item = Data.STATUSPBJ.FetchByID(Request["editid1"]);
        }
        Control control_key_KODESTATUS = new Control("KODESTATUS", item.KODESTATUS, false, smarty, this.Request, builder, MODE.MODE_VIEW);

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

            //	KODESTATUS -
            Control control_KODESTATUS = new Control("KODESTATUS", item.KODESTATUS, false, smarty, this.Request, builder, MODE.MODE_VIEW);
            value = control_KODESTATUS.GetData();
            value = control_KODESTATUS.ProcessLargeText(value, "field=KODESTATUS" + keylink, "", MODE.MODE_VIEW);
            smarty.Add("KODESTATUS_value", value);
            smarty.Add("KODESTATUS_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);

            //	URUTAN -
            Control control_URUTAN = new Control("URUTAN", item.URUTAN, false, smarty, this.Request, builder, MODE.MODE_VIEW);
            value = control_URUTAN.GetData();
            value = control_URUTAN.ProcessLargeText(value, "field=URUTAN" + keylink, "", MODE.MODE_VIEW);
            smarty.Add("URUTAN_value", value);
            smarty.Add("URUTAN_fieldblock", true);
        }
    }
Exemple #6
0
    private bool Init()
    {
        inlineedit = ((string)Request["editType"] == "inline");
        record_id  = (string)Request["recordID"];
        if (inlineedit)
        {
            templatefile = "STATUSPBJ_inline_edit.aspx";
        }
        else
        {
            templatefile = "STATUSPBJ_edit.aspx";
        }

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

        return(true);
    }