Exemplo n.º 1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        bool   Updating = false;
        Params oParams  = null;

        if (ParamsID > 0)
        {
            oParams  = ParamsManager.GetParamsByID(ParamsID);
            Updating = oParams != null;
        }
        if (!Updating)
        {
            oParams = new Params();
        }

        oParams.TypeCode    = this.txtTypeCode.Text;
        oParams.TypeName    = this.txtTypeName.Text;
        oParams.Description = this.txtDescription.Text;
        oParams.ObjectValue = this.txtObjectValue.Text;
        bool bSuccess = Updating ? ParamsManager.UpdateParams(oParams) : ParamsManager.InsertParams(oParams);

        if (bSuccess)
        {
            Redirect("/params-list?s=1");
        }
        else
        {
            base.Warn("error.save");
        }
    }
Exemplo n.º 2
0
 private void InitData()
 {
     if (ParamsID > 0)
     {
         Params oParams = ParamsManager.GetParamsByID(ParamsID);
         if (oParams != null)
         {
             this.txtTypeCode.Text    = oParams.TypeCode;
             this.txtTypeName.Text    = oParams.TypeName;
             this.txtDescription.Text = oParams.Description;
             this.txtObjectValue.Text = oParams.ObjectValue;
         }
     }
 }
Exemplo n.º 3
0
    private void InitData()
    {
        bool visible = false;

        if (ParamsID > 0)
        {
            Params oParams = ParamsManager.GetParamsByID(ParamsID);
            if (oParams != null)
            {
                visible                  = true;
                this.ltrTypeID.Text      = oParams.TypeID.ToSureString();
                this.ltrTypeCode.Text    = oParams.TypeCode;
                this.ltrTypeName.Text    = oParams.TypeName;
                this.ltrDescription.Text = oParams.Description;
                this.ltrObjectValue.Text = oParams.ObjectValue;
            }
        }
        tblData.Visible = visible;
        if (!visible)
        {
            Warn(ResourceManager.GetResource("form.nodata"));
        }
    }