Exemplo n.º 1
0
        private Int32 SaveRecord()
        {
            CardType        clsCardType = new CardType();
            CardTypeDetails clsDetails  = new CardTypeDetails(CreditCardTypes.Internal);

            clsDetails.CardTypeCode = txtCardTypeCode.Text;
            clsDetails.CardTypeName = txtCardTypeName.Text;

            clsDetails.CreditFinanceCharge            = decimal.Parse(txtCreditFinanceCharge.Text);
            clsDetails.CreditLatePenaltyCharge        = decimal.Parse(txtCreditLatePenaltyCharge.Text);
            clsDetails.CreditMinimumAmountDue         = decimal.Parse(txtCreditMinimumAmountDue.Text);
            clsDetails.CreditMinimumPercentageDue     = decimal.Parse(txtCreditMinimumPercentageDue.Text);
            clsDetails.CreditFinanceCharge15th        = decimal.Parse(txtCreditFinanceCharge15th.Text);
            clsDetails.CreditLatePenaltyCharge15th    = decimal.Parse(txtCreditLatePenaltyCharge15th.Text);
            clsDetails.CreditMinimumAmountDue15th     = decimal.Parse(txtCreditMinimumAmountDue15th.Text);
            clsDetails.CreditMinimumPercentageDue15th = decimal.Parse(txtCreditMinimumPercentageDue15th.Text);
            clsDetails.WithGuarantor          = chkWithGuarantor.Checked;
            clsDetails.ExemptInTerminalCharge = chkExemptInTerminalCharge.Checked;
            clsDetails.CreatedOn    = DateTime.Now;
            clsDetails.LastModified = DateTime.Now;

            Int32 id = clsCardType.Insert(clsDetails);

            clsCardType.CommitAndDispose();

            return(id);
        }
Exemplo n.º 2
0
        private void SaveRecord()
        {
            CardType        clsCardType = new CardType();
            CardTypeDetails clsDetails  = new CardTypeDetails();

            clsDetails.CardTypeID   = Convert.ToInt16(lblCardTypeID.Text);
            clsDetails.CardTypeCode = txtCardTypeCode.Text;
            clsDetails.CardTypeName = txtCardTypeName.Text;

            clsDetails.CreditFinanceCharge            = decimal.Parse(txtCreditFinanceCharge.Text);
            clsDetails.CreditLatePenaltyCharge        = decimal.Parse(txtCreditLatePenaltyCharge.Text);
            clsDetails.CreditMinimumAmountDue         = decimal.Parse(txtCreditMinimumAmountDue.Text);
            clsDetails.CreditMinimumPercentageDue     = decimal.Parse(txtCreditMinimumPercentageDue.Text);
            clsDetails.CreditFinanceCharge15th        = decimal.Parse(txtCreditFinanceCharge15th.Text);
            clsDetails.CreditLatePenaltyCharge15th    = decimal.Parse(txtCreditLatePenaltyCharge15th.Text);
            clsDetails.CreditMinimumAmountDue15th     = decimal.Parse(txtCreditMinimumAmountDue15th.Text);
            clsDetails.CreditMinimumPercentageDue15th = decimal.Parse(txtCreditMinimumPercentageDue15th.Text);
            clsDetails.WithGuarantor          = chkWithGuarantor.Checked;
            clsDetails.ExemptInTerminalCharge = chkExemptInTerminalCharge.Checked;
            clsDetails.CreatedOn    = DateTime.Parse(lblCreatedOn.Text);
            clsDetails.LastModified = DateTime.Now;

            clsCardType.Update(clsDetails);
            clsCardType.CommitAndDispose();
        }
Exemplo n.º 3
0
        private void LoadRecord()
        {
            Int16           iID         = Convert.ToInt16(Common.Decrypt(Request.QueryString["id"], Session.SessionID));
            CardType        clsCardType = new CardType();
            CardTypeDetails clsDetails  = clsCardType.Details(iID);

            clsCardType.CommitAndDispose();

            lblCardTypeID.Text   = clsDetails.CardTypeID.ToString();
            txtCardTypeCode.Text = clsDetails.CardTypeCode;
            txtCardTypeName.Text = clsDetails.CardTypeName;
        }
