Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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;

            txtCreditFinanceCharge.Text = clsDetails.CreditFinanceCharge.ToString("#,##0.#0");
            txtCreditLatePenaltyCharge.Text = clsDetails.CreditLatePenaltyCharge.ToString("#,##0.#0");
            txtCreditMinimumAmountDue.Text = clsDetails.CreditMinimumAmountDue.ToString("#,##0.#0");
            txtCreditMinimumPercentageDue.Text = clsDetails.CreditMinimumPercentageDue.ToString("#,##0.#0");
            txtCreditFinanceCharge15th.Text = clsDetails.CreditFinanceCharge15th.ToString("#,##0.#0");
            txtCreditLatePenaltyCharge15th.Text = clsDetails.CreditLatePenaltyCharge15th.ToString("#,##0.#0");
            txtCreditMinimumAmountDue15th.Text = clsDetails.CreditMinimumAmountDue15th.ToString("#,##0.#0");
            txtCreditMinimumPercentageDue15th.Text = clsDetails.CreditMinimumPercentageDue15th.ToString("#,##0.#0");
            chkWithGuarantor.Checked = clsDetails.WithGuarantor;
            chkExemptInTerminalCharge.Checked = clsDetails.ExemptInTerminalCharge;
            lblCreatedOn.Text = clsDetails.CreatedOn.ToString("yyyy-MM-dd hh:mm");
        }
Ejemplo n.º 3
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();
        }
Ejemplo 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;
        }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
0
		private bool Delete()
		{
			bool boRetValue = false;
			string stIDs = "";

			foreach(DataListItem item in lstItem.Items)
			{
				HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList");
				if (chkList!=null)
				{
					if (chkList.Checked == true)
					{
						stIDs += chkList.Value + ",";		
						boRetValue = true;
					}
				}
			}
			if (boRetValue)
			{
				CardType clsCardType = new CardType();
				clsCardType.Delete( stIDs.Substring(0,stIDs.Length-1));
				clsCardType.CommitAndDispose();
			}

			return boRetValue;
		}
Ejemplo n.º 7
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;
		}
Ejemplo n.º 8
0
        protected void lstItem_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
            string stParam = string.Empty;
            switch (e.CommandName)
            {
                case "imgItemDelete":
                    CardType clsCardType = new CardType();
                    clsCardType.Delete(chkList.Value);
                    clsCardType.CommitAndDispose();

                    LoadList();
                    break;
                case "imgItemEdit":
                    stParam = "?task=" + Common.Encrypt("edit", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);
                    Response.Redirect("Default.aspx" + stParam);
                    break;
            }
        }
Ejemplo n.º 9
0
		private void LoadOptions()
		{
            Data.Contacts clsContact = new Data.Contacts();

            cboContact.DataTextField = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource = clsContact.Guarantors(new ContactColumns() { ContactName = true }, SortField: "ContactName").DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.ZERO_STRING));
            cboContact.SelectedIndex = 0;

            Data.CardType clsCardType = new CardType(clsContact.Connection, clsContact.Transaction);
            cboCardType.DataTextField = "CardTypeCode";
            cboCardType.DataValueField = "CardTypeID";
            cboCardType.DataSource = clsCardType.ListAsDataTable(new CardTypeDetails() { CreditCardType = CreditCardTypes.Internal, CheckGuarantor = true, WithGuarantor = true }).DefaultView;
            cboCardType.DataBind();
            cboCardType.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.ZERO_STRING));
            cboCardType.SelectedIndex = 0;

            clsContact.CommitAndDispose();

            Int64 iGuarantorID = 0;
            if (Request.QueryString["id"] != null)
            {
                try { iGuarantorID = Int64.TryParse(Common.Decrypt(Request.QueryString["id"].ToString(), Session.SessionID), out iGuarantorID) ? iGuarantorID : 0; }
                catch { }
            }

            cboContact.ToolTip = iGuarantorID.ToString();
            if (iGuarantorID == 0)
            {
                divGuarantorInfo.Visible = false;
            }
            else
            {
                cboContact.SelectedIndex = cboContact.Items.IndexOf(cboContact.Items.FindByValue(iGuarantorID.ToString()));
                cboContact_SelectedIndexChanged(null, null);
            }
		}