Example #1
0
    public void loadCollateral(int id)
    {
        LoanDSTableAdapters.CollateralTableAdapter collateral = new LoanDSTableAdapters.CollateralTableAdapter();
        LoanDS.CollateralDataTable tblcol = collateral.GetCollateralDetails(id);

        if (tblcol.Rows.Count > 0)
        {
            txtContactPerson.Value   = tblcol[0].datContactPerson.ToString();
            txtLocation.Value        = tblcol[0].datLocation.ToString();
            txtDescription.Value     = tblcol[0].datDescription;
            txtContactTel.Value      = tblcol[0].datContactPersonTelephoneNumber.ToString();
            txtPhysicalAddress.Value = tblcol[0].datPhysicalAddress.ToString();
            txtvalue.Value           = tblcol[0].datValue.ToString();
            try
            {
                ddlCollateralType.SelectedValue = tblcol[0].datCollateralTypeID.ToString();

                ddlCollateralType.SelectedIndex = ddlCollateralType.Items.IndexOf(ddlCollateralType.Items.FindByValue(tblcol[0].datCollateralTypeID.ToString()));
                if (Convert.ToInt32(tblcol[0].datConfirmed) > 0)
                {
                    ddlConfirmed.SelectedValue = tblcol[0].datConfirmed.ToString();
                }
                ddlSurity.ClearSelection();
                if (Convert.ToInt32(tblcol[0].datConfirmed) > 0)
                {
                    ddlSurity.SelectedValue = tblcol[0].datSurety.ToString();
                }
                //ddlSurity.SelectedIndex = ddlSurity.Items.IndexOf(ddlSurity.Items.FindByValue(tblcol[0].datSurety.ToString()));
            }
            catch (Exception ex) { }
            this.editskip.Value = "2";
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {

            int isConfirmed = -1;
            if (ddlConfirmed.Text == "1" || ddlConfirmed.Text == "2")
            {
                isConfirmed = Convert.ToInt32(ddlConfirmed.SelectedValue);
            }


            LoanDSTableAdapters.CollateralTableAdapter collateral = new LoanDSTableAdapters.CollateralTableAdapter();

            if (!(type == "update"))
            {
                collateral.InsertCollateral(MySessionManager.ClientID,
                                             MySessionManager.AppID,
                                             Convert.ToInt32(ddlCollateralType.Text),
                                             txtDescription.Value,
                                             txtLocation.Value,
                                              Convert.ToDecimal(txtvalue.Value),
                                             Convert.ToInt32(ddlSurity.SelectedValue),
                                             txtContactPerson.Value,
                                             txtContactTel.Value,
                                             txtPhysicalAddress.Value,
                                             Convert.ToInt32(isConfirmed),
                                             null);
            }
            else if (type == "update")
            {
                collateral.updateCollateral(Convert.ToInt32(ddlCollateralType.Text),
                                            txtDescription.Value,
                                            txtLocation.Value,
                                            Convert.ToDecimal(txtvalue.Value),
                                            Convert.ToInt32(ddlSurity.SelectedValue),
                                            txtContactPerson.Value,
                                            txtContactTel.Value,
                                            txtPhysicalAddress.Value,
                                            Convert.ToInt32(isConfirmed),
                                            null,
                                            id);
            }

            Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "coledit"));
        }
    }
Example #3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            int isConfirmed = -1;
            if (ddlConfirmed.Text == "1" || ddlConfirmed.Text == "2")
            {
                isConfirmed = Convert.ToInt32(ddlConfirmed.SelectedValue);
            }


            LoanDSTableAdapters.CollateralTableAdapter collateral = new LoanDSTableAdapters.CollateralTableAdapter();

            if (!(type == "update"))
            {
                collateral.InsertCollateral(MySessionManager.ClientID,
                                            MySessionManager.AppID,
                                            Convert.ToInt32(ddlCollateralType.Text),
                                            txtDescription.Value,
                                            txtLocation.Value,
                                            Convert.ToDecimal(txtvalue.Value),
                                            Convert.ToInt32(ddlSurity.SelectedValue),
                                            txtContactPerson.Value,
                                            txtContactTel.Value,
                                            txtPhysicalAddress.Value,
                                            Convert.ToInt32(isConfirmed),
                                            null);
            }
            else if (type == "update")
            {
                collateral.updateCollateral(Convert.ToInt32(ddlCollateralType.Text),
                                            txtDescription.Value,
                                            txtLocation.Value,
                                            Convert.ToDecimal(txtvalue.Value),
                                            Convert.ToInt32(ddlSurity.SelectedValue),
                                            txtContactPerson.Value,
                                            txtContactTel.Value,
                                            txtPhysicalAddress.Value,
                                            Convert.ToInt32(isConfirmed),
                                            null,
                                            id);
            }

            Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "coledit"));
        }
    }
    public void loadCollateral(int id)
    {
        LoanDSTableAdapters.CollateralTableAdapter collateral = new LoanDSTableAdapters.CollateralTableAdapter();
        LoanDS.CollateralDataTable tblcol = collateral.GetCollateralDetails(id);

        if (tblcol.Rows.Count > 0)
        {
            txtContactPerson.Value = tblcol[0].datContactPerson.ToString();
            txtLocation.Value = tblcol[0].datLocation.ToString();
            txtDescription.Value = tblcol[0].datDescription;
            txtContactTel.Value = tblcol[0].datContactPersonTelephoneNumber.ToString();
            txtPhysicalAddress.Value = tblcol[0].datPhysicalAddress.ToString();
            txtvalue.Value = tblcol[0].datValue.ToString();
            try
            {
                ddlCollateralType.SelectedValue = tblcol[0].datCollateralTypeID.ToString();

                ddlCollateralType.SelectedIndex = ddlCollateralType.Items.IndexOf(ddlCollateralType.Items.FindByValue(tblcol[0].datCollateralTypeID.ToString()));
                if (Convert.ToInt32(tblcol[0].datConfirmed) > 0) { ddlConfirmed.SelectedValue = tblcol[0].datConfirmed.ToString(); }
                ddlSurity.ClearSelection();
               if(Convert.ToInt32(tblcol[0].datConfirmed)>0) ddlSurity.SelectedValue = tblcol[0].datSurety.ToString();
                //ddlSurity.SelectedIndex = ddlSurity.Items.IndexOf(ddlSurity.Items.FindByValue(tblcol[0].datSurety.ToString()));
            }
            catch (Exception ex) { }
             this.editskip.Value = "2";
        }
    }