コード例 #1
0
 public void LedgerPostingAdd(LedgerPostingInfo ledgerpostinginfo)
 {
     try
       {
       SpLedgerPosting.LedgerPostingAdd(ledgerpostinginfo);
       }
       catch (Exception ex)
       {
       MessageBox.Show("LPBLL:1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
       }
 }
コード例 #2
0
 /// <summary>
 /// Function to get particular values from LedgerPosting table based on the parameter
 /// </summary>
 /// <param name="ledgerPostingId"></param>
 /// <returns></returns>
 public LedgerPostingInfo LedgerPostingView(decimal ledgerPostingId)
 {
     LedgerPostingInfo ledgerpostinginfo = new LedgerPostingInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("LedgerPostingView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@ledgerPostingId", SqlDbType.Decimal);
         sprmparam.Value = ledgerPostingId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             ledgerpostinginfo.LedgerPostingId = decimal.Parse(sdrreader[0].ToString());
             ledgerpostinginfo.Date = DateTime.Parse(sdrreader[1].ToString());
             ledgerpostinginfo.VoucherTypeId = decimal.Parse(sdrreader[2].ToString());
             ledgerpostinginfo.VoucherNo = sdrreader[3].ToString();
             ledgerpostinginfo.LedgerId = decimal.Parse(sdrreader[4].ToString());
             ledgerpostinginfo.Debit = decimal.Parse(sdrreader[5].ToString());
             ledgerpostinginfo.Credit = decimal.Parse(sdrreader[6].ToString());
             ledgerpostinginfo.DetailsId = decimal.Parse(sdrreader[8].ToString());
             ledgerpostinginfo.YearId = decimal.Parse(sdrreader[9].ToString());
             ledgerpostinginfo.InvoiceNo = sdrreader[10].ToString();
             ledgerpostinginfo.ChequeNo = sdrreader[11].ToString();
             ledgerpostinginfo.ChequeDate = DateTime.Parse(sdrreader[12].ToString());
             ledgerpostinginfo.ExtraDate = DateTime.Parse(sdrreader[13].ToString());
             ledgerpostinginfo.Extra1 = sdrreader[14].ToString();
             ledgerpostinginfo.Extra2 = sdrreader[15].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return ledgerpostinginfo;
 }
コード例 #3
0
        /// <summary>
        /// ledgerPosting edit by vouchertype and voucherNo and ledgerId
        /// </summary>
        /// <param name="infoLedgerPosting"></param>
        public void LedgerPostingEditByVoucherTypeAndVoucherNoAndLedgerId(LedgerPostingInfo infoLedgerPosting)
        {
            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("LedgerPostingEditByVoucherTypeAndVoucherNoAndLedgerId", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();

                sprmparam = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
                sprmparam.Value = infoLedgerPosting.Date;
                sprmparam = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
                sprmparam.Value = infoLedgerPosting.VoucherTypeId;
                sprmparam = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
                sprmparam.Value = infoLedgerPosting.VoucherNo;
                sprmparam = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
                sprmparam.Value = infoLedgerPosting.LedgerId;
                sprmparam = sccmd.Parameters.Add("@debit", SqlDbType.Decimal);
                sprmparam.Value = infoLedgerPosting.Debit;
                sprmparam = sccmd.Parameters.Add("@credit", SqlDbType.Decimal);
                sprmparam.Value = infoLedgerPosting.Credit;
                sprmparam = sccmd.Parameters.Add("@detailsId", SqlDbType.Decimal);
                sprmparam.Value = infoLedgerPosting.DetailsId;
                sprmparam = sccmd.Parameters.Add("@yearId", SqlDbType.Decimal);
                sprmparam.Value = infoLedgerPosting.YearId;
                sprmparam = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
                sprmparam.Value = infoLedgerPosting.InvoiceNo;
                sprmparam = sccmd.Parameters.Add("@chequeNo", SqlDbType.VarChar);
                sprmparam.Value = infoLedgerPosting.ChequeNo;
                sprmparam = sccmd.Parameters.Add("@chequeDate", SqlDbType.DateTime);
                sprmparam.Value = infoLedgerPosting.ChequeDate;

                sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam.Value = infoLedgerPosting.Extra1;
                sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam.Value = infoLedgerPosting.Extra2;
                sccmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sqlcon.Close();
            }
        }
コード例 #4
0
 public void LedgerPostingEditByVoucherTypeAndVoucherNoAndLedgerId(LedgerPostingInfo infoLedgerPosting)
 {
     try
     {
         SpLedgerPosting.LedgerPostingEditByVoucherTypeAndVoucherNoAndLedgerId(infoLedgerPosting);
     }
     catch (Exception ex)
     {
         MessageBox.Show("LPBLL:10" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }