コード例 #1
0
        public ActionResult Index()
        {
            List <base_wh_warehouse> depotlist = CommService.GetDepotList();

            ViewData["depotlist"] = depotlist;
            return(View());
        }
コード例 #2
0
        public ActionResult AddPSKU(string PSKU, string SSKU, string GSKU, string shopid)
        {
            ComResult com = new ComResult();

            try
            {
                if (!Regex.IsMatch(shopid, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(shopid))
                {
                    com.Msg   = "只能是数字且不能为空";
                    com.State = 0;
                    return(Json(com));
                }
                var isok = CommService.AddPSKU(PSKU, SSKU, GSKU, Convert.ToInt32(shopid));
                if (isok)
                {
                    com.State = 1;
                    com.Msg   = "添加成功";
                }
                else
                {
                    com.State = 0;
                    com.Msg   = "添加失败";
                }
                return(Json(com));
            }
            catch (Exception ex)
            {
                com.State = 0;
                com.Msg   = "添加失败,原因:" + ex.ToString();
                return(Json(com));
            }
        }
コード例 #3
0
        public ActionResult AssociateExpressCode()
        {
            List <base_exp_comp> expresslist = CommService.GetExpress();

            ViewData["Expresslist"] = expresslist;
            return(View());
        }
コード例 #4
0
        public ActionResult ExportSelectExpress()
        {
            List <base_exp_comp> expresslist = CommService.GetExpress();

            ViewData["Expresslist"] = expresslist;
            return(View());
        }
コード例 #5
0
        public ActionResult Index()
        {
            List <base_platform> platformlist = CommService.GetPlatformList();

            ViewData["platformlist"] = platformlist;
            return(View());
        }
コード例 #6
0
 /// <summary>
 /// 过滤不插入的SKU
 /// </summary>
 /// <param name="shopid"></param>
 /// <param name="table"></param>
 /// <returns></returns>
 public DataTable HasGSKU(int shopid, DataTable table)
 {
     try
     {
         List <GSKU>   GSKUlist = CommService.GetGSKUListByshopID(shopid);
         GSKU[]        str      = GSKUlist.ToArray();
         List <string> skulist  = new List <string>(); //取出所有的需要过滤的SKU GetCSVcolByshopID
         foreach (var item in str)
         {
             skulist.Add(item.gsku);
         }
         string csvcol = CommService.GetCSVcolByshopID(shopid);//取出每个店铺SKU存储列
         //csvcol.Replace("\"","");
         for (int i = 0; i < table.Rows.Count; i++)
         {
             if (skulist.Contains(table.Rows[i][csvcol].ToString()))
             {
                 table.Rows.Remove(table.Rows[i]);
             }
         }
         return(table);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #7
0
        public ActionResult DeletePSKU(string id)   //AddPSKU
        {
            ComResult com = new ComResult();

            try
            {
                var isok = CommService.DeletePSKU(Convert.ToInt32(id));
                if (isok)
                {
                    com.State = 1;
                    com.Msg   = "删除成功";
                }
                else
                {
                    com.State = 0;
                    com.Msg   = "删除失败";
                }
                return(Json(com));
            }
            catch (Exception ex)
            {
                com.State = 0;
                com.Msg   = "删除失败,原因:" + ex.ToString();
                return(Json(com));
            }
        }
コード例 #8
0
        public Client(ThreadStart rcvThreadProc)
        {
            comm     = new CommService <Client>();
            endPoint = CommService <Client> .makeEndPoint("http://localhost", 4038);

            comm.rcvr.CreateRecvChannel(endPoint);
            comm.rcvr.StartRcvThead(rcvThreadProc);
        }
コード例 #9
0
        // GET: ExportCSV
        public ActionResult Index()
        {
            List <base_shop>     shoplist    = CommService.GetShopList();
            List <base_exp_comp> expresslist = CommService.GetExpress();

            ViewData["Expresslist"] = expresslist;
            ViewData["shoplist"]    = shoplist;
            return(View());
        }
コード例 #10
0
        public TestHarness()
        {
            Console.Title = "TestHareness Server";
            streamproxy   = CreateClientFileServiceChannel("http://localhost:8000/StreamService");
            comm          = new CommService <TestHarness>();
            endPoint      = CommService <TestHarness> .makeEndPoint("http://localhost", 4040);

            comm.rcvr.CreateRecvChannel(endPoint);
            comm.rcvr.StartRcvThead(rcvThreadProc);
        }
コード例 #11
0
 public ActionResult GetPlatForms()
 {
     try
     {
         var platlist = CommService.GetPlatformList();
         return(Json(platlist));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #12
0
 public ActionResult GetExpress()
 {
     try
     {
         var proclylist = CommService.GetExpress();
         return(Json(proclylist));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #13
0
        /// <summary>
        /// lấy giá api theo thời gian và hạng phòng
        /// </summary>
        /// <param name="datetime"></param>
        /// <param name="roomtypeid"></param>
        /// <returns></returns>
        public JsonResult GetPriceByDateInAndRoomType(string datetime, int roomtypeid)
        {
            tbl_RoomPriceLevel      result = new CommService().GetPrice(roomtypeid, CommService.ConvertStringToDate(datetime));
            tbl_RoomPriceLevel_Hour hours  = null;

            if (result != null)
            {
                hours = new CommService().GetPriceHour(result.Id).FirstOrDefault();
            }

            return(Json(new { result = result, hours = hours }, JsonRequestBehavior.AllowGet));
        }
コード例 #14
0
 public ActionResult GetProductClasfly()
 {
     try
     {
         var proclylist = CommService.GetProclsflyList();
         return(Json(proclylist));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #15
0
        /// <summary>
        /// lấy giá theo thời gian và id phòng
        /// </summary>
        /// <param name="datetime"></param>
        /// <param name="roomid"></param>
        /// <returns></returns>
        public JsonResult GetPriceByDateInAndRoom(string datetime, int roomid)
        {
            tbl_Room_Type o = new CommService().GetRoomTypeByRoomID(roomid);

            if (o == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(GetPriceByDateInAndRoomType(datetime, o.Id));
            }
        }
コード例 #16
0
        Client client;                                                                                     //for msg communication
        public MainWindow()
        {
            InitializeComponent();
            //----------as a host, listen to channel to receive test result msg ---------
            Console.Title = "client 2 demo";
            client        = new Client(rcvThreadProc);

            //--------as a client, sending test request msg-------------------------
            for (int i = 0; i < 10; i++)
            {
                client.MakeMessage("Yaodong", "testrequest", client.endPoint,
                                   CommService <Client> .makeEndPoint("http://localhost", 4040));
                client.comm.sndr.PostMessage(client.requestMsg);// put into sndBlockingQ, if there is any msg in the queue, a thread will deal with it.
                Thread.Sleep(400);
            }
        }
コード例 #17
0
 public ActionResult GetShops(string platformID)
 {
     try
     {
         if (string.IsNullOrEmpty(platformID))
         {
             throw new Exception("店铺ID错误");
         }
         var shoplist = CommService.GetShopList(platformID);
         return(Json(shoplist));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #18
0
        public JsonResult ThemPhieuBuDinhMuc(int storeid, List <BukhoModel> products)
        {
            {
                var tblorder = new tbl_TransferOrder
                {
                    SysHotelID  = CommService.GetHotelId(),
                    CreatorID   = CommService.GetUserId(),
                    DateCreated = DateTime.Now,
                    Status      = 1,
                    SupplierID  = 0,
                    OrderCode   = service.GetTransferCode(),
                    //  SupplierCode = order.SoChungTu,
                    InputDate = DateTime.Today,
                };
                List <tbl_TransferOrderDetail> listDetail = new List <tbl_TransferOrderDetail>();

                var product = service.GetallProducts();
                var cate    = service.GetAllCategories();
                foreach (var item in products)
                {
                    var p1 = product.FirstOrDefault(p => p.Id == item.ProductId);
                    var c  = cate.FirstOrDefault(p => p.Id == p1?.ProductCateID);
                    listDetail.Add(new tbl_TransferOrderDetail
                    {
                        SysHotelID    = CommService.GetHotelId(),
                        item          = p1 != null ? p1.Name : "",
                        catalogitemid = p1?.ProductCateID,
                        catalogitem   = c != null ? c.Name : "",
                        DateCreated   = DateTime.Now,
                        CreatorID     = CommService.GetUserId(),
                        quantity      = item.Quantity,
                        itemid        = item.ProductId,
                        StoreID       = item.StoreId,
                        FromStoreId   = storeid,
                        Price         = Convert.ToInt32(p1?.PriceOrder),
                    });
                }
                var msg = "";
                var rs  = service.StoreTransfer(tblorder, listDetail);
                if (string.IsNullOrEmpty(msg))
                {
                    msg = "Tạo phiếu lỗi";
                }
                return(Json(new { ResponseCode = (rs ? "01" : "00"), Message = (rs ? "Tạo phiếu thành công" : msg) }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #19
0
        public JsonResult ThemPhieuXuat(Order order, List <OrderDetail> orderdetails)
        {
            var tblorder = new tbl_PurchaseOrder
            {
                SysHotelID   = CommService.GetHotelId(),
                CreatorID    = CommService.GetUserId(),
                DateCreated  = DateTime.Now,
                Status       = 1,
                SupplierID   = 0,
                OrderCode    = order.SoPhieu,
                SupplierCode = order.SoChungTu,
                InputDate    = Share.Todate(order.NgayNhapHD),
                DatePayment  = Share.Todate(order.NgayChungTu),
                TypeOrder    = 2
            };
            List <tbl_PurchaseOrderDetail> listDetail = new List <tbl_PurchaseOrderDetail>();

            foreach (var item in orderdetails)
            {
                listDetail.Add(new tbl_PurchaseOrderDetail
                {
                    SysHotelID      = CommService.GetHotelId(),
                    item            = item.ProductName,
                    catalogitemid   = item.CateId,
                    catalogitem     = item.CateName,
                    DateCreated     = DateTime.Now,
                    CreatorID       = CommService.GetUserId(),
                    quantity        = item.Quantity,
                    itemid          = item.ProductId,
                    StoreID         = order.StoreId,
                    Price           = item.Price,
                    ManufactureDate = Share.Todate(item.NgaySanXuat),
                    ExpirationDate  = Share.Todate(item.HanSuDung),
                });
            }
            var msg = "";
            var rs  = service.Xuatkho(tblorder, listDetail, ref msg);

            if (string.IsNullOrEmpty(msg))
            {
                msg = "Tạo phiếu lỗi";
            }
            return(Json(new { ResponseCode = (rs ? "01" : "00"), Message = (rs ? "Tạo phiếu thành công" : msg) }, JsonRequestBehavior.AllowGet));

            return(null);
        }
コード例 #20
0
        public ActionResult GetPSKUpage(string pagenum, string onepagecount, string shopID)
        {
            ComResult com = new ComResult();

            try
            {
                if (!Regex.IsMatch(pagenum, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(pagenum))
                {
                    com.Msg   = "只能是数字";
                    com.State = 0;
                    return(Json(com));
                }
                if (!Regex.IsMatch(onepagecount, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(onepagecount))
                {
                    com.Msg   = "只能是数字";
                    com.State = 0;
                    return(Json(com));
                }
                if (!Regex.IsMatch(shopID, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(shopID))
                {
                    com.Msg   = "只能是数字";
                    com.State = 0;
                    return(Json(com));
                }
                if (string.IsNullOrEmpty(shopID))
                {
                    com.Msg   = "没有选择店铺";
                    com.State = 0;
                    return(Json(com));
                }
                int           totil       = 0;
                int           totilpage   = 0;
                var           PSKUlist    = CommService.GetPSKUListByshopID(Convert.ToInt32(pagenum), Convert.ToInt32(onepagecount), Convert.ToInt32(shopID), out totil, out totilpage);
                PSKUViewmodel mypkskulist = new PSKUViewmodel();
                mypkskulist.PSKUlist   = PSKUlist;
                mypkskulist.totilcount = totil.ToString();
                mypkskulist.totilpage  = totilpage.ToString();
                com.State      = 1;
                com.DataResult = mypkskulist;
                return(Json(com));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #21
0
        public JsonResult Add(Order order, List <OrderDetail> orderdetails)
        {
            var tblorder = new tbl_TransferOrder
            {
                SysHotelID  = CommService.GetHotelId(),
                CreatorID   = CommService.GetUserId(),
                DateCreated = DateTime.Now,
                Status      = 1,
                SupplierID  = 0,
                OrderCode   = order.SoPhieu,
                //  SupplierCode = order.SoChungTu,
                InputDate = Share.Todate(order.NgayNhapHD),
                //  DatePayment = DateTime.ParseExact(order.NgayChungTu, "dd/MM/yyyy", CultureInfo.InvariantCulture)
            };
            List <tbl_TransferOrderDetail> listDetail = new List <tbl_TransferOrderDetail>();

            foreach (var item in orderdetails)
            {
                listDetail.Add(new tbl_TransferOrderDetail
                {
                    SysHotelID    = CommService.GetHotelId(),
                    item          = item.ProductName,
                    catalogitemid = item.CateId,
                    catalogitem   = item.CateName,
                    DateCreated   = DateTime.Now,
                    CreatorID     = CommService.GetUserId(),
                    quantity      = item.Quantity,
                    itemid        = item.ProductId,
                    StoreID       = order.StoreId,
                    FromStoreId   = order.SrcStoreId,
                    Price         = item.Price,
                });
            }
            var msg = "";
            var rs  = service.StoreTransfer(tblorder, listDetail, ref msg);

            if (string.IsNullOrEmpty(msg))
            {
                msg = "Tạo phiếu lỗi";
            }
            return(Json(new { ResponseCode = (rs ? "01" : "00"), Message = (rs ? "Tạo phiếu thành công" : msg) }, JsonRequestBehavior.AllowGet));
        }
コード例 #22
0
        public ActionResult GetAllPSkuByShopID(int shopID)
        {
            ComResult com = new ComResult();

            try
            {
                int totil     = 0;
                int totilpage = 0;
                //默认取第一页,每页2000条数据,相当于全部查询出来,和以前的函数兼容
                var PSKUlist = CommService.GetPSKUListByshopID(1, 2000, shopID, out totil, out totilpage);
                com.State      = 1;
                com.DataResult = PSKUlist;
                return(Json(com));
            }
            catch (Exception ex)
            {
                com.State = 0;
                com.Msg   = ex.Message;
                return(Json(com));
            }
        }
コード例 #23
0
        public PartialViewResult checkRoom(string dtFrom, string dtTo, int?typeRoomId)
        {
            DateTime dt1 = CommService.ConvertStringToDate(dtFrom);
            DateTime dt2 = CommService.ConvertStringToDate(dtTo);

            //khởi tạo ngày mặc định
            if (dt1.Year == 1900)
            {
                dt1 = DateTime.Now;
            }
            if (dt2.Year == 1900)
            {
                dt2 = DateTime.Now.AddDays(1);
            }

            ViewBag.dtFrom = dt1;
            ViewBag.dtTo   = dt2;

            List <tbl_Room> result = new ReservationService().getRoomAvailable(dtFrom, dtTo, typeRoomId);

            return(PartialView("checkRoom", result));
        }
コード例 #24
0
ファイル: Receiver.cs プロジェクト: CodeWizrd/RemoteNoSQLDB
 //----< Create CommService and listener and start it >---------------
 public bool StartService()
 {
     if(Util.verbose)
     Console.Write("\n  Receiver starting service");
       try
       {
     host = CreateListener();
     host.Open();
     svc = new CommService();
       }
       catch (Exception ex)
       {
     Console.Write("\n\n --- creation of Receiver listener failed ---\n");
     Console.Write("\n    {0}", ex.Message);
     Console.Write("\n    exiting\n\n");
     return false;
       }
       return true;
 }
コード例 #25
0
        /// <summary>
        /// lấy ds phòng theo hạng phòng
        /// </summary>
        /// <param name="roomtypeid"></param>
        /// <returns></returns>
        public JsonResult GetAllRoomByRoomTypeID(int roomtypeid)
        {
            List <tbl_Room> lst = new CommService().GetAllRoomByTypeId(roomtypeid);

            return(Json(new { result = lst }, JsonRequestBehavior.AllowGet));
        }
コード例 #26
0
        /// <summary>
        /// lấy reservationid theo phòng đang đặt
        /// </summary>
        /// <param name="roomtypeid"></param>
        /// <returns></returns>
        public JsonResult GetReservationIDByRoomID(int roomid)
        {
            tbl_Reservation_Room lst = new CommService().GetReservationIDByRoomID(roomid);

            return(Json(new { result = lst }, JsonRequestBehavior.AllowGet));
        }
コード例 #27
0
        /// <summary>
        /// lấy checkin theo phòng đang ở
        /// </summary>
        /// <param name="roomtypeid"></param>
        /// <returns></returns>
        public JsonResult GetCheckInIDByRoomID(int roomid)
        {
            tbl_RoomUsing lst = new CommService().GetCheckInIDByRoomID(roomid);

            return(Json(new { result = lst }, JsonRequestBehavior.AllowGet));
        }
コード例 #28
0
        /// <summary>
        /// lấy hạng phòng theo id phòng
        /// </summary>
        /// <param name="roomid"></param>
        /// <returns></returns>
        public JsonResult GetRoomTypeByRoomID(int roomid)
        {
            tbl_Room_Type o = new CommService().GetRoomTypeByRoomID(roomid);

            return(Json(new { result = o }, JsonRequestBehavior.AllowGet));
        }
コード例 #29
0
        /// <summary>
        /// 导出已选择快递到excel  string packgecode, int ispacked, int pageSize, int pageIndex=1
        /// </summary>
        /// <returns></returns>
        public ActionResult ExportToExcel(int expressid, int ispacked, DateTime?starttime, DateTime?endtime)
        {
            DBModel.Common.ComResult res = new DBModel.Common.ComResult();
            //if (1==ispacked)
            //{
            //    res.Msg = "已导出包裹不能再导";
            //    res.State = 0;
            //    return Json(res);
            //}
            int count = 0;
            List <ExpressPackgeModel> list = _service.GetExpressPackgeAllList(expressid, ispacked, out count, starttime, endtime);
            ///导出数据
            string mymsg       = string.Empty;
            string filename    = "Excel" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
            string FilePath    = "\\DownExcel\\" + filename; // AppDomain.CurrentDomain.BaseDirectory +
            string expressname = CommService.GetExpressByID(expressid);
            //bool excisok = ExcelHelper.ListToExcel<ExportViewmodel>(newlist, FilePath, out mymsg);
            DataTable dt = new DataTable();

            dt.Columns.Add("发货时间", typeof(string));
            dt.Columns.Add("包裹号", typeof(string));
            dt.Columns.Add("客户名", typeof(string));
            dt.Columns.Add("客户前地址", typeof(string));
            dt.Columns.Add("客户后地址", typeof(string));
            dt.Columns.Add("客户电话", typeof(string));
            dt.Columns.Add("客户邮编", typeof(string));
            dt.Columns.Add("仓库地址", typeof(string));
            dt.Columns.Add("仓库邮编", typeof(string));
            dt.Columns.Add("店铺名称", typeof(string));
            dt.Columns.Add("仓库电话", typeof(string));
            dt.Columns.Add("sku", typeof(string));
            dt.Columns.Add("打印sku1", typeof(string));
            dt.Columns.Add("打印sku2", typeof(string));
            dt.Columns.Add("发货类型", typeof(string));
            dt.Columns.Add("请求代号", typeof(string));
            dt.Columns.Add("请求管理代号", typeof(string));
            dt.Columns.Add("运送管理代号", typeof(string));
            dt.Columns.Add("客户管理番号", typeof(string));

            foreach (var item2 in list)
            {
                DataRow dr = dt.NewRow();
                dr["发货时间"]  = item2.sendtime;
                dr["包裹号"]   = item2.packgecode;
                dr["客户名"]   = item2.custname;
                dr["客户前地址"] = item2.custaddress1;
                dr["客户后地址"] = item2.custaddress2;
                if (item2.custphone.Length < 3)//说明为空
                {
                    dr["客户电话"] = item2.custmobile;
                }
                else
                {
                    dr["客户电话"] = item2.custphone;
                }
                dr["客户邮编"]   = item2.custzip;
                dr["仓库地址"]   = item2.shopaddress;
                dr["仓库邮编"]   = item2.shopzip;
                dr["店铺名称"]   = item2.shopname;
                dr["仓库电话"]   = item2.shopphone;
                dr["sku"]    = item2.sku;
                dr["打印sku1"] = item2.sku1;
                dr["打印sku2"] = item2.sku2;
                if (expressname == "yamato")
                {
                    dr["发货类型"] = 3;
                }
                else if (expressname == "宅急便")
                {
                    dr["发货类型"] = 0;
                }
                else
                {
                    dr["发货类型"] = 1;//其他暂时为 1
                }
                dr["请求代号"]   = item2.daihao;
                dr["请求管理代号"] = item2.mangagedaihao;
                dr["运送管理代号"] = item2.senddaihao;
                dr["客户管理番号"] = item2.packgecode;
                dt.Rows.Add(dr);
            }
            int    a       = dt.Rows.Count;
            string error   = string.Empty;
            bool   excisok = ExcelHelper.ExcelOutResult(FilePath, dt, "", out error);

            if (excisok)
            {
                res.Msg   = "导出成功";
                res.State = 1;
                res.URL   = "../DownExcel/" + filename;
                return(Json(res));
            }
            else
            {
                res.Msg   = "导出失败";
                res.State = 0;
                return(Json(res));
            }
        }
コード例 #30
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     CommService cs = new CommService();
     //cs.PostMessage(FileNameTextBox.Text);
 }
コード例 #31
0
        public PartialViewResult GetRoom(string id)
        {
            var obj = new CommService().GetAllRoomByTypeId(int.Parse(id));

            return(PartialView("_ptvRoom", obj));
        }