private List <EndProduct> GetEndProductList() { EndProductDAL dal = new EndProductDAL(); var result = dal.SearchEndProduct(Utility.GetSelectedText(ddlCatelog), Utility.GetSelectedText(ddlSubCatelog), txtCode.Text, txtName.Text, Utility.GetSelectedText(ddlSupplier), Utility.GetSelectedText(ddlLocation), !string.IsNullOrEmpty(txtLongFinishProduct.Text) ? int.Parse(txtLongFinishProduct.Text) : -1, !string.IsNullOrEmpty(txtWidthFinishProduct.Text) ? int.Parse(txtWidthFinishProduct.Text) : -1, !string.IsNullOrEmpty(txtDeepFinishProduct.Text) ? int.Parse(txtDeepFinishProduct.Text) : -1, !string.IsNullOrEmpty(txtPrice.Text) ? double.Parse(txtPrice.Text) : -1); return(result); }
protected void rpProductList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Footer) { EndProductDAL dal = new EndProductDAL(); var result = dal.SearchEndProduct(Utility.GetSelectedText(ddlCatelog), Utility.GetSelectedText(ddlSubCatelog), txtCode.Text, txtName.Text, Utility.GetSelectedText(ddlSupplier), Utility.GetSelectedText(ddlLocation), !string.IsNullOrEmpty(txtLongFinishProduct.Text) ? int.Parse(txtLongFinishProduct.Text) : -1, !string.IsNullOrEmpty(txtWidthFinishProduct.Text) ? int.Parse(txtWidthFinishProduct.Text) : -1, !string.IsNullOrEmpty(txtDeepFinishProduct.Text) ? int.Parse(txtDeepFinishProduct.Text) : -1, !string.IsNullOrEmpty(txtPrice.Text) ? double.Parse(txtPrice.Text) : -1); double qty = result.Sum(r => r.Qty).Value; double amount = result.Sum(r => r.Qty * r.Price).Value; var lblTotalQuantity = e.Item.FindControl("lblTotalQuantity") as Label; var lblTotalAmount = e.Item.FindControl("lblTotalAmount") as Label; lblTotalQuantity.Text = Utility.Round(qty).ToString(); lblTotalAmount.Text = Utility.Round(amount).ToString(); } }