Beispiel #1
0
    public string loadOrder(string branchType, string fromdate, string todate)
    {
        string result = ""; int i = 1;

        string fDate = "", tDate = "";

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

        if (fDate == "" || tDate == "")
        {
            fDate            = ""; tDate = "";
            txtFromDate.Text = "";
            txtToDate.Text   = "";
        }
        if (fDate != "" && tDate != "")
        {
            var m = db.sp_web_loadOrder(branchType, DateTime.Parse(fDate), DateTime.Parse(tDate));

            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.BranchName + "</td>";
                result += "<td>" + item.CreateAt + "</td>";
                result += "<td>" + item.OrderCode + "</td>";
                result += "<td>" + item.CustomerName + "</td>";
                result += "<td>" + item.Phone + "</td>";
                result += "<td>" + item.Email + "</td>";
                result += "<td>" + item.Address + "</td>";
                result += "<td>" + item.Note + "</td>";
                result += "<td>" + item.Status + "</td>";
                result += "</tr>";
                i++;
            }
        }
        return(result);
    }