Ejemplo n.º 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;
         //}
         if (Client.Session["permission"].ToString() == "guset")
         {
             plButton.Visible = false;
         }
         //DataTable assborrowTable = _autofacConfig.SettingService.GetBorrowedAss();
         DataTable assborrowTable = _autofacConfig.AssetsService.GetAllBo();
         ListViewBorrow.Rows.Clear();
         if (assborrowTable.Rows.Count > 0)
         {
             ListViewBorrow.DataSource = assborrowTable;
             ListViewBorrow.DataBind();
         }
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }
Ejemplo n.º 2
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;
         }
         if (Client.Session["Role"].ToString() == "SMOSECUser")
         {
             plButton.Visible = false;
         }
         DataTable assborrowTable = _autofacConfig.AssetsService.GetBoByUserId(Client.Session["Role"].ToString() == "SMOSECUser" ? Client.Session["UserID"].ToString() : "", LocationId);
         ListViewBorrow.Rows.Clear();
         if (assborrowTable.Rows.Count > 0)
         {
             ListViewBorrow.DataSource = assborrowTable;
             ListViewBorrow.DataBind();
         }
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }
Ejemplo n.º 3
0
 private void Bind()
 {
     try
     {
         DataTable assborrowTable = _autofacConfig.AssetsService.GetBoByUserId("");
         ListViewBorrow.Rows.Clear();
         if (assborrowTable.Rows.Count > 0)
         {
             ListViewBorrow.DataSource = assborrowTable;
             ListViewBorrow.DataBind();
         }
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }