コード例 #1
0
 /// <summary>
 /// Function to Update values in RejectionInMaster Table
 /// </summary>
 /// <param name="rejectioninmasterinfo"></param>
 public void RejectionInMasterEdit(RejectionInMasterInfo rejectioninmasterinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("RejectionInMasterEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam       = sccmd.Parameters.Add("@rejectionInMasterId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.RejectionInMasterId;
         sprmparam       = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.VoucherNo;
         sprmparam       = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.InvoiceNo;
         sprmparam       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.VoucherTypeId;
         sprmparam       = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.SuffixPrefixId;
         sprmparam       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
         sprmparam.Value = rejectioninmasterinfo.Date;
         sprmparam       = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.LedgerId;
         sprmparam       = sccmd.Parameters.Add("@deliveryNoteMasterId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.DeliveryNoteMasterId;
         sprmparam       = sccmd.Parameters.Add("@pricinglevelId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.PricinglevelId;
         sprmparam       = sccmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.EmployeeId;
         sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.Narration;
         sprmparam       = sccmd.Parameters.Add("@exchangeRateId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.ExchangeRateId;
         sprmparam       = sccmd.Parameters.Add("@totalAmount", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.TotalAmount;
         sprmparam       = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.UserId;
         sprmparam       = sccmd.Parameters.Add("@lrNo", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.LrNo;
         sprmparam       = sccmd.Parameters.Add("@transportationCompany", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.TransportationCompany;
         sprmparam       = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
         sprmparam.Value = rejectioninmasterinfo.FinancialYearId;
         sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.Extra1;
         sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = rejectioninmasterinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
コード例 #2
0
        /// <summary>
        /// Function to get particular values from RejectionInMaster table based on the parameter
        /// </summary>
        /// <param name="rejectionInMasterId"></param>
        /// <returns></returns>
        public RejectionInMasterInfo RejectionInMasterView(decimal rejectionInMasterId)
        {
            RejectionInMasterInfo rejectioninmasterinfo = new RejectionInMasterInfo();
            SqlDataReader         sdrreader             = null;

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("RejectionInMasterView", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam       = sccmd.Parameters.Add("@rejectionInMasterId", SqlDbType.Decimal);
                sprmparam.Value = rejectionInMasterId;
                sdrreader       = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    rejectioninmasterinfo.RejectionInMasterId = decimal.Parse(sdrreader[0].ToString());
                    rejectioninmasterinfo.VoucherNo           = sdrreader[1].ToString();
                    rejectioninmasterinfo.InvoiceNo           = sdrreader[2].ToString();
                    rejectioninmasterinfo.VoucherTypeId       = decimal.Parse(sdrreader[3].ToString());
                    rejectioninmasterinfo.SuffixPrefixId      = decimal.Parse(sdrreader[4].ToString());
                    rejectioninmasterinfo.Date                  = DateTime.Parse(sdrreader[5].ToString());
                    rejectioninmasterinfo.LedgerId              = decimal.Parse(sdrreader[6].ToString());
                    rejectioninmasterinfo.PricinglevelId        = decimal.Parse(sdrreader[7].ToString());
                    rejectioninmasterinfo.EmployeeId            = decimal.Parse(sdrreader[8].ToString());
                    rejectioninmasterinfo.Narration             = sdrreader[9].ToString();
                    rejectioninmasterinfo.ExchangeRateId        = decimal.Parse(sdrreader[10].ToString());
                    rejectioninmasterinfo.TotalAmount           = decimal.Parse(sdrreader[11].ToString());
                    rejectioninmasterinfo.UserId                = decimal.Parse(sdrreader[12].ToString());
                    rejectioninmasterinfo.LrNo                  = sdrreader[13].ToString();
                    rejectioninmasterinfo.TransportationCompany = sdrreader[14].ToString();
                    rejectioninmasterinfo.FinancialYearId       = decimal.Parse(sdrreader[15].ToString());
                    rejectioninmasterinfo.ExtraDate             = DateTime.Parse(sdrreader[16].ToString());
                    rejectioninmasterinfo.Extra1                = sdrreader[17].ToString();
                    rejectioninmasterinfo.Extra2                = sdrreader[18].ToString();
                    rejectioninmasterinfo.DeliveryNoteMasterId  = decimal.Parse(sdrreader[19].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                sqlcon.Close();
            }
            return(rejectioninmasterinfo);
        }