示例#1
0
		private bool DeleteItems()
		{
			bool boRetValueDebit = false;
			string stIDs = "";

			foreach(DataListItem item in lstPaymentsDebit.Items)
			{
				HtmlInputCheckBox chkListDebit = (HtmlInputCheckBox) item.FindControl("chkListDebit");
				if (chkListDebit!=null)
				{
					if (chkListDebit.Checked == true)
					{
						stIDs += chkListDebit.Value + ",";		
						boRetValueDebit = true;
					}
				}
			}
			if (boRetValueDebit)
			{
				PaymentsDebit clsPaymentsDebit = new PaymentsDebit();
				clsPaymentsDebit.Delete( stIDs.Substring(0,stIDs.Length-1));
				clsPaymentsDebit.CommitAndDispose();
			}

			bool boRetValueCredit = false;
			stIDs = "";

			foreach(DataListItem item in lstPaymentsCredit.Items)
			{
				HtmlInputCheckBox chkListCredit = (HtmlInputCheckBox) item.FindControl("chkListCredit");
				if (chkListCredit!=null)
				{
					if (chkListCredit.Checked == true)
					{
						stIDs += chkListCredit.Value + ",";		
						boRetValueCredit = true;
					}
				}
			}
			if (boRetValueCredit)
			{
				PaymentsCredit clsPaymentsCredit = new PaymentsCredit();
				clsPaymentsCredit.Delete( stIDs.Substring(0,stIDs.Length-1));
				clsPaymentsCredit.CommitAndDispose();
			}

			bool boRetValue = false;
			if (boRetValueDebit)
				return true;
			
			if (boRetValueCredit)
				return true;

			return boRetValue;
		}
示例#2
0
		private void SaveCredit()
		{
			PaymentsCreditDetails clsDetails = new PaymentsCreditDetails();
			
			clsDetails.PaymentID = Convert.ToInt64(lblPaymentID.Text);
			clsDetails.ChartOfAccountID = Convert.ToInt32(cboAccount.SelectedItem.Value);
			clsDetails.Amount = Convert.ToDecimal(txtAmount.Text);

			PaymentsCredit clsPaymentsCredit = new PaymentsCredit();
			clsPaymentsCredit.Insert(clsDetails);
			clsPaymentsCredit.CommitAndDispose();
		}