예제 #1
0
        public void Post(long GJournalID, DateTime PostingDate)
        {
            try
            {
                string SQL = "UPDATE tblGJournal SET " +
                             "PostingDate		=	@PostingDate, "+
                             "Status				=	@Status "+
                             "WHERE GJournalID = @GJournalID;";



                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                MySqlParameter prmPostingDate = new MySqlParameter("@PostingDate", MySqlDbType.Date);
                prmPostingDate.Value = PostingDate.ToString("yyyy-MM-dd HH:mm:ss");
                cmd.Parameters.Add(prmPostingDate);

                MySqlParameter prmStatus = new MySqlParameter("@Status", MySqlDbType.Int16);
                prmStatus.Value = AccountGJournalsStatus.Posted.ToString("d");
                cmd.Parameters.Add(prmStatus);

                MySqlParameter prmGJournalID = new MySqlParameter("@GJournalID", MySqlDbType.Int64);
                prmGJournalID.Value = GJournalID;
                cmd.Parameters.Add(prmGJournalID);

                base.ExecuteNonQuery(cmd);


                GJournalsDebit clsGJournalsDebit = new GJournalsDebit(Connection, Transaction);
                clsGJournalsDebit.Post(GJournalID);

                GJournalsCredit clsGJournalsCredit = new GJournalsCredit(Connection, Transaction);
                clsGJournalsCredit.Post(GJournalID);
            }

            catch (Exception ex)
            {
                {
                }

                throw base.ThrowException(ex);
            }
        }
예제 #2
0
		private void LoadItems()
		{
			long GJournalID = Convert.ToInt64(lblGJournalID.Text);
			DataClass clsDataClass = new DataClass();

			GJournalsDebit clsGJournalsDebit = new GJournalsDebit();
			lstGJournalsDebit.DataSource = clsDataClass.DataReaderToDataTable(clsGJournalsDebit.List(GJournalID, "GJournalDebitID", SortOption.Ascending)).DefaultView;
			lstGJournalsDebit.DataBind();

			GJournalsCredit clsGJournalsCredit = new GJournalsCredit(clsGJournalsDebit.Connection, clsGJournalsDebit.Transaction);
			lstGJournalsCredit.DataSource = clsDataClass.DataReaderToDataTable(clsGJournalsCredit.List(GJournalID, "GJournalCreditID", SortOption.Ascending)).DefaultView;
			lstGJournalsCredit.DataBind();
			clsGJournalsDebit.CommitAndDispose();
		}
예제 #3
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();
		}
예제 #4
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;
		}
예제 #5
0
		public void Post(long GJournalID, DateTime PostingDate)
		{
			try 
			{
				string SQL = "UPDATE tblGJournal SET " + 
								"PostingDate		=	@PostingDate, " +
								"Status				=	@Status " +
							"WHERE GJournalID = @GJournalID;";
				  
				
	 			
				MySqlCommand cmd = new MySqlCommand();
				
				
				cmd.CommandType = System.Data.CommandType.Text;
				cmd.CommandText = SQL;

				MySqlParameter prmPostingDate = new MySqlParameter("@PostingDate",MySqlDbType.Date);
				prmPostingDate.Value = PostingDate.ToString("yyyy-MM-dd HH:mm:ss");
				cmd.Parameters.Add(prmPostingDate);

				MySqlParameter prmStatus = new MySqlParameter("@Status",MySqlDbType.Int16);			
				prmStatus.Value = AccountGJournalsStatus.Posted.ToString("d");
				cmd.Parameters.Add(prmStatus);

				MySqlParameter prmGJournalID = new MySqlParameter("@GJournalID",MySqlDbType.Int64);				
				prmGJournalID.Value = GJournalID;
				cmd.Parameters.Add(prmGJournalID);

				base.ExecuteNonQuery(cmd);


				GJournalsDebit clsGJournalsDebit = new GJournalsDebit(Connection, Transaction);
				clsGJournalsDebit.Post(GJournalID);
			
				GJournalsCredit clsGJournalsCredit = new GJournalsCredit(Connection, Transaction);
				clsGJournalsCredit.Post(GJournalID);
			}

			catch (Exception ex)
			{
				
				
				{
					
					 
					
					
				}

				throw base.ThrowException(ex);
			}	
		}