Exemplo n.º 1
0
        protected void grdUser_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            string strCA = e.CommandArgument.ToString();

            switch (e.CommandName)
            {
            case "Edit":
                Insert = false;
                Id     = strCA;
                List <CityInfo>     ListCity    = CityService.CityInfo_GetByAll();
                List <DistrictInfo> Listdistric = DistrictService.DistrictInfo_GetById(Id);
                txtDistrictID.Text = Listdistric[0].DistrictID;
                //ddlCity.SelectedIndex = ListCity[0].
                txtDistrictName.Text = Listdistric[0].DistrictName;

                pnView.Visible   = false;
                pnUpdate.Visible = true;
                break;

            case "Delete":
                DistrictService.DistrictInfo_Delete(strCA);
                BindGrid();
                break;
            }
        }