示例#1
0
    public string loadForm(int status, int user)
    {
        string result = ""; int i = 1;
        string label   = "";
        var    user_id = Session["cm_userId"].ToString();

        var m = db.sp_web_loadFormApproved(status, user, int.Parse(user_id), 1);

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

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

            result += "<td><label class='" + label + "'>" + item.Status + "</label></td>";
            result += "<td>" + item.FullName + "</td>";
            result += "<td>" + item.ProductTypeName + "</td>";
            result += "<td>" + item.Code + "</td>";
            result += "<td>" + item.Name + "</td>";
            result += "<td>" + item.Month + "</td>";
            result += "<td>" + item.Description + "</td>";
            result += "<td>" + item.CreateAt.Value.ToString("dd/MM/yyyy HH:mm:ss") + "</td>";
            result += "<td>" + item.ApproName + "</td>";
            result += "<td>" + item.ApprovedAt + "</td>";
            result += "<td>" + item.ApprovedNote + "</td>";
            result += "</tr>";
            i++;
        }
        return(result);
    }