• 手持设备开发项目实例二(盘点扫描系统)


    前一篇介绍手持设备开发基本步骤。在CE客户端,我们通常用vs2008 c#客户端,

    后端有用socket调用存储过程,也有通过http请求的,前篇也有介绍了。一个请求

    HttpUtil 类。这回合来看看。服务端如果来实现。

    LoginController

    using System;
    using System.Web;
    using System.Web.Mvc;
    using System.Web.Security;

    using Basic.Enum;
    using Basic.Utility;
    using Sys.Services;
    using Basic.ModelBinders;
    using Basic.DomainModel; 

    namespace PDA.Controllers
    {
    public class LoginController : Controller
    {
    public ActionResult LoginOut()
    {
    HttpCookie cookie = Response.Cookies[FormsAuthentication.FormsCookieName];
    cookie.Value = null;
    cookie.Domain = Globals.RootDomain;
    cookie.Expires = new DateTime(1980, 10, 12);
    FormsAuthentication.SignOut();
    return null;
    }

    public ActionResult Menu()
    {
    return View();
    }

    [HttpPost]
    public int LoginPDA()
    {
    string userName = Request.Params["userName"];
    string password = Request.Params["password"];
    ISys_UserService service = UnityHelper.GetInstance<ISys_UserService>;
    int result = service.UserLogin(userName, password);
    return result;
    }

    }
    }

    来张图片):

    using System.Collections.Generic;

    using System.Web.Mvc;
    using Basic.Enum;
    using Basic.Utility;
    using PDA.DomainModel;
    using PDA.Services;

    namespace PDA.Controllers
    {
    public class StockController : Controller
    {
    private static readonly IStockService service = UnityHelper.GetInstance<IStoreService>;

    [HttpPost]
    public JsonResult GetAddre(string addrecode)
    {
    IList<Stock_AddreModel> model = service.GetAddre(addrecode);
    return Json(model);
    }

    [HttpPost]
    public JsonResult GetAllAddre()
    {
    IList<Stock_AddreModel> ilist = service.GetAllAddre();
    return Json(ilist);

    [HttpPost]
    public JsonResult GetPo(string pocode)
    {
    IList<Wms_Po_OrderModel> model = service.GetPo(pocode);
    return Json(model);
    }

    [HttpPost]
    public JsonResult GetAllPo()
    {
    IList<Wms_Po_OrderModel> ilist = service.GetAllPo();
    return Json(ilist);

    }
    }

  • 相关阅读:
    C51中的 xbyte的使用
    使用正则表达式替换日期格式
    C#制作windows窗体的图书管理系统
    《短码之美》读书笔记3
    VS2019创建第一个ASP.NET网站
    观影大数据分析(上)
    Git提交文件报错解决
    软件设计简单工厂模式
    记录一次MySQL启动异常的解决
    将本机web项目映射到公网访问
  • 原文地址:https://www.cnblogs.com/meslog/p/5074083.html
Copyright © 2020-2023  润新知