Exemplo n.º 1
0
        protected void dbStaffList_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            string StyleID = dgAssetLocation.DataKeys[e.Item.ItemIndex].ToString();
            AssetCurrentLocation at = new AssetCurrentLocation();
            at.ID = int.Parse(StyleID);
            at.Delete();

            Bangding();
        }
Exemplo n.º 2
0
        private void Bangding()
        {
            AssetCurrentLocation at = new AssetCurrentLocation();
            AssetCurrentLocation[] atArrary = AssetCurrentLocation.FindAll();

            DataTable dt = Converter.ConvertToDataTable(atArrary);
            dt.Columns[0].ColumnName = "ID";
            dt.Columns[1].ColumnName = "Name";
            dt.Columns[2].ColumnName = "Remark";

            this.dgAssetLocation.DataSource = dt;
            this.dgAssetLocation.DataBind();
        }
Exemplo n.º 3
0
        private void BindDDL()
        {
            //8 droplist
            //location
            AssetCurrentLocation at = new AssetCurrentLocation();
            AssetCurrentLocation[] atArrary = AssetCurrentLocation.FindAll();
            DataTable dt = Converter.ConvertToDataTable(atArrary);
            dt.Columns[0].ColumnName = "ID";
            dt.Columns[1].ColumnName = "Name";
            this.ddlLocation.DataTextField = "Name";
            this.ddlLocation.DataValueField = "ID";
            this.ddlLocation.DataSource = dt;
            this.ddlLocation.DataBind();

            //state
            AssetUseState[] auArrary = AssetUseState.FindAll();
            DataTable dt1 = Converter.ConvertToDataTable(auArrary);
            dt1.Columns[0].ColumnName = "ID";
            dt1.Columns[1].ColumnName = "Name";
            ddlUseState.DataTextField = "Name";
            this.ddlUseState.DataValueField = "ID";
            this.ddlUseState.DataSource = dt1;
            this.ddlUseState.DataBind();

            //type
            AssetType[] attArrary = AssetType.FindAll();
            DataTable dt2 = Converter.ConvertToDataTable(attArrary);
            dt2.Columns[0].ColumnName = "ID";
            dt2.Columns[1].ColumnName = "Name";
            ddlType.DataTextField = "Name";
            this.ddlType.DataValueField = "ID";
            this.ddlType.DataSource = dt2;
            this.ddlType.DataBind();

            #region 协同人员列表初始化
            UDS.Components.Staff staff = new UDS.Components.Staff();
            try
            {

                ddlBuyUser.DataTextField = "Staff_Name";
                ddlBuyUser.DataValueField = "Staff_ID";
                ddlBuyUser.DataSource = staff.GetAllStaffs();
                ddlBuyUser.DataBind();

                ddlCurrentUser.DataTextField = "Staff_Name";
                ddlCurrentUser.DataValueField = "Staff_ID";
                ddlCurrentUser.DataSource = staff.GetAllStaffs();
                ddlCurrentUser.DataBind();

                ddlOriginalUser.DataTextField = "Staff_Name";
                ddlOriginalUser.DataValueField = "Staff_ID";
                ddlOriginalUser.DataSource = staff.GetAllStaffs();
                ddlOriginalUser.DataBind();

            }
            catch (Exception e)
            {
                UDS.Components.Error.Log(e.ToString());
                Server.Transfer("../Error.aspx");
            }
            finally
            {
                staff = null;
            }
            #endregion
        }