示例#1
0
    public string loadBill(string branchType, string branchId, string fromdate, string todate)
    {
        string result = "";
        string fDate = "", tDate = "";

        if (fromdate.Trim() != "")
        {
            fDate = cl.returnDatetime(fromdate.Trim());
        }
        if (todate.Trim() != "")
        {
            tDate = cl.returnDatetime(todate.Trim());
        }

        var m = db.sp_web_loadStockInternal(branchType, branchId, fDate, tDate);
        int i = 1; int count = 0;

        foreach (var item in m.ToList())
        {
            result += "<tr class='detail-rows' id='" + item.Id.ToString() + "' title='Click để xem chi tiết'>";
            result += "<td class='center childrows'></td>";
            result += "<td>" + item.BranchCode + "</td>";
            result += "<td>" + item.BranchName + "</td>";
            result += "<td>" + item.ToBranchCode + "</td>";
            result += "<td>" + item.ToBranchName + "</td>";
            result += "<td>" + item.Type + "</td>";
            result += "<td>" + item.CreateAt + "</td>";
            result += "<td>" + item.FullName + "</td>";
            result += "<td>" + item.StockCode + "</td>";
            result += "<td>" + item.CodeId + "</td>";
            result += "<td>" + item.ProductCode + "</td>";
            result += "<td>" + item.ProductName + "</td>";
            result += "<td>" + item.Quantity + "</td>";
            result += "<td>" + item.UnitName + "</td>";
            result += "<td>" + item.Note + "</td>";
            result += "</tr>";
            i++;
            count += item.Quantity.Value;
        }
        lbCount.Text = count == 0 ? "0" : string.Format("{0:0,0}", count);
        return(result);
    }