示例#1
0
    public string loadInventory(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_ReportInventory(branchType, branchId, DateTime.Parse(fDate), DateTime.Parse(tDate));
        int i = 1;

        foreach (var item in m.ToList())
        {
            result += "<tr class='detail-rows' id='" + item.ProductId.ToString() + "' title='Click để xem chi tiết'>";
            result += "<td class='center'>" + i.ToString() + "</td>";
            result += "<td>" + item.BranchCode + "</td>";
            result += "<td>" + item.BranchName + "</td>";
            result += "<td>" + item.ProductId + "</td>";
            result += "<td>" + item.ProductCode + "</td>";
            result += "<td>" + item.ProductName + "</td>";
            result += "<td class='center'>" + item.Pre + "</td>";
            result += "<td class='center'>" + item.QuantityInput + "</td>";
            result += "<td class='center'>" + item.QuantityOutput + "</td>";
            result += "<td class='center'>" + item.Total + "</td>";
            result += "</tr>";
            i++;
        }
        return(result);
    }