Esempio n. 1
0
    public string loadForm(string userId, string status)
    {
        string result = ""; int i = 1;
        string label = "";
        var    m     = db.sp_web_loadKCS(userId, status);

        int edit = 0, complete = 0;

        foreach (var item in m.ToList())
        {
            if (item.ApprovedStatus == 1)//chua ai nhan kiem thi
            {
                complete = 1;
            }
            else
            {
                complete = 0;
            }

            if (item.ApprovedStatus == 4)//neu phai sua lai thi moi hoan thanh mau
            {
                edit = 1;
            }
            else
            {
                edit = 0;
            }

            result += "<tr data-toggle='modal' data-target='#addDept' class='detail-rows' onclick='update_modal(\"" + item.FormId.ToString() + "\",\"" + item.Code + "\",\"" + item.Name + "\",\"" + item.Month + "\",\"" + item.ColorName + "\",\"" + item.Description + "\",\"" + item.FullName + "\"," + complete + ",\"" + edit + "\");' id='delete" + item.FormId.ToString() + "' title='Click để xem chi tiết'>";
            result += "<td class='center'>" + i.ToString() + "</td>";

            if (item.ApprovedStatus == 1)
            {
                label = "blink label label-success";
            }
            else if (item.ApprovedStatus == 2)
            {
                label = "label label-primary";
            }
            else if (item.ApprovedStatus == 3)
            {
                label = "label label-warning";
            }
            else if (item.ApprovedStatus == 4)
            {
                label = "label label-8";
            }

            result += "<td><label class='" + label + "'>" + item.Status + "</label></td>";
            result += "<td>" + item.KCSName + "</td>";
            result += "<td>" + item.CompleteDate + "</td>";
            result += "<td>" + item.SewingName + "</td>";
            result += "<td>" + item.FullName + "</td>";
            result += "<td>" + item.Code + "</td>";
            result += "<td>" + item.Name + "</td>";
            result += "<td>" + item.Month + "</td>";
            result += "<td>" + item.ColorName + "</td>";
            result += "<td>" + item.Description + "</td>";
            result += "<td>" + item.CreateAt + "</td>";
            result += "<td>" + item.ApproveNote + "</td>";
            result += "</tr>";
            i++;
        }
        return(result);
    }