Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Convert.ToString(Request.QueryString["Id"])))
        {
            CFileManagerDataContext db = new CFileManagerDataContext();
            string html = "";
            var    p    = from x in db.tStockInputs from y in db.tBranches from z in db.tBranchTypes
                          where x.BranchId == y.Id && x.BranchTypeId == z.Id && x.Id == int.Parse(Request.QueryString["Id"]) &&
                          x.InputType == 1
                          select new { x.StockInputCode, x.CreateAt, y.BranchName, BranchType = z.Code };

            lbBranch.Text     = p.FirstOrDefault().BranchName;
            lbBranchType.Text = p.FirstOrDefault().BranchType;
            lbDate.Text       = "Ngày " + p.FirstOrDefault().CreateAt.Value.ToString("dd/MM/yyyy HH:mm");
            lbStockCode.Text  = "Số phiếu: " + p.FirstOrDefault().StockInputCode.ToString().ToUpper();
            var d = db.sp_web_getStockInputDetail(Request.QueryString["Id"]);
            int i = 1; int count = 0;
            foreach (var item in d.ToList())
            {
                html += "<tr style='font-size:14px;'>";
                html += "<td class='border center'>" + i.ToString() + "</td>";
                html += "<td class='border pl'>" + item.CodeId + " | " + item.ProductCode + "</td>";
                html += "<td class='border pl'>" + item.ProductName + "</td>";
                html += "<td class='border center'>Chiếc</td>";
                html += "<td class='border center'>" + item.Quantity.ToString() + "</td>";
                html += "<td class='border center'></td>";
                html += "<td class='border pl'></td>";
                html += "</tr>";
                i++;
                count += item.Quantity;
            }
            lbCount.Text = count == 0 ? "0" : string.Format("{0:0,0}", count);
            lbItem.Text  = html;
        }
    }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CFileManagerDataContext db = new CFileManagerDataContext();
         db.sp_sendmail_job();
     }
 }
Пример #3
0
    void loadMenu()
    {
        CFileManagerDataContext db = new CFileManagerDataContext();
        string result = "", html = "";

        html = "<div class='panel-group' id='accordion'>";

        string groupId = HttpContext.Current.Session["cm_groupId"].ToString();
        var    mn      = db.sp_web_RoleMenu(groupId).ToList();
        var    parent  = mn.Where(x => x.ParentId == null).ToList();
        int    ok      = 0;
        int    colspan = 0;

        foreach (var item in parent)
        {
            html += "<div class='panel panel-default' style='border-radius: 0px; margin-bottom: -7px;'>";
            html += "<div class='panel-heading'><h4 class='panel-title'>";
            html += "<a data-toggle='collapse' data-parent='#accordion' href='#collapse" + colspan.ToString() + "'><i class='" + item.Icon + "'>";
            html += "</i> ";
            if (item.Link == "/home" || item.Link == "/logout")
            {
                html += "<a href='" + item.Link + "'>" + item.ModuleName + "</a></a></h4></div>";
            }
            else
            {
                html += item.ModuleName + "</a></h4></div>";
            }

            var child = mn.Where(x => x.ParentId == item.Id).ToList();

            ok = 0;
            foreach (var c in child)
            {
                if (ok == 0)
                {
                    html += "<div id='collapse" + colspan.ToString() + "' class='panel-collapse collapse'>";
                    html += "<div class='panel-body' style='padding: 0px;'>";
                    html += "<ul class='list-group' style='margin-bottom: 0px;'>";
                }
                html += "<li class='list-group-item'><a href='" + (c.sView.Value == 1 ? c.Link : "#") + "' class=''><i class='" + c.Icon + "'></i> " + c.ModuleName + "</a></li>";

                ok++;
            }
            if (ok > 0)
            {
                html += "</ul></div></div>";
            }

            html += "</div>";
            colspan++;
        }

        html       += "</div>";
        result      = html;
        mbMenu.Text = result;
    }
Пример #4
0
    public static List <result> getParent()
    {
        var l = new List <result>();
        CFileManagerDataContext db = new CFileManagerDataContext();
        var m = from x in db.tRoles
                where x.ParentId == null
                orderby x.Position, x.Sort
            select new { x.Id, x.ModuleCode, x.ModuleName };

        foreach (var item in m.ToList())
        {
            var t = new result();
            t._id      = item.Id.ToString();
            t._content = item.ModuleName;
            l.Add(t);
        }
        return(l);
    }