Exemplo n.º 4
0
        private Int32 SaveRecord()
        {
            CardType        clsCardType = new CardType();
            CardTypeDetails clsDetails  = new CardTypeDetails(CreditCardTypes.External);

            clsDetails.CardTypeCode = txtCardTypeCode.Text;
            clsDetails.CardTypeName = txtCardTypeName.Text;

            clsDetails.CreatedOn    = DateTime.Now;
            clsDetails.LastModified = DateTime.Now;

            Int32 id = clsCardType.Insert(clsDetails);

            clsCardType.CommitAndDispose();

            return(id);
        }
Exemplo n.º 5
0
        private void LoadRecord()
        {
            Int16           iID         = Convert.ToInt16(Common.Decrypt(Request.QueryString["id"], Session.SessionID));
            CardType        clsCardType = new CardType();
            CardTypeDetails clsDetails  = clsCardType.Details(iID);

            clsCardType.CommitAndDispose();

            lblCardTypeID.Text   = clsDetails.CardTypeID.ToString();
            txtCardTypeCode.Text = clsDetails.CardTypeCode;
            txtCardTypeName.Text = clsDetails.CardTypeName;

            lblCreditFinanceCharge.Text        = clsDetails.CreditFinanceCharge.ToString("#,##0.#0");
            lblCreditLatePenaltyCharge.Text    = clsDetails.CreditLatePenaltyCharge.ToString("#,##0.#0");
            lblCreditMinimumAmountDue.Text     = clsDetails.CreditMinimumAmountDue.ToString("#,##0.#0");
            lblCreditMinimumPercentageDue.Text = clsDetails.CreditMinimumPercentageDue.ToString("#,##0.#0");
            chkWithGuarantor.Checked           = clsDetails.WithGuarantor;
            chkExemptInTerminalCharge.Checked  = clsDetails.ExemptInTerminalCharge;
            lblCreatedOn.Text = clsDetails.CreatedOn.ToString("yyyy-MM-dd hh:mm");
        }
Exemplo n.º 6
0
        private void LoadList()
        {
            CardType  clsCardType  = new CardType();
            DataClass clsDataClass = new DataClass();

            string SortField = "CardTypeID";

            if (Request.QueryString["sortfield"] != null)
            {
                SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID);
            }

            SortOption sortoption = SortOption.Ascending;

            if (Request.QueryString["sortoption"] != null)
            {
                sortoption = (SortOption)Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true);
            }

            Data.CardTypeDetails SearchKeys = new CardTypeDetails(CreditCardTypes.Internal);
            if (Request.QueryString["Search"] != null)
            {
                SearchKeys.CardTypeCode = Common.Decrypt((string)Request.QueryString["search"], Session.SessionID);
                SearchKeys.CardTypeName = Common.Decrypt((string)Request.QueryString["search"], Session.SessionID);
            }

            PageData.DataSource = clsCardType.ListAsDataTable(SearchKeys, SortField, sortoption).DefaultView;
            clsCardType.CommitAndDispose();

            int iPageSize = Convert.ToInt16(Session["PageSize"]);

            PageData.AllowPaging = true;
            PageData.PageSize    = iPageSize;
            try
            {
                PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1;
                lstItem.DataSource        = PageData;
                lstItem.DataBind();
            }
            catch
            {
                PageData.CurrentPageIndex = 1;
                lstItem.DataSource        = PageData;
                lstItem.DataBind();
            }

            cboCurrentPage.Items.Clear();
            for (int i = 0; i < PageData.PageCount; i++)
            {
                int iValue = i + 1;
                cboCurrentPage.Items.Add(new ListItem(iValue.ToString(), iValue.ToString()));
                if (PageData.CurrentPageIndex == i)
                {
                    cboCurrentPage.Items[i].Selected = true;
                }
                else
                {
                    cboCurrentPage.Items[i].Selected = false;
                }
            }
            lblDataCount.Text = " of " + " " + PageData.PageCount;
        }