Ejemplo n.º 1
0
    public void LoadReturn()
    {
        Return e = new Return();

        if (ReturnID == 0)
        {
            imgOrder.ImageUrl = "none";
            btnOk.Enabled     = true;
        }
        else
        {
            e = ReturnBLL.Get(ReturnID);
            imgOrder.ImageUrl = BarcodeBLL.Url4Return(e.ID);
            btnOk.Enabled     = false;
        }

        txtNote.Text = e.Note;

        txtDate.Text = e.Date.ToStringVN_Hour();

        PackOrderList = e.PackOrders.Select(r => r.ID).ToList();

        urlPrint.NavigateUrl = ResolveClientUrl(string.Format("~/Store/PrintReturn.aspx?ReturnID={0}", e.ID));

        GridViewPack.DataBind();

        CurrentDIN             = "";
        imgCurrentDIN.ImageUrl = "none";

        GridViewSum.DataBind();
    }
Ejemplo n.º 2
0
    public void LoadReturn()
    {
        Return e = new Return();

        if (ReturnID == 0)
        {
            imgOrder.ImageUrl = "none";
            btnOk.Enabled     = true;
        }
        else
        {
            e = ReturnBLL.Get(ReturnID);
            imgOrder.ImageUrl = BarcodeBLL.Url4Return(e.ID);
            btnOk.Enabled     = false;
        }

        txtNote.Text = e.Note;

        txtDate.Text = e.Date.ToStringVN_Hour();

        PackOrderList = e.PackOrders.Select(r => r.ID).ToList();

        GridViewPack.DataBind();

        CurrentDIN             = "";
        imgCurrentDIN.ImageUrl = "none";
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string strParamID = Request["ReturnID"];

            if (!string.IsNullOrEmpty(strParamID))
            {
                returnObj = ReturnBLL.Get(strParamID.ToInt());

                if (returnObj != null)
                {
                    LabelTitle1.Text = "BIÊN BẢN THU HỒI";

                    LoadReturn();

                    RedBloodDataContext db = new RedBloodDataContext();

                    var v1 = db.PackOrders.Where(r => r.ReturnID.Value == returnObj.ID)
                             .Select(r => r.Pack)
                             .ToList();

                    var v = v1.GroupBy(r => r.ProductCode)
                            .Select(r => new
                    {
                        ProductCode      = r.Key,
                        Sum              = r.Count(),
                        BloodGroupSumary = r.GroupBy(r1 => r1.Donation.BloodGroup).Select(r1 => new
                        {
                            BloodGroupDesc = BloodGroupBLL.GetDescription(r1.Key),
                            Total          = r1.Count(),
                            VolumeSumary   = r1.GroupBy(r2 => r2.Volume).Select(r2 => new
                            {
                                Volume  = r2.Key.HasValue ? r2.Key.Value.ToString() : "_",
                                Total   = r2.Count(),
                                DINList = r2.Select(r3 => new { DIN = r3.DIN }).OrderBy(r4 => r4.DIN),
                            }).OrderBy(r2 => r2.Volume)
                        }).OrderBy(r1 => r1.BloodGroupDesc),
                    });

                    GridViewSum.DataSource = v;
                    GridViewSum.DataBind();

                    LableCount.Text = v1.Count().ToStringRemoveZero();
                }
            }
        }
    }