Esempio n. 1
0
		private bool DeleteItems()
		{
			bool boRetValueDebit = false;
			string stIDs = "";

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

			bool boRetValueCredit = false;
			stIDs = "";

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

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

			return boRetValue;
		}
Esempio n. 2
0
		private void SaveCredit()
		{
			GJournalsCreditDetails clsDetails = new GJournalsCreditDetails();
			
			clsDetails.GJournalID = Convert.ToInt64(lblGJournalID.Text);
			clsDetails.ChartOfAccountID = Convert.ToInt32(cboAccount.SelectedItem.Value);
			clsDetails.Amount = Convert.ToDecimal(txtAmount.Text);

			GJournalsCredit clsGJournalsCredit = new GJournalsCredit();
			clsGJournalsCredit.Insert(clsDetails);
			clsGJournalsCredit.CommitAndDispose();
		}