基于Jquerymobile实现的支持PC、平板、手机移动设备的web应用程序(C#)

摘要:
--/header--˃@*主页*@homeePRSystem***The PR highlightedinpurplemeansyouarelegated to Approve this request***@{if(Model.pRHeaderInfo==null){***NoPRispendingforourapprove***}否则{˂divdata role=“可折叠集”>PRListforApproval@foreach(InfoEntityineinModel.pRHeaderInfo){@**@*@@inen.PR_NO&nbsp公司:@inen.Comp_Code部门:@inen.Dept_Code请求者:@iner.Request

页面部分:

List部分:

@{
    Layout = null;
}
@using ePR.Models;
@using ePR;
@using BusinessObjectLayer.Entities;
@using DataAccessLayer;
@model ePR.Models.pRHeaderListModel

<!DOCTYPE html>

<html>
<head>

 
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="http://t.zoukankan.com/@Url.Content("~/Scripts/jquery.mobile-1.0.1/jquery.mobile-1.0.1.min.css")" rel="stylesheet" type="text/css" />
    
    <script src="http://t.zoukankan.com/@Url.Content("~/Scripts/jquery-1.6.4.min.js")" type="text/javascript"></script>
    <script src="http://t.zoukankan.com/@Url.Content("~/Scripts/jquery.mobile-1.0.1/jquery.mobile-1.0.1.min.js")" type="text/javascript"></script>


</head>
<body>
   
    <div data-role="page">
        <!-- /header -->
        <div data-role="header" data-theme="a">
         @*<a href="http://t.zoukankan.com/Approve/ApproveList?home=yes" data-icon="home" data-theme="a" class="ui-btn-left">Home</a>*@
            <a href="http://t.zoukankan.com/@Url.Action("ApproveList", "Approve", new { home = "home" })" data-icon="home" data-theme="a" data-ajax="false">Home</a>
      <h1>ePR System</h1>
     </div>
        <!--content-->
     <div data-role="content">
     <h6> *** The PR highlighted in purple means you are delegated to approve this request ***</h6>
        @{

            if (Model.pRHeaderInfo == null)
            {
                        <h4> *** No PR is pending for your approval ***</h4>        
            }
            else
            {
           
        
      
                <div data-role="collapsible-set">
                <div data-role="collapsible" data-collapsed="false" data-theme="c" data-content-theme="c">
                    <h6>PR List for Approval</h6>

                       <ul data-role="listview" data-inset="true" IsNumberedList="true">
                       
                        @foreach (InfoEntity inen in Model.pRHeaderInfo)
                        {
                            <li>
                                @*<a id="SelListItem"  href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { prno = @inen.PR_NO })"  >*@
                                <a id="SelListItem"  href="http://t.zoukankan.com/@inen.PRUrl/Approve/Approve?prno=@inen.PR_NO"  >
                               
                                @*<a id="SelListItem"  href="http://t.zoukankan.com/@inen.PRUrl/mobile_web/Overview.aspx?PRNO=@inen.PR_NO"  >*@
                                    <div class="textareaDesc">
                                        <strong>@inen.PR_NO</strong> 
                                        <p>&nbsp</p>
                                        <p>Company: @inen.Comp_Code</p>
                                        <p>Department: @inen.Dept_Code</p>
                                        <p>Requester: @inen.Requester</p>
                                        <p>Remark: @inen.Remark_By_User</p>                                       
                                    </div>
                                </a>
                            </li>
                        }
                       
                       
                            </ul> 
                      
                       
                  </div>
              </div>
            }
           
      }
        </div>

    </div>

</body>
</html>

Detail部分:

@model ePR.Models.MobilepRDetailModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>MobileDetail</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="http://t.zoukankan.com/@Url.Content("~/Scripts/jquery.mobile-1.0.1/jquery.mobile-1.0.1.min.css")" rel="stylesheet" type="text/css" />
    
     <script src="http://t.zoukankan.com/@Url.Content("~/Scripts/jquery-1.6.4.min.js")" type="text/javascript"></script>
     <script src="http://t.zoukankan.com/@Url.Content("~/Scripts/jquery.mobile-1.0.1/jquery.mobile-1.0.1.min.js")" type="text/javascript"></script>
     
     <script src="http://t.zoukankan.com/@Url.Content("~/Scripts/Approve/MobileApprove.js")" type="text/javascript"></script>
</head>
<body>
<div data-role="page">
                <!-- Header -->
                <div data-role="header" data-theme="a">
                 <a href="http://t.zoukankan.com/@Url.Action("ApproveList", "Approve", new { home = "home" })" data-ajax="false" data-icon="home" data-theme="a" class="ui-btn-left">Home</a>
                    <h1>ePR System</h1>
                    <div data-role="navbar">
                        <ul>
                            <li>
                                <a href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { home = "Overview" })" data-ajax="false">Overview</a>
                            </li>
                      <li>
                                <a href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { home = "Detail" })" data-ajax="false">Detail</a>
                            </li>
                            <li>
                                <a href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { home = "Approval" })" data-ajax="false">Approval</a>
                            </li>

                        </ul>
                    </div>
                </div>

                <!--Content-->
                <div data-role="content">
                    <ul data-role="listview">
                        <li data-role="list-divider">
                            <div class="ui-grid-a">
                                <div class="ui-block-a">@Model.selectPRNo</div>
                                <div class="ui-block-b"><div class="shiftLeft">(Login User: @Model.login_user.EnName)</div></div>
                            </div>
                        </li>
                        <li>
                            <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Requester:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.RequesterName</span></div>
                            </div>
                        </li>
                        <li>
                            <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Deliver To:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.DeliverToName</span></div>
                            </div>
                        </li>
                        <li>
                            <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Application Date:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.Add_Date</span></div>
                            </div>
                        </li>
                        <li>
                            <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Payment Company:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.PaymentComp</span></div>
                            </div>
                        </li>
                        <li>
                            <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Payment Department:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.PaymentDept</span></div>
                            </div>
                        </li>
                        <li>
                        <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Procurement Type:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.PRType</span></div>
                            </div>
                        </li>
                        <li>
                        <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Budget ID:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.Budget_ID</span></div>
                            </div>
                        </li>
                        <li>
                        <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Budget Description:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.Budget_Desc</span></div>
                            </div>
                        </li>
                        <li>
                        <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Project No:</strong></div>
                            <div class="ui-block-b"><span class="listContent">@Model.PRInfo.Project_NO</span></div>
                            </div>
                        </li>
                        <li>
                            <div class="ui-grid-a">
                            <div class="ui-block-a"><strong>Attachment list:</strong></div>
                            <div class="ui-block-b"><span class="listContent">
                                    @foreach (BusinessObjectLayer.Entities.UpfileEntity link in Model.Attachment)
                                    {
                                        <lable>@link.FileName</lable>
                                    }</span></div>
                            </div>
                        </li>
                        <li>
                            <div class="textareaDesc">
                                <strong>Remark:</strong><br /><br />
                                <p>@Model.PRInfo.Remark_By_User</p>
                            </div>
                        </li>
                    </ul> 
                </div>

                <!-- Footer -->
                <div data-role="footer">
                    <div data-role="navbar">
                        <ul>
                            <li>
                                <a href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { home = "Overview" })" data-ajax="false">Overview</a>
                            </li>
                      <li>
                                <a href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { home = "Detail" })"  data-ajax="false">Detail</a>
                            </li>
                            <li>
                                <a href="http://t.zoukankan.com/@Url.Action("Approve", "Approve", new { home = "Approval" })" data-ajax="false">Approval</a>
                            </li>
                   
                        </ul>
                    </div>
                </div>
       
                <h6 style="color:Purple">*** Due to the security concerns, the attachment cannot be opened/downloaded in mobile device at this stage ***</h6>
            </div>
