Beispiel #1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void Bind()
        {
            try
            {
                string LocationId = "";
                string UserId     = Session["UserID"].ToString();
                if (Client.Session["Role"].ToString() == "SMOSECAdmin")
                {
                    var user = _autofacConfig.coreUserService.GetUserByID(UserId);
                    LocationId = user.USER_LOCATIONID;
                }

                DataTable assborrowTable = _autofacConfig.AssetsService.GetCoByUserId(Client.Session["Role"].ToString() == "SMOSECUser" ? Client.Session["UserID"].ToString() : "", LocationId);
                ListViewCO.Rows.Clear();
                if (assborrowTable.Rows.Count > 0)
                {
                    ListViewCO.DataSource = assborrowTable;
                    ListViewCO.DataBind();
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Beispiel #2
0
 private void Bind()
 {
     try
     {
         DataTable assborrowTable = _autofacConfig.AssetsService.GetCoByUserId("");
         ListViewCO.Rows.Clear();
         if (assborrowTable.Rows.Count > 0)
         {
             ListViewCO.DataSource = assborrowTable;
             ListViewCO.DataBind();
         }
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }