Example #1
0
        protected void BtnUpdate_Click(object sender, EventArgs e)
        {
            A2ZTRANTYPEDTO UpDTO = new A2ZTRANTYPEDTO();

            UpDTO.TrnTypeCode        = Converter.GetInteger(txtcode.Text);
            UpDTO.TrnTypeDescription = Converter.GetString(txtDescription.Text);

            int roweffect = A2ZTRANTYPEDTO.UpdateInformation(UpDTO);

            if (roweffect > 0)
            {
                gvDetail();
                Trandropdown();
                clearinfo();
                // ddlType.SelectedValue = "0";
                BtnSubmit.Visible = true;
                BtnUpdate.Visible = false;
                txtcode.Focus();
            }
        }
Example #2
0
        protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlType.SelectedValue == "-Select-")
            {
                txtcode.Focus();
                txtcode.Text        = string.Empty;
                txtDescription.Text = string.Empty;
                BtnSubmit.Visible   = true;
                BtnUpdate.Visible   = false;
            }

            try
            {
                if (ddlType.SelectedValue != "-Select-")
                {
                    Int16          MainCode = Converter.GetSmallInteger(ddlType.SelectedValue);
                    A2ZTRANTYPEDTO getDTO   = (A2ZTRANTYPEDTO.GetInformation(MainCode));
                    if (getDTO.record > 0)
                    {
                        txtcode.Text        = Converter.GetString(getDTO.TrnTypeCode);
                        txtDescription.Text = Converter.GetString(getDTO.TrnTypeDescription);
                        BtnSubmit.Visible   = false;
                        BtnUpdate.Visible   = true;
                        txtDescription.Focus();
                    }
                    else
                    {
                        txtcode.Focus();
                        txtcode.Text        = string.Empty;
                        txtDescription.Text = string.Empty;
                        BtnSubmit.Visible   = true;
                        BtnUpdate.Visible   = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                A2ZTRANTYPEDTO objDTO = new A2ZTRANTYPEDTO();

                objDTO.TrnTypeCode        = Converter.GetInteger(txtcode.Text);
                objDTO.TrnTypeDescription = Converter.GetString(txtDescription.Text);

                int roweffect = A2ZTRANTYPEDTO.InsertInformation(objDTO);
                if (roweffect > 0)
                {
                    gvDetail();
                    txtcode.Focus();
                    clearinfo();
                    Trandropdown();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }