Example #1
0
        private void LoadProductDetailDeadline()
        {
            var orderDetail = _OrderDetailRepo.GetByOrderId(id);

            ddlProductDetailDeadline.Items.Clear();
            for (int i = 0; i < orderDetail.Count; i++)
            {
                int    ProductDetailId     = Utils.CIntDef(orderDetail[i].PRODUCT_DETAIL_ID);
                int    ProductDetailSizeId = Utils.CIntDef(orderDetail[i].PRODUCT_DETAIL_SIZE_ID);
                string name = "";
                name = getProductDetailNameSize(ProductDetailId, ProductDetailSizeId);
                ddlProductDetailDeadline.Items.Add(new ListItem(name, Utils.CStrDef(orderDetail[i].ID)));
            }
            ddlProductDetailDeadline.Items.Insert(0, new ListItem("--Chọn Sản Phẩm Chi Tiết--", "0"));
        }
 private void LoadOrder_Material()
 {
     try
     {
         int OrderId = Utils.CIntDef(ddlOrder.SelectedValue);
         List <OrderMaterial> list = new List <OrderMaterial>();
         var listOrderDetail       = _OrderDetailRepo.GetByOrderId(OrderId);
         foreach (var item in listOrderDetail)
         {
             if (Utils.CIntDef(item.PRODUCT_DETAIL_SIZE_ID) == -1)
             {
                 var listProductDetail_Material = _ProductDetailMaterialRepo.GetByProductDetailId(Utils.CIntDef(item.PRODUCT_DETAIL_ID));
                 foreach (var item2 in listProductDetail_Material)
                 {
                     var orderMaterial = list.Find(n => n.MATERIAL_ID == item2.MATERIAL_ID);
                     if (orderMaterial != null)
                     {
                         decimal quantity = Utils.CDecDef(item.QUANTITY) * Utils.CDecDef(item2.QUANTITY);
                         orderMaterial.QUANTITY = orderMaterial.QUANTITY + quantity;
                     }
                     else
                     {
                         orderMaterial             = new OrderMaterial();
                         orderMaterial.MATERIAL_ID = Utils.CIntDef(item2.MATERIAL_ID);
                         orderMaterial.QUANTITY    = Utils.CDecDef(item.QUANTITY) * Utils.CDecDef(item2.QUANTITY);
                         list.Add(orderMaterial);
                     }
                 }
             }
             else
             {
                 var listProductDetail_Material = _ProductDetailMaterialRepo.GetByProductDetailId(Utils.CIntDef(item.PRODUCT_DETAIL_ID), Utils.CIntDef(item.PRODUCT_DETAIL_SIZE_ID));
                 foreach (var item2 in listProductDetail_Material)
                 {
                     var orderMaterial = list.Find(n => n.MATERIAL_ID == item2.MATERIAL_ID);
                     if (orderMaterial != null)
                     {
                         decimal quantity = Utils.CDecDef(item.QUANTITY) * Utils.CDecDef(item2.QUANTITY);
                         orderMaterial.QUANTITY = orderMaterial.QUANTITY + quantity;
                     }
                     else
                     {
                         orderMaterial             = new OrderMaterial();
                         orderMaterial.MATERIAL_ID = Utils.CIntDef(item2.MATERIAL_ID);
                         orderMaterial.QUANTITY    = Utils.CDecDef(item.QUANTITY) * Utils.CDecDef(item2.QUANTITY);
                         list.Add(orderMaterial);
                     }
                 }
             }
         }
         HttpContext.Current.Session["listOrderMaterial"] = list;
         ASPxGridView1_Order_Material.DataSource          = list;
         ASPxGridView1_Order_Material.DataBind();
     }
     catch //(Exception)
     {
         //throw;
     }
 }
Example #3
0
 private void LoadOrder_ProductDetail()
 {
     try
     {
         int OrderId           = Utils.CIntDef(ddlOrder.SelectedValue);
         var listProductDetail = _OrderDetailRepo.GetByOrderId(OrderId);
         HttpContext.Current.Session["listOrderProductDetail"] = listProductDetail;
         ASPxGridView1_Order_ProductDetail.DataSource          = listProductDetail;
         ASPxGridView1_Order_ProductDetail.DataBind();
     }
     catch //(Exception)
     {
         //throw;
     }
 }