Beispiel #1
0
        private void DeleteDetails(string sql)
        {
            InvtBatchCAP_DetailsCollection oDetailList = InvtBatchCAP_Details.LoadCollection(sql);

            foreach (InvtBatchCAP_Details oDetail in oDetailList)
            {
                oDetail.Delete();
            }
        }
Beispiel #2
0
        private decimal GetTotalRequiredQty()
        {
            decimal totalQty = 0;

            string sql = "HeaderId = '" + this.CAPHeaderId.ToString() + "'";
            InvtBatchCAP_DetailsCollection oDetails = InvtBatchCAP_Details.LoadCollection(sql);

            foreach (InvtBatchCAP_Details oDetail in oDetails)
            {
                totalQty += oDetail.Qty;
            }

            return(totalQty);
        }
Beispiel #3
0
        private decimal GetTotalAmount()
        {
            decimal totalAmt = 0;

            string sql = "HeaderId = '" + this.CAPHeaderId.ToString() + "'";
            InvtBatchCAP_DetailsCollection oDetails = InvtBatchCAP_Details.LoadCollection(sql);

            foreach (InvtBatchCAP_Details oDetail in oDetails)
            {
                decimal xchgRate = Convert.ToDecimal(DAL.Common.Utility.IsNumeric(txtExchgRate.Text) ? txtExchgRate.Text.Trim() : "1");
                totalAmt += oDetail.UnitAmount * oDetail.Qty;
            }

            return(totalAmt);
        }
        /// <summary>
        /// Loads a collection of InvtBatchCAP_Details objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the InvtBatchCAP_Details objects in the database.</returns>
        public static InvtBatchCAP_DetailsCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            InvtBatchCAP_DetailsCollection result = new InvtBatchCAP_DetailsCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    InvtBatchCAP_Details tmp = new InvtBatchCAP_Details();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }