예제 #1
0
    public string loadForm(string branchTypeId, string branchId, string status)
    {
        string result = ""; int i = 1;
        string label = "";
        var    user  = Session["cm_userId"].ToString();
        //var color = new string[] { "label label-default", "label label-primary", "label label-success", "label label-danger" };
        var m = db.sp_web_loadImportMaterialApproved(branchTypeId.Trim(), branchId.Trim(), status.Trim(), user);

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

            if (item.StatusId.Value == 1)
            {
                label = "blink label label-warning";
            }
            else if (item.StatusId.Value == 2)
            {
                label = "label label-primary";
            }
            else if (item.StatusId.Value == 3 || item.StatusId.Value == 4)
            {
                label = "label label-danger";
            }
            else if (item.StatusId.Value == 0)
            {
                label = "label label-success";
            }

            result += "<td><span class='" + label + "' id='lbstatus" + item.Id.ToString() + "'>" + item.Status + "</span></td>";
            result += "<td>" + item.ApproName + "</td>";
            result += "<td>" + item.ApprovedAt + "</td>";
            result += "<td>" + item.BranchName + "</td>";
            result += "<td>" + item.CreateAt + "</td>";
            result += "<td>" + item.ImportCode + "</td>";
            result += "<td>" + item.Description + "</td>";
            result += "<td>" + item.FullName + "</td>";
            result += "</tr>";
            i++;
        }
        return(result);
    }