Exemple #1
0
        //
        // GET: /Main/
        public ActionResult Index()
        {
            ViewData["flag"] = 0;
            #region 加载厂家信息
                SystemData systemData = new SystemData();
                DataTable sysList = systemData.GetSysList();
                Dictionary<string, string> vendorList = new Dictionary<string, string>();
                if (sysList.Rows.Count > 0)
                {
                    for (int i = 0; i < sysList.Rows.Count; i++)
                    {
                        string id = sysList.Rows[i]["VendorID"].ToString();
                        string text = sysList.Rows[i]["VendorDescr"].ToString();
                        if (!vendorList.ContainsValue(text) && text != "")
                        {
                            vendorList.Add(id, text);

                        }
                    }
                }
                ViewData["VendorList"] = vendorList;
            #endregion
            return View();
        }
 public ActionResult GetVendorInfo(string id)
 {
     string text = id;
     if (text.Length == 1)
     {
         text = "00" + text;
     }
     else
     {
         if (text.Length == 2)
         {
             text = "0" + text;
         }
     }
     SystemData systemData = new SystemData();
     DataTable dtList = systemData.GetSysList();
     IList<Vendor> list = CoreLib.Common.GetList<Vendor>(dtList);
     var newList = from Vendor s in list
             where s.VendorID == text
             select s;
     return Json(newList);
 }