</body>
</html>

后台:

 [HttpGet]
        public ActionResult Approve(string prno,string home)
        {

            if (Session["prno"] != null && prno == null) {
                prno = Session["prno"].ToString();
            }
            ViewBag.outputMessage = "";
            string pr_No = prno;
            LoginModel loginModel = new LoginModel();
            loginModel.UserName = Request.ServerVariables.Get("LOGON_USER").ToLower();
            CultureInfo usCulture = Thread.CurrentThread.CurrentUICulture;
            ViewBag.lang = usCulture.Name == "zh-TW" ? "zh-hk" : "en-US";

            bool IsMobileDevice = false;
            IsMobileDevice = Request.Browser.IsMobileDevice;
            //IsMobileDevice = true;//yan
            if (IsMobileDevice)
            {
                ViewBag.lang = "en-US";
            }
            if (!string.IsNullOrEmpty(loginModel.UserName.Trim())&&!string.IsNullOrEmpty(prno))
            {
                Session["prno"] = prno;
                //badge = "80006812";
                //badge = "80027397";
                string user_acc = loginModel.UserName.Split('\')[1].ToString().Trim();
                LoginInfo = LoginInfoService.getLoginInfo(user_acc);
                if ((bool)LoginInfo[0])
                {
                    EmployeeEntity e = (EmployeeEntity)LoginInfo[1];
                    badge = e.badge;
                    if (!UserLoginTypeService.IsUnderMainten())
                    {
                        //if (!Request.Browser.IsMobileDevice)
                        //{
                            if (IApprovePRInfoService.CheckPRNO(prno))
                            {
                                object[][] isApproverOrIsProxy = UserLoginTypeService.IsApproverOrIsProxy(badge);
                                if ((bool)isApproverOrIsProxy[0][0] || IApprovePRInfoService.IsApproval(badge, prno))
                                {
                                    if (!(bool)isApproverOrIsProxy[1][0])
                                    {
                                        object[] authPRApprovePage=IApprovePRInfoService.AuthApprove(prno, badge);
                                        if (authPRApprovePage.Length != 0)
                                        {
                                            if ((bool)authPRApprovePage[0])
                                            {
                                                object[] PRdetail = IApprovePRInfoService.PRDetail(prno);
                                               
                                                DataSet ds = (DataSet)PRdetail[1];
                                                if (ds.Tables.Count!=0)//Convert.ToString(PRdetail[0]) == ""
                                                {
                                                    string selectPRNo = prno;

                                                    InfoEntity PRInfo = IApprovePRInfoService.GetPRHeader(ds, ViewBag.lang, prno);
                                                    pRDetailmodel = pRDetailManager.getPRDetailModel(
                                                        prno,
                                                        e,
                                                        PRInfo,
                                                        IApprovePRInfoService.GetPRItem(ds),
                                                        IApprovePRInfoService.getAttachList(prno, ""),
                                                        IApprovePRInfoService.getAppProgress(prno, ViewBag.lang),
                                                        IApprovePRInfoService.getProxy(prno, badge),
                                                        Manager.outputMessageService.outputProjectDetail((IApprovePRInfoService.ProjectDetail(PRInfo.Project_NO, badge))),
                                                        Manager.outputMessageService.outputViewBudget(IApprovePRInfoService.ViewBudget(PRInfo.Budget_ID, badge))
                                                        );
                                                    ViewBag.EstimateFlage = pRDetailmodel.PRInfo.EstimateFlage;
                                                    ViewBag.ShowProdSanSale = ApprovePRInfoService.ShowProdSanSale(PRInfo.Comp_Code);
                                                    //ViewBag.ShowProdSanSale = "OnlyENQ";
                                                    ViewBag.AllowSelectAll = pRDetailmodel.login_user.@class == "T" ? true : false;//SMT

                                                    Session["PRDetail"] = pRDetailmodel;//TEST
                                                }
                                                else
                                                    //ViewBag.outputMessage = PRdetail[0];
                                                    ViewBag.outputMessage = (string)PRdetail[0] == "" ? (ViewBag.lang == "en-US" ? "This PRNO does not exist" : "此請購單号不存在") : (string)PRdetail[0];

                                                    if (!IsMobileDevice)
                                                    {

                                                        return View(pRDetailmodel);//T
                                                    }
                                                    else
                                                    {
                                                        mobilepRDetail = MobilepRDetailModel.getMobilepRDetail(mobilepRDetail, pRDetailmodel);

                                                        if (home == "Detail")
                                                        {
                                                            return View("MobileDetail", mobilepRDetail);
                                                        }
                                                        if (home == "Approval")
                                                        {
                                                            return View("MobileApprove", mobilepRDetail);
                                                        }
                                                        if (home == "page")
                                                        {
                                                            return View("MobilePage", mobilepRDetail);
                                                        }
                                                        else
                                                        {

                                                            return View("MobileOverView", mobilepRDetail);
                                                        }
                                                    }
                                             
                                            }
                                            else
                                            {
                                                pRDetailmodel = new Models.pRDetailModel(SubmitApprovePRService.returnePRServiceMsg((string)authPRApprovePage[1], ViewBag.lang));
                                                pRDetailmodel.login_user = e;
                                                ViewBag.outputMessage = pRDetailmodel.outputMessage;
                                                if (!IsMobileDevice)
                                                {
                                                    return View(pRDetailmodel);//T
                                                }
                                                else
                                                {
                                                    mobilepRDetail = MobilepRDetailModel.getMobilepRDetail(mobilepRDetail, pRDetailmodel);
                                                    if (home == "Detail")
                                                    {
                                                        return View("MobileDetail", mobilepRDetail);
                                                    }
                                                    if (home == "Approval")
                                                    {
                                                        return View("MobileApprove", mobilepRDetail);
                                                    }
                                                    if(home=="page")
                                                    {
                                                        return View("MobilePage", mobilepRDetail);
                                                    }
                                                    else
                                                    {
                                                        return View("MobileOverView", mobilepRDetail);
                                                      
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            outputMessageService = new outputAuthApprovePRMessage();
                                            pRDetailmodel = new Models.pRDetailModel(outputMessageService.outputMessage());
                                            pRDetailmodel.login_user = e;
                                            ViewBag.outputMessage = pRDetailmodel.outputMessage;

                                            if (!IsMobileDevice)
                                            {
                                                return View(pRDetailmodel);//T
                                            }
                                            else
                                            {
                                                mobilepRDetail = MobilepRDetailModel.getMobilepRDetail(mobilepRDetail, pRDetailmodel);
                                                return View("MobileErrorPage", mobilepRDetail);
                                            }
                                        }
                                       

                                    }
                                    else
                                    {
                                        outputMessageService = new outputIsProxyMessage();
                                        pRDetailmodel = new Models.pRDetailModel(outputMessageService.outputMessage());
                                        ViewBag.Title = pRDetailmodel.outputMessage;
                                        if (!IsMobileDevice)
                                            return View("~/Views/GeneralUser/RightFailed.cshtml");
                                        return View("~/Views/Approve/MobileErrorPage.cshtml");
                                    }
                                }
                                else
                                {
                                    outputMessageService = new outputIsApproverMessage();
                                    pRDetailmodel = new Models.pRDetailModel(outputMessageService.outputMessage());
                                    ViewBag.Title = pRDetailmodel.outputMessage;
                                    if (!IsMobileDevice)
                                        return View("~/Views/GeneralUser/RightFailed.cshtml");
                                    return View("~/Views/Approve/MobileErrorPage.cshtml");
                                }
                            }
                            else {
                                outputMessageService = new outputCheckPRNoMessage();
                                pRDetailmodel = new Models.pRDetailModel(outputMessageService.outputMessage());
                                ViewBag.Title = pRDetailmodel.outputMessage;
                                if (!IsMobileDevice)
                                    return View("~/Views/GeneralUser/RightFailed.cshtml");
                                return View("~/Views/Approve/MobileErrorPage.cshtml");
                            }
                        //}
                        //else
                        //{
                        //    outputMessageService = new outputIsMobileDeviceMessage();
                        //    pRDetailmodel = new Models.pRDetailModel(outputMessageService.outputMessage());
                        //    ViewBag.Title = pRDetailmodel.outputMessage;
                        //    return View("~/Views/GeneralUser/RightFailed.cshtml");
                        //}
                    }
                    else
                    {
                        outputMessageService = new outputUnderMaintenMessage();
                        pRDetailmodel = new Models.pRDetailModel(outputMessageService.outputMessage());
                        ViewBag.Title = pRDetailmodel.outputMessage;
                        if (!IsMobileDevice)
                            return View("~/Views/GeneralUser/RightFailed.cshtml");
                        return View("~/Views/Approve/MobileErrorPage.cshtml");
                    }
                }
                else
                {
                    ViewBag.Title = "Approval authority failed";
                    if (!IsMobileDevice)
                        return View("~/Views/GeneralUser/RightFailed.cshtml");
                    return View("~/Views/Approve/MobileErrorPage.cshtml");

                }
            }
            else
            {
                ViewBag.Title = "_Layout";
                if (!IsMobileDevice)
                    return View("~/Views/Default/Default.cshtml");
                return View("~/Views/Approve/MobileDefault.cshtml");
                //return View("~/Views/Shared/_Layout.cshtml");
            }
        }

免责声明:文章转载自《基于Jquerymobile实现的支持PC、平板、手机移动设备的web应用程序(C#)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇【实验】手工负载分担链路聚合xinetd网络(2) 协议头解析下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

SpringBoot项目中@Async方法没有执行的问题分析

现象:1.明显的现象:在日志文件中找不到方法中的日志输出,并且没有错误报告(即,未执行@Async标记的方法,也没有错误报告)。2.分析现象:日志中某段时间后没有任务xxx线程的日志原因:@Async异步方法默认使用Spring创建ThreadPoolTaskExecutor(参考TaskExecutionAutoConfiguration),其中默认核心线...

[转载]su认证失败

我认为桌面用户拥有更高的安全性是合适的;但是,可以将服务器设置为允许“su”作为root用户,但不允许root用户直接登录。问题如下:1me@ubuntu:~$su2Password:˂---在安装过程中输入root用户的密码。3su:身份验证失败允许su root。这很简单。您只需要重置密码。...

微信小程序中使用Vant Weapp的ActionSheet上拉菜单出现的样式问题

以下修改的源码均在action-sheet组件中。在index.wxss:2.下方的取消按钮不居中,通过审查元素发现它的宽带已经超出了手机屏幕的宽度,出现的滚动条导致的,具体什么原因导致暂时不知,解决方案是给.van-action-sheet__cancel添加样式box-sizing:border-box可解决。在index.wxss:.van-actio...

从Excel中导入数据时,提示“未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序”的解决办法

具体下载地址:HTTP://www.microsoft.com/downloads/details.aspxFAMILYID=c06b8369-60dd-4b64-A44B-84b371ede16d&displayLang=ZH-CN对于一些早期用户,如果连接字符串中使用的是“Microsoft.Jet.OLEDB.4.0”,由于喷气项目已经停止,该项目不再...

MySQL学习笔记:字符串前后补全0

遇到一个要求:如果位数小于6,则需要使用函数LPAD()和RPAD()自动完成6位。LPAD使用字符串padstr填充并完成左侧的str,直到其长度达到len个字符,并返回str。...