コード例 #1
0
 public void CopyQuotation(Model.Quotation fromquotation, Model.Quotation toQuotation)
 {
     if (fromquotation == null)
     {
         return;
     }
     Connection.Execute("CopyQuotation", new { @FromQuotationCode = fromquotation.QuotationCode, @ToQuotationCode = toQuotation.QuotationCode }, commandType: CommandType.StoredProcedure, transaction: Transaction);
 }
コード例 #2
0
 public List <Model.QuotationDetail> Find(Model.Quotation quotation)
 {
     if (quotation == null)
     {
         return(null);
     }
     return(Connection.Query <Model.QuotationDetail, Model.Product, Model.Unit, Model.QuotationDetail>("GetAllProductByQuotation", (qd, p, u) => { qd.Product = p; p.Unit = u; return qd; }
                                                                                                       , param: new { @quotationCode = quotation.QuotationCode }, splitOn: "ProductCode,UnitName", commandType: CommandType.StoredProcedure, transaction: Transaction).ToList());
 }
コード例 #3
0
        private async Task <double> UpdateAmount(double purchaseAmount, Model.Quotation quotation,
                                                 Currencies currencyVal)
        {
            switch (currencyVal)
            {
            case Currencies.Dollar:
            {
                return(purchaseAmount / quotation.Compra);
            }

            case Currencies.Real:
            {
                return(purchaseAmount / quotation.Compra);
            }

            default: return(0);
            }
        }
コード例 #4
0
        //public delegate void delgBindCompany(int companyId);
        //public delgBindCompany BindCompany;
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            IList <Model.QuotationDetail> lstProduct;

            Model.Quotation quotation = gridUtility.GetSelectedItem <Model.Quotation>() as Model.Quotation;
            if (quotation == null)
            {
                return;
            }
            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstProduct = uow.QuotationDetailRepository.Find(quotation);
                uow.Commit();
            }
            if (GetAllProduct != null)
            {
                GetAllProduct(lstProduct, quotation);
            }
            Close();
        }
コード例 #5
0
 public Model.QuotationDetail Find(Model.Quotation quotation, Model.Product product)
 {
     return(Connection.Query <Model.QuotationDetail>("select  * from QuotationDetail where QuotationCode = @quotationCode and ProductId=@productId", param: new { quotationCode = quotation.QuotationCode, productId = product.ProductId }, transaction: Transaction).FirstOrDefault());
 }
コード例 #6
0
        public List <Model.Product> GetAllProduct(Model.Quotation quotation)
        {
            return(Connection.Query <Model.Product>(@"select p.ProductId,ProductCode,Photo,pd.Quantity from Product p
 inner join QuotationDetail pd on p.ProductId = pd.ProductId 
 where pd.QuotationCode = @quotationCode", new { quotationCode = quotation.QuotationCode }, transaction: Transaction).ToList());
